generated from nhcarrigan/template
Compare commits
2 Commits
867594efbe
...
ef00f107e9
Author | SHA1 | Date | |
---|---|---|---|
ef00f107e9 | |||
790be688ea |
10
src/index.ts
10
src/index.ts
@ -6,7 +6,7 @@
|
||||
|
||||
import { AtpAgent } from "@atproto/api";
|
||||
import pkg from "@slack/bolt";
|
||||
import { Client, Events } from "discord.js";
|
||||
import { Client, Events, MessageFlags } from "discord.js";
|
||||
import { scheduleJob } from "node-schedule";
|
||||
import { serve } from "./server/serve.js";
|
||||
import { getMommy } from "./utils/getMommy.js";
|
||||
@ -25,7 +25,7 @@ discord.on(Events.InteractionCreate, async(interaction) => {
|
||||
if (!interaction.isChatInputCommand()) {
|
||||
return;
|
||||
}
|
||||
await interaction.deferReply();
|
||||
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
|
||||
const name = interaction.options.getString("name");
|
||||
const response = await getMommy(name ?? undefined);
|
||||
await interaction.editReply(response);
|
||||
@ -38,19 +38,19 @@ const slack = new App({
|
||||
installerOptions: {
|
||||
directInstall: true,
|
||||
},
|
||||
scopes: [ "commands", "chat:write" ],
|
||||
scopes: [ "commands" ],
|
||||
signingSecret: process.env.SLACK_SIGNING_SECRET ?? "",
|
||||
stateSecret: process.env.SLACK_STATE_SECRET ?? "",
|
||||
});
|
||||
|
||||
slack.command("/mommy", async({ ack, body, say }) => {
|
||||
slack.command("/mommy", async({ ack, body, respond }) => {
|
||||
await ack();
|
||||
const trimmed = body.text.trim();
|
||||
const name = trimmed.length > 0
|
||||
? trimmed
|
||||
: undefined;
|
||||
const response = await getMommy(name);
|
||||
await say(response);
|
||||
await respond(response);
|
||||
});
|
||||
|
||||
const bsky = new AtpAgent({
|
||||
|
Loading…
x
Reference in New Issue
Block a user