No fighting urself

This commit is contained in:
Daniel Odendahl Jr
2017-09-06 21:53:03 +00:00
parent 0f8d485df3
commit 0e783505dc
+1
View File
@@ -23,6 +23,7 @@ module.exports = class TicTacToeCommand extends Command {
async run(msg, args) { // eslint-disable-line complexity
const opponent = args.opponent || this.client.user;
if (opponent.id === msg.author.id) return msg.say('You may not play against yourself.');
if (this.playing.has(msg.channel.id)) return msg.say('Only one game may be occurring per channel.');
this.playing.add(msg.channel.id);
try {