diff options
Diffstat (limited to 'src/commands/info/help.ts')
-rw-r--r-- | src/commands/info/help.ts | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index ec079e7..d8d91d5 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -211,14 +211,17 @@ export default class HelpCommand extends BushCommand { private addLinks(message: CommandMessage | SlashMessage) { const row = new ActionRowBuilder<ButtonBuilder>(); + const config = this.client.config; - if (!this.client.config.isDevelopment && !this.client.guilds.cache.some((guild) => guild.ownerId === message.author.id)) { + if (!config.isDevelopment && !this.client.guilds.cache.some((guild) => guild.ownerId === message.author.id)) { row.addComponents(new ButtonBuilder({ style: ButtonStyle.Link, label: 'Invite Me', url: invite(this.client) })); } - if (!this.client.guilds.cache.get(this.client.config.supportGuild.id)?.members.cache.has(message.author.id)) { - row.addComponents( - new ButtonBuilder({ style: ButtonStyle.Link, label: 'Support Server', url: this.client.config.supportGuild.invite }) - ); + if ( + config.supportGuild.id && + config.supportGuild.invite && + !this.client.guilds.cache.get(config.supportGuild.id)?.members.cache.has(message.author.id) + ) { + row.addComponents(new ButtonBuilder({ style: ButtonStyle.Link, label: 'Support Server', url: config.supportGuild.invite })); } if (packageDotJSON?.repository) row.addComponents(new ButtonBuilder({ style: ButtonStyle.Link, label: 'GitHub', url: packageDotJSON.repository })); |