aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/connect_four.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/evergreen/connect_four.py')
-rw-r--r--bot/exts/evergreen/connect_four.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bot/exts/evergreen/connect_four.py b/bot/exts/evergreen/connect_four.py
index bf604e2a..02e876f4 100644
--- a/bot/exts/evergreen/connect_four.py
+++ b/bot/exts/evergreen/connect_four.py
@@ -4,6 +4,7 @@ import typing
from functools import partial
import discord
+import emojis
from discord.ext import commands
NUMBERS = [
@@ -342,11 +343,13 @@ class ConnectFour(commands.Cog):
return any(player in (game.player1, game.player2) for game in self.games)
@staticmethod
- def check_emojis(e1: EMOJI_CHECK, e2: EMOJI_CHECK) -> typing.Tuple[bool, typing.Optional[str]]:
+ def check_emojis(
+ e1: EMOJI_CHECK, e2: EMOJI_CHECK
+ ) -> typing.Tuple[bool, typing.Optional[str]]:
"""Validate the emojis, the user put."""
- if isinstance(e1, str) and len(e1) > 1:
+ if isinstance(e1, str) and emojis.count(e1) != 1:
return False, e1
- if isinstance(e2, str) and len(e2) > 1:
+ if isinstance(e2, str) and emojis.count(e2) != 1:
return False, e2
return True, None