diff --git a/src/commands/clearWarnings.ts b/src/commands/clearWarnings.ts index 76f4b04..8fb2fb0 100644 --- a/src/commands/clearWarnings.ts +++ b/src/commands/clearWarnings.ts @@ -15,7 +15,7 @@ export function command (message: discord.Message) { message.channel.send(`${user.toString()}, you have no warnings to clear.`); } - logger.info(`${message.author.username} has cleared all warnings for ${user} ${user.username} [${count.length}].`); - state.logChannel.send(`${message.author.toString()} has cleared all warnings for ${user.toString()} [${count.length}].`); + logger.info(`${message.author.username} has cleared all warnings for ${user} ${user.username} [${count?.length}].`); + state.logChannel.send(`${message.author.toString()} has cleared all warnings for ${user.toString()} [${count?.length}].`); }); }; diff --git a/src/commands/grantDeveloper.ts b/src/commands/grantDeveloper.ts index d5866a3..8019e9c 100644 --- a/src/commands/grantDeveloper.ts +++ b/src/commands/grantDeveloper.ts @@ -21,14 +21,14 @@ export function command (message: discord.Message) { } if (alreadyJoined) { - member?.roles.remove(role).then(() => { + member.roles.remove(role).then(() => { message.channel.send(`${user.toString()}'s speech has been revoked in the #development channel.`); }).catch(() => { state.logChannel.send(`Error revoking ${user.toString()}'s developer speech...`); logger.error(`Error revoking ${user} ${user.username}'s developer speech...`); }); } else { - member?.roles.add(role).then(() => { + member.roles.add(role).then(() => { message.channel.send(`${user.toString()} has been granted speech in the #development channel.`); }).catch(() => { state.logChannel.send(`Error granting ${user.toString()}'s developer speech...`); diff --git a/src/server.ts b/src/server.ts index e38b2da..55273f3 100644 --- a/src/server.ts +++ b/src/server.ts @@ -90,7 +90,7 @@ client.on('messageDelete', message => { .setColor('RED'); state.msglogChannel.send(deletionEmbed); - logger.info(`${message.author.username} ${message.author} deleted message: ${message.cleanContent}.`); + logger.info(`${message.author?.username} ${message.author} deleted message: ${message.cleanContent}.`); } } });