diff --git a/src/constants/discord.ts b/src/constants/discord.ts new file mode 100644 index 0000000..0f61f28 --- /dev/null +++ b/src/constants/discord.ts @@ -0,0 +1,30 @@ +import { + ApplicationCommandOptionType, + ApplicationCommandType, +} from "discord-api-types/v10"; +import type { DiscordCommand } from "~/types"; + +/** + * Discord のコマンド一覧 + * * `/roomy today` 今日の教室を確認する + * * `/roomy help` 使い方・コマンド一覧を表示する + */ +export const DISCORD_COMMANDS = [ + { + name: "roomy", + description: "予約している教室を確認する", + type: ApplicationCommandType.ChatInput, + options: [ + { + name: "today", + description: "今日の教室", + type: ApplicationCommandOptionType.Subcommand, + }, + { + name: "help", + description: "使い方・コマンド一覧", + type: ApplicationCommandOptionType.Subcommand, + }, + ], + }, +] as const satisfies DiscordCommand[]; diff --git a/src/constants/config.ts b/src/constants/env.ts similarity index 51% rename from src/constants/config.ts rename to src/constants/env.ts index 6116656..d1eeee0 100644 --- a/src/constants/config.ts +++ b/src/constants/env.ts @@ -1,8 +1,4 @@ -import { - ApplicationCommandOptionType, - ApplicationCommandType, -} from "discord-api-types/v10"; -import type { Bindings, DiscordCommand } from "~/types"; +import type { Bindings } from "~/types"; export const DISCORD_API_BASE_URL = "https://discord.com/api/v10"; @@ -28,23 +24,3 @@ export function parseEnv(env: Bindings) { } export type ParsedEnv = ReturnType; - -export const DISCORD_COMMANDS = [ - { - name: "roomy", - description: "予約している教室を確認する", - type: ApplicationCommandType.ChatInput, - options: [ - { - name: "today", - description: "今日の教室", - type: ApplicationCommandOptionType.Subcommand, - }, - { - name: "help", - description: "使い方・コマンド一覧", - type: ApplicationCommandOptionType.Subcommand, - }, - ], - }, -] as const satisfies DiscordCommand[]; diff --git a/src/constants/index.ts b/src/constants/index.ts index 5c62e04..5f42177 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -1 +1,2 @@ -export * from "./config"; +export * from "./discord"; +export * from "./env";