diff --git a/src/commands/Core/help.js b/src/commands/Core/help.js index 5e0a58035e..34d2fbccee 100644 --- a/src/commands/Core/help.js +++ b/src/commands/Core/help.js @@ -1,4 +1,4 @@ -import { +import { SlashCommandBuilder, ActionRowBuilder, ButtonBuilder, @@ -44,7 +44,7 @@ const CATEGORY_ICONS = { -async function createInitialHelpMenu() { +async function createInitialHelpMenu(client) { const commandsPath = path.join(__dirname, "../../commands"); const categoryDirs = ( await fs.readdir(commandsPath, { withFileTypes: true }) @@ -72,8 +72,9 @@ async function createInitialHelpMenu() { }), ]; + const botName = client?.user?.username || "Bot"; const embed = createEmbed({ - title: "🤖 TitanBot Help Center", + title: `🤖 ${botName} Help Center`, description: "Your all-in-one Discord companion for moderation, economy, fun, and server management.", color: 'primary' }); @@ -204,7 +205,7 @@ export default { const { MessageFlags } = await import('discord.js'); await InteractionHelper.safeDefer(interaction); - const { embeds, components } = await createInitialHelpMenu(); + const { embeds, components } = await createInitialHelpMenu(client); await InteractionHelper.safeEditReply(interaction, { embeds, diff --git a/src/commands/Welcome/goodbye.js b/src/commands/Welcome/goodbye.js index dcfd25e318..736924a5a2 100644 --- a/src/commands/Welcome/goodbye.js +++ b/src/commands/Welcome/goodbye.js @@ -62,7 +62,7 @@ export default { const ping = options.getBoolean('ping') ?? false; const existingConfig = await getWelcomeConfig(client, guild.id); - if (hasGoodbyeSetup(existingConfig)) { + if (existingConfig?.goodbyeChannelId) { logger.info(`[Goodbye] Setup blocked because config already exists in channel ${existingConfig.goodbyeChannelId} for guild ${guild.id}`); return await InteractionHelper.safeEditReply(interaction, { embeds: [errorEmbed( diff --git a/src/commands/Welcome/welcome.js b/src/commands/Welcome/welcome.js index 02d864b62d..4461b0ba7e 100644 --- a/src/commands/Welcome/welcome.js +++ b/src/commands/Welcome/welcome.js @@ -67,7 +67,7 @@ export default { const ping = options.getBoolean('ping') ?? false; const existingConfig = await getWelcomeConfig(client, guild.id); - if (hasWelcomeSetup(existingConfig)) { + if (existingConfig?.channelId) { logger.info(`[Welcome] Setup blocked because config already exists in channel ${existingConfig.channelId} for guild ${guild.id}`); return await InteractionHelper.safeEditReply(interaction, { embeds: [errorEmbed(