From 154ad0ade4d4ff47a44adecd2880110a7e5e83bb Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Wed, 17 May 2023 17:50:08 -0700 Subject: [PATCH] Fix possible absence of GuildMember --- src/commands/contributors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/contributors.ts b/src/commands/contributors.ts index e53e4d3..2eda238 100644 --- a/src/commands/contributors.ts +++ b/src/commands/contributors.ts @@ -4,7 +4,7 @@ export default { run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){ interaction.reply({embeds: [new client.embed().setColor(client.config.embedColor).setTitle('Daggerbot contributors').setDescription([ '**Thanks to those below that contributed to/developed the bot!**', - `${client.config.whitelist.map(id=>{const member = interaction.guild.members.cache.get(id) as Discord.GuildMember; return `${member.user.username} <@${id}>`}).join('\n')}` + client.config.whitelist.map(id=>{const member = interaction.guild.members.cache.get(id); return `${member?.user?.username ?? 'N/A'} <@${id}>`}).join('\n') ].join('\n'))]}) }, data: new SlashCommandBuilder()