From 0e783505dc8b72c9e2e9dbcf011a3841b9c2c64c Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Wed, 6 Sep 2017 21:53:03 +0000 Subject: [PATCH] No fighting urself --- commands/games/tic-tac-toe.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/games/tic-tac-toe.js b/commands/games/tic-tac-toe.js index 27d48db5..22a72e57 100644 --- a/commands/games/tic-tac-toe.js +++ b/commands/games/tic-tac-toe.js @@ -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 {