From 4b8fa012da2f2767d2242909d4a966d40fc77f0e Mon Sep 17 00:00:00 2001 From: Mattia Succurro Date: Fri, 17 Jan 2025 10:55:17 +0100 Subject: [PATCH] bug fixes --- src/commandList.ts | 4 +++- src/commands/wiki.ts | 4 +++- src/register.ts | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/commandList.ts b/src/commandList.ts index d0ffc12..43fbaeb 100644 --- a/src/commandList.ts +++ b/src/commandList.ts @@ -16,9 +16,11 @@ limitations under the License. import { SlashCommandOptionsOnlyBuilder } from 'discord.js'; import yroo from './commands/yroo'; +import wiki from './commands/wiki'; const commandList = [ - yroo + yroo, + wiki ]; export default commandList; diff --git a/src/commands/wiki.ts b/src/commands/wiki.ts index fc5a276..88d26bc 100644 --- a/src/commands/wiki.ts +++ b/src/commands/wiki.ts @@ -47,4 +47,6 @@ async function execute (interaction: ChatInputCommandInteraction) { await interaction.followUp({ embeds: [pageEmbed] }); -} \ No newline at end of file +} + +export default { data, execute }; diff --git a/src/register.ts b/src/register.ts index 177f18b..925b64a 100644 --- a/src/register.ts +++ b/src/register.ts @@ -26,7 +26,11 @@ for (let command of commandList) { commands.push(command.data.toJSON()); } -const guilds = process.env.GUILD_IDS.trim().split(/[\s,;]+/); +if (process.env.GUILD_IDS === void 0){ + console.warn('GUILD_IDS not set, registering commands globally'); +} + +const guilds = (process.env.GUILD_IDS ?? '').trim().split(/[\s,;]+/); const rest = new REST({ version: '10' }).setToken(process.env.TOKEN);