Prevent blacklisted users from playing games

This commit is contained in:
Dragon Fire
2021-02-14 20:46:12 -05:00
parent ddd1eeb317
commit f98e1700d5
29 changed files with 30 additions and 10 deletions
+1
View File
@@ -25,6 +25,7 @@ module.exports = class GunfightCommand extends Command {
async run(msg, { opponent }) {
if (opponent.bot) return msg.reply('Bots may not be fought.');
if (opponent.id === msg.author.id) return msg.reply('You may not fight yourself.');
if (this.client.blacklist.user.includes(opponent.id)) return msg.reply('This user is blacklisted.');
const current = this.client.games.get(msg.channel.id);
if (current) return msg.reply(`Please wait until the current game of \`${current.name}\` is finished.`);
this.client.games.set(msg.channel.id, { name: this.name });