Correct listeners

pull/143/head
bobloy 4 years ago
parent c428fa3131
commit ec5d713fa0

@ -6,4 +6,3 @@ def setup(bot):
n = Hangman(bot) n = Hangman(bot)
data_manager.bundled_data_path(n) data_manager.bundled_data_path(n)
bot.add_cog(n) bot.add_cog(n)
bot.add_listener(n.on_react, "on_reaction_add")

@ -50,27 +50,27 @@ class Hangman(Cog):
theface = await self.config.guild(guild).theface() theface = await self.config.guild(guild).theface()
self.hanglist[guild] = ( self.hanglist[guild] = (
"""> """>
\_________ \\_________
|/ |/
| |
| |
| |
| |
| |
|\___ |\\___
""", """,
"""> """>
\_________ \\_________
|/ | |/ |
| |
| |
| |
| |
| |
|\___ |\\___
H""", H""",
"""> """>
\_________ \\_________
|/ | |/ |
| """ | """
+ theface + theface
@ -79,10 +79,10 @@ class Hangman(Cog):
| |
| |
| |
|\___ |\\___
HA""", HA""",
"""> """>
\________ \\________
|/ | |/ |
| """ | """
+ theface + theface
@ -91,10 +91,10 @@ class Hangman(Cog):
| | | |
| |
| |
|\___ |\\___
HAN""", HAN""",
"""> """>
\_________ \\_________
|/ | |/ |
| """ | """
+ theface + theface
@ -103,43 +103,43 @@ class Hangman(Cog):
| | | |
| |
| |
|\___ |\\___
HANG""", HANG""",
"""> """>
\_________ \\_________
|/ | |/ |
| """ | """
+ theface + theface
+ """ + """
| /|\ | /|\\
| | | |
| |
| |
|\___ |\\___
HANGM""", HANGM""",
"""> """>
\________ \\________
|/ | |/ |
| """ | """
+ theface + theface
+ """ + """
| /|\ | /|\\
| | | |
| / | /
| |
|\___ |\\___
HANGMA""", HANGMA""",
"""> """>
\________ \\________
|/ | |/ |
| """ | """
+ theface + theface
+ """ + """
| /|\ | /|\\
| | | |
| / \ | / \\
| |
|\___ |\\___
HANGMAN""", HANGMAN""",
) )
@ -255,7 +255,7 @@ class Hangman(Cog):
elif i in self.the_data[guild]["guesses"] or i not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": elif i in self.the_data[guild]["guesses"] or i not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
out_str += "__" + i + "__ " out_str += "__" + i + "__ "
else: else:
out_str += "**\_** " out_str += "**\\_** "
self.winbool[guild] = False self.winbool[guild] = False
return out_str return out_str
@ -286,9 +286,9 @@ class Hangman(Cog):
await self._reprintgame(message) await self._reprintgame(message)
@commands.Cog.listener() @commands.Cog.listener("on_reaction_add")
async def on_react(self, reaction, user: Union[discord.User, discord.Member]): async def on_react(self, reaction, user: Union[discord.User, discord.Member]):
""" Thanks to flapjack reactpoll for guidelines """Thanks to flapjack reactpoll for guidelines
https://github.com/flapjax/FlapJack-Cogs/blob/master/reactpoll/reactpoll.py""" https://github.com/flapjax/FlapJack-Cogs/blob/master/reactpoll/reactpoll.py"""
guild: discord.Guild = getattr(user, "guild", None) guild: discord.Guild = getattr(user, "guild", None)
if guild is None: if guild is None:

Loading…
Cancel
Save