mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 14:19:56 +02:00
Prevent blacklisted users from playing games
This commit is contained in:
@@ -43,6 +43,7 @@ module.exports = class CramCommand extends Command {
|
||||
async run(msg, { opponent, color, size }) {
|
||||
if (opponent.bot) return msg.reply('Bots may not be played against.');
|
||||
if (opponent.id === msg.author.id) return msg.reply('You may not play against 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