Skip to content

Commit

Permalink
Add invite command
Browse files Browse the repository at this point in the history
  • Loading branch information
Hacksore committed Sep 17, 2024
1 parent a0483fe commit 5f92cff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/bot/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ export const HELP = defineCommand({
integration_types: [USER_INSTALL, GUILD_INSTALL],
contexts: [0, 1, 2],
});

export const INVITE = defineCommand({
name: "invite",
description: "Join the Overlayed discord",
integration_types: [USER_INSTALL, GUILD_INSTALL],
contexts: [0, 1, 2],
});
11 changes: 11 additions & 0 deletions apps/bot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
CANARY,
HELP,
INFO,
INVITE,
} from "./commands.js";
import { Bindings } from "./types.js";
import { verifyDiscordRequest } from "./utils.js";
Expand Down Expand Up @@ -92,6 +93,16 @@ app.post("/", async (c) => {
});
}

if (command === INVITE.name.toLowerCase()) {
return c.json({
type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE,
data: {
content: `${LOGO_MOJI} Join the Overlayed Discord
discord.gg/eXmeNkVjye`,
},
});
}

if (command === HELP.name.toLowerCase()) {
return c.json({
type: InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE,
Expand Down

0 comments on commit 5f92cff

Please sign in to comment.