1
0
Fork 0

Merge pull request #35 from flifloo/invite

Fix of invites update
This commit is contained in:
Ethanell 2020-11-02 12:31:32 +01:00
commit b3be65aaa3

View file

@ -71,10 +71,6 @@ class Invite(commands.Cog):
for g in self.bot.guilds:
self.invites[g.id] = await g.invites()
@commands.Cog.listener()
async def on_ready(self):
await self.update_invites()
@commands.Cog.listener()
async def on_member_join(self, member: Member):
user_invites = await member.guild.invites()
@ -91,6 +87,10 @@ class Invite(commands.Cog):
pass
self.invites[member.guild.id] = user_invites
@commands.Cog.listener()
async def on_invite_create(self, invite):
self.invites[invite.guild.id] = await invite.guild.invites()
@commands.Cog.listener()
async def on_invite_delete(self, invite):
s = db.Session()
@ -99,6 +99,7 @@ class Invite(commands.Cog):
s.delete(invite_role)
s.commit()
s.close()
self.invites[invite.guild.id] = await invite.guild.invites()
@commands.Cog.listener()
async def on_guild_join(self, guild: Guild):