diff options
| author | Fuwn <[email protected]> | 2025-10-08 00:03:22 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-10-08 00:03:22 -0700 |
| commit | 307076547a829d9342757e3ec5839a54e3ca64dc (patch) | |
| tree | c0c0a04f0501cafba62e211a4b2b2a8c2d323e3d /packages/interactions/discord/commands | |
| parent | fix(gateway:messageDeletion): Better handle privilged actions (diff) | |
| download | umabotdiscord-307076547a829d9342757e3ec5839a54e3ca64dc.tar.xz umabotdiscord-307076547a829d9342757e3ec5839a54e3ca64dc.zip | |
refactor: Move Discord interaction constants to shared constants package
Diffstat (limited to 'packages/interactions/discord/commands')
| -rw-r--r-- | packages/interactions/discord/commands/index.ts | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/packages/interactions/discord/commands/index.ts b/packages/interactions/discord/commands/index.ts index 2c39b28..c22d3aa 100644 --- a/packages/interactions/discord/commands/index.ts +++ b/packages/interactions/discord/commands/index.ts @@ -1,4 +1,8 @@ import type { DiscordCommand } from "../interfaces.ts"; +import { + DISCORD_APPLICATION_COMMAND_OPTION_TYPES, + DISCORD_INTERACTION_CONTEXTS, +} from "../../constants.ts"; export type { DiscordCommand }; @@ -24,7 +28,7 @@ export const TOP_COMMAND: DiscordCommand = { "Fetch a random top post from r/okbuddyumamusume (defaults to today)", options: [ { - type: 3, + type: DISCORD_APPLICATION_COMMAND_OPTION_TYPES.STRING, name: "time", description: "Time period for top posts (defaults to today)", required: false, @@ -61,10 +65,13 @@ export const TOP_COMMAND: DiscordCommand = { export const COMPLAIN_COMMAND: DiscordCommand = { name: "complain", description: "Submit a complaint to the moderators", - contexts: [0, 1], + contexts: [ + DISCORD_INTERACTION_CONTEXTS.GUILD, + DISCORD_INTERACTION_CONTEXTS.BOT_DM, + ], options: [ { - type: 3, + type: DISCORD_APPLICATION_COMMAND_OPTION_TYPES.STRING, name: "message", description: "Your complaint message", required: true, @@ -75,10 +82,13 @@ export const COMPLAIN_COMMAND: DiscordCommand = { export const APPEAL_COMMAND: DiscordCommand = { name: "appeal", description: "Submit an appeal to the moderators", - contexts: [0, 1], + contexts: [ + DISCORD_INTERACTION_CONTEXTS.GUILD, + DISCORD_INTERACTION_CONTEXTS.BOT_DM, + ], options: [ { - type: 3, + type: DISCORD_APPLICATION_COMMAND_OPTION_TYPES.STRING, name: "message", description: "Your appeal message", required: true, @@ -89,10 +99,13 @@ export const APPEAL_COMMAND: DiscordCommand = { export const NSFW_APPLY_COMMAND: DiscordCommand = { name: "nsfw-apply", description: "Submit an NSFW access application to the moderators", - contexts: [0, 1], + contexts: [ + DISCORD_INTERACTION_CONTEXTS.GUILD, + DISCORD_INTERACTION_CONTEXTS.BOT_DM, + ], options: [ { - type: 3, + type: DISCORD_APPLICATION_COMMAND_OPTION_TYPES.STRING, name: "message", description: "Your NSFW access application message", required: true, @@ -111,7 +124,7 @@ export const ROLEPLAY_VERIFY_COMMAND: DiscordCommand = { "Manage the verified roleplay role (Admin/Roleplay Curator only)", options: [ { - type: 3, + type: DISCORD_APPLICATION_COMMAND_OPTION_TYPES.STRING, name: "action", description: "Action to perform on the role", required: true, @@ -131,7 +144,7 @@ export const ROLEPLAY_VERIFY_COMMAND: DiscordCommand = { ], }, { - type: 6, + type: DISCORD_APPLICATION_COMMAND_OPTION_TYPES.USER, name: "user", description: "User to perform the action on", required: true, @@ -144,7 +157,7 @@ export const AGE_VERIFY_COMMAND: DiscordCommand = { description: "Manage the verified age role (Staff only)", options: [ { - type: 3, + type: DISCORD_APPLICATION_COMMAND_OPTION_TYPES.STRING, name: "action", description: "Action to perform on the role", required: true, @@ -164,13 +177,13 @@ export const AGE_VERIFY_COMMAND: DiscordCommand = { ], }, { - type: 6, + type: DISCORD_APPLICATION_COMMAND_OPTION_TYPES.USER, name: "user", description: "User to perform the action on", required: true, }, { - type: 3, + type: DISCORD_APPLICATION_COMMAND_OPTION_TYPES.STRING, name: "access", description: "Type of access to grant", required: true, @@ -186,7 +199,7 @@ export const AGE_VERIFY_COMMAND: DiscordCommand = { ], }, { - type: 3, + type: DISCORD_APPLICATION_COMMAND_OPTION_TYPES.STRING, name: "reason", description: "Reason for verification (how and why you verified the user)", |