mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-22 10:15:41 +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.`);
|
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}].`);
|
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}].`);
|
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) {
|
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.`);
|
message.channel.send(`${user.toString()}'s speech has been revoked in the #development channel.`);
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
state.logChannel.send(`Error revoking ${user.toString()}'s developer speech...`);
|
state.logChannel.send(`Error revoking ${user.toString()}'s developer speech...`);
|
||||||
logger.error(`Error revoking ${user} ${user.username}'s developer speech...`);
|
logger.error(`Error revoking ${user} ${user.username}'s developer speech...`);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
member?.roles.add(role).then(() => {
|
member.roles.add(role).then(() => {
|
||||||
message.channel.send(`${user.toString()} has been granted speech in the #development channel.`);
|
message.channel.send(`${user.toString()} has been granted speech in the #development channel.`);
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
state.logChannel.send(`Error granting ${user.toString()}'s developer speech...`);
|
state.logChannel.send(`Error granting ${user.toString()}'s developer speech...`);
|
||||||
|
@ -90,7 +90,7 @@ client.on('messageDelete', message => {
|
|||||||
.setColor('RED');
|
.setColor('RED');
|
||||||
|
|
||||||
state.msglogChannel.send(deletionEmbed);
|
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