mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 22:34:46 +02:00
Prevent blacklisted users from playing games
This commit is contained in:
@@ -60,6 +60,7 @@ module.exports = class ChessCommand extends Command {
|
||||
|
||||
async run(msg, { opponent, time, fen }) {
|
||||
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