Fix of invites update
This commit is contained in:
parent
38bec0e327
commit
16c74997ee
1 changed files with 5 additions and 4 deletions
|
@ -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):
|
||||
|
|
Reference in a new issue