Compare commits

..

No commits in common. "ef00f107e9ff4f91de057692aa4675d729485f8b" and "867594efbe7d01db4e9486467698f006108af517" have entirely different histories.

View File

@ -6,7 +6,7 @@
import { AtpAgent } from "@atproto/api"; import { AtpAgent } from "@atproto/api";
import pkg from "@slack/bolt"; import pkg from "@slack/bolt";
import { Client, Events, MessageFlags } from "discord.js"; import { Client, Events } from "discord.js";
import { scheduleJob } from "node-schedule"; import { scheduleJob } from "node-schedule";
import { serve } from "./server/serve.js"; import { serve } from "./server/serve.js";
import { getMommy } from "./utils/getMommy.js"; import { getMommy } from "./utils/getMommy.js";
@ -25,7 +25,7 @@ discord.on(Events.InteractionCreate, async(interaction) => {
if (!interaction.isChatInputCommand()) { if (!interaction.isChatInputCommand()) {
return; return;
} }
await interaction.deferReply({ flags: MessageFlags.Ephemeral }); await interaction.deferReply();
const name = interaction.options.getString("name"); const name = interaction.options.getString("name");
const response = await getMommy(name ?? undefined); const response = await getMommy(name ?? undefined);
await interaction.editReply(response); await interaction.editReply(response);
@ -38,19 +38,19 @@ const slack = new App({
installerOptions: { installerOptions: {
directInstall: true, directInstall: true,
}, },
scopes: [ "commands" ], scopes: [ "commands", "chat:write" ],
signingSecret: process.env.SLACK_SIGNING_SECRET ?? "", signingSecret: process.env.SLACK_SIGNING_SECRET ?? "",
stateSecret: process.env.SLACK_STATE_SECRET ?? "", stateSecret: process.env.SLACK_STATE_SECRET ?? "",
}); });
slack.command("/mommy", async({ ack, body, respond }) => { slack.command("/mommy", async({ ack, body, say }) => {
await ack(); await ack();
const trimmed = body.text.trim(); const trimmed = body.text.trim();
const name = trimmed.length > 0 const name = trimmed.length > 0
? trimmed ? trimmed
: undefined; : undefined;
const response = await getMommy(name); const response = await getMommy(name);
await respond(response); await say(response);
}); });
const bsky = new AtpAgent({ const bsky = new AtpAgent({