From 87cec8cb9588b044bd32298a54ab77f11c139521 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 25 Sep 2025 01:07:35 -0700 Subject: refactor: Move commands into a commands module --- packages/interactions/discord/commands.ts | 125 ------------------------ packages/interactions/discord/commands/index.ts | 125 ++++++++++++++++++++++++ packages/interactions/register.ts | 2 +- packages/interactions/server.ts | 2 +- 4 files changed, 127 insertions(+), 127 deletions(-) delete mode 100644 packages/interactions/discord/commands.ts create mode 100644 packages/interactions/discord/commands/index.ts diff --git a/packages/interactions/discord/commands.ts b/packages/interactions/discord/commands.ts deleted file mode 100644 index 601591b..0000000 --- a/packages/interactions/discord/commands.ts +++ /dev/null @@ -1,125 +0,0 @@ -import type { DiscordCommand } from "./interfaces.ts"; - -export type { DiscordCommand }; - -export const HOT_COMMAND: DiscordCommand = { - name: "hot", - description: "Fetch a random hot post from r/okbuddyumamusume", -}; - -export const ROLEPLAY_COMMAND: DiscordCommand = { - name: "roleplay", - description: "Fetch a random hot roleplay post from r/okbuddyumamusume", -}; - -export const NSFW_COMMAND: DiscordCommand = { - name: "nsfw", - description: - "Fetch a random NSFW post from r/okbuddyumamusume (NSFW channels only)", -}; - -export const TOP_COMMAND: DiscordCommand = { - name: "top", - description: - "Fetch a random top post from r/okbuddyumamusume (defaults to today)", - options: [ - { - type: 3, - name: "time", - description: "Time period for top posts (defaults to today)", - required: false, - choices: [ - { - name: "Now", - value: "hour", - }, - { - name: "Today", - value: "day", - }, - { - name: "This Week", - value: "week", - }, - { - name: "This Month", - value: "month", - }, - { - name: "This Year", - value: "year", - }, - { - name: "All Time", - value: "all", - }, - ], - }, - ], -}; - -export const COMPLAIN_COMMAND: DiscordCommand = { - name: "complain", - description: "Submit a complaint to the moderators", - contexts: [0], - options: [ - { - type: 3, - name: "message", - description: "Your complaint message", - required: true, - }, - ], -}; - -export const APPEAL_COMMAND: DiscordCommand = { - name: "appeal", - description: "Submit an appeal to the moderators", - contexts: [0], - options: [ - { - type: 3, - name: "message", - description: "Your appeal message", - required: true, - }, - ], -}; - -export const COLOURS_COMMAND: DiscordCommand = { - name: "colours", - description: "Show the distribution of colour roles in the server", -}; - -export const ROLEPLAY_SERIOUS_COMMAND: DiscordCommand = { - name: "roleplay-serious", - description: "Manage the serious roleplay role (Admin/Roleplay Curator only)", - options: [ - { - type: 3, - name: "action", - description: "Action to perform on the role", - required: true, - choices: [ - { - name: "Add Role", - value: "add", - }, - { - name: "Remove Role", - value: "remove", - }, - { - name: "Toggle Role", - value: "toggle", - }, - ], - }, - { - type: 6, - name: "user", - description: "User to perform the action on", - required: true, - }, - ], -}; diff --git a/packages/interactions/discord/commands/index.ts b/packages/interactions/discord/commands/index.ts new file mode 100644 index 0000000..115ad4d --- /dev/null +++ b/packages/interactions/discord/commands/index.ts @@ -0,0 +1,125 @@ +import type { DiscordCommand } from "../interfaces.ts"; + +export type { DiscordCommand }; + +export const HOT_COMMAND: DiscordCommand = { + name: "hot", + description: "Fetch a random hot post from r/okbuddyumamusume", +}; + +export const ROLEPLAY_COMMAND: DiscordCommand = { + name: "roleplay", + description: "Fetch a random hot roleplay post from r/okbuddyumamusume", +}; + +export const NSFW_COMMAND: DiscordCommand = { + name: "nsfw", + description: + "Fetch a random NSFW post from r/okbuddyumamusume (NSFW channels only)", +}; + +export const TOP_COMMAND: DiscordCommand = { + name: "top", + description: + "Fetch a random top post from r/okbuddyumamusume (defaults to today)", + options: [ + { + type: 3, + name: "time", + description: "Time period for top posts (defaults to today)", + required: false, + choices: [ + { + name: "Now", + value: "hour", + }, + { + name: "Today", + value: "day", + }, + { + name: "This Week", + value: "week", + }, + { + name: "This Month", + value: "month", + }, + { + name: "This Year", + value: "year", + }, + { + name: "All Time", + value: "all", + }, + ], + }, + ], +}; + +export const COMPLAIN_COMMAND: DiscordCommand = { + name: "complain", + description: "Submit a complaint to the moderators", + contexts: [0], + options: [ + { + type: 3, + name: "message", + description: "Your complaint message", + required: true, + }, + ], +}; + +export const APPEAL_COMMAND: DiscordCommand = { + name: "appeal", + description: "Submit an appeal to the moderators", + contexts: [0], + options: [ + { + type: 3, + name: "message", + description: "Your appeal message", + required: true, + }, + ], +}; + +export const COLOURS_COMMAND: DiscordCommand = { + name: "colours", + description: "Show the distribution of colour roles in the server", +}; + +export const ROLEPLAY_SERIOUS_COMMAND: DiscordCommand = { + name: "roleplay-serious", + description: "Manage the serious roleplay role (Admin/Roleplay Curator only)", + options: [ + { + type: 3, + name: "action", + description: "Action to perform on the role", + required: true, + choices: [ + { + name: "Add Role", + value: "add", + }, + { + name: "Remove Role", + value: "remove", + }, + { + name: "Toggle Role", + value: "toggle", + }, + ], + }, + { + type: 6, + name: "user", + description: "User to perform the action on", + required: true, + }, + ], +}; diff --git a/packages/interactions/register.ts b/packages/interactions/register.ts index a23c9c8..7a9078b 100644 --- a/packages/interactions/register.ts +++ b/packages/interactions/register.ts @@ -8,7 +8,7 @@ import { COLOURS_COMMAND, ROLEPLAY_SERIOUS_COMMAND, type DiscordCommand, -} from "./discord/commands.ts"; +} from "./discord/commands"; import dotenv from "dotenv"; import process from "node:process"; diff --git a/packages/interactions/server.ts b/packages/interactions/server.ts index 097f69f..46bef06 100644 --- a/packages/interactions/server.ts +++ b/packages/interactions/server.ts @@ -9,7 +9,7 @@ import { APPEAL_COMMAND, COLOURS_COMMAND, ROLEPLAY_SERIOUS_COMMAND, -} from "./discord/commands.ts"; +} from "./discord/commands"; import { getCutePost, getRoleplayPost, -- cgit v1.2.3