mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Prevent blacklisted users from playing games
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user