1
0
Fork 0

Fix of invites update

This commit is contained in:
Ethanell 2020-11-02 12:30:26 +01:00
parent 38bec0e327
commit 16c74997ee

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):