mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-21 21:25:37 +01:00
meta: fix null check misuses
This commit is contained in:
parent
e22adc4777
commit
89ed704d09
@ -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}].`);
|
||||
});
|
||||
};
|
||||
|
@ -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...`);
|
||||
|
@ -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}.`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user