1
0
Fork 0
mirror of synced 2024-05-02 19:52:25 +12:00

Correct way to use listeners

This commit is contained in:
phxntxm 2019-02-27 18:03:15 -06:00
parent 5f568b37de
commit b75b4f7776
2 changed files with 6 additions and 6 deletions

View file

@ -61,19 +61,19 @@ class StatsUpdate(commands.Cog):
async with self.session.post(url, data=payload, headers=headers) as resp:
log.info('discordbots.com statistics retruned {} for {}'.format(resp.status, payload))
@commands.Cog.listener
@commands.Cog.listener()
async def on_guild_join(self, _):
await self.update()
@commands.Cog.listener
@commands.Cog.listener()
async def on_guild_leave(self, _):
await self.update()
@commands.Cog.listener
@commands.Cog.listener()
async def on_ready(self):
await self.update()
@commands.Cog.listener
@commands.Cog.listener()
async def on_member_join(self, member):
query = """
SELECT
@ -105,7 +105,7 @@ WHERE
except (discord.Forbidden, discord.HTTPException, AttributeError):
pass
@commands.Cog.listener
@commands.Cog.listener()
async def on_member_remove(self, member):
query = """
SELECT

View file

@ -66,7 +66,7 @@ class Polls(commands.Cog):
if p.message.id == message.id:
return p
@commands.Cog.listener
@commands.Cog.listener()
async def on_reaction_add(self, reaction, user):
if user.id == self.bot.user.id:
return