mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Update member if there are discreptancies in db
This commit is contained in:
parent
19ff2ffd46
commit
70b2b266c8
@ -174,8 +174,6 @@ class Titan(discord.AutoShardedClient):
|
||||
await self.socketio.on_guild_member_remove(member)
|
||||
|
||||
async def on_member_update(self, memberbefore, memberafter):
|
||||
if set(memberbefore.roles) != set(memberafter.roles) or memberbefore.avatar != memberafter.avatar or memberbefore.nick != memberafter.nick or memberbefore.name != memberafter.name or memberbefore.discriminator != memberafter.discriminator or memberbefore.status != memberafter.status:
|
||||
if memberbefore.status == memberafter.status:
|
||||
await self.database.update_guild_member(memberafter)
|
||||
await self.socketio.on_guild_member_update(memberafter)
|
||||
|
||||
|
@ -187,6 +187,7 @@ class DatabaseInterface(object):
|
||||
for mem in dbmember[1:]:
|
||||
session.delete(mem)
|
||||
dbmember = dbmember[0]
|
||||
if dbmember.banned != banned or dbmember.active != active or dbmember.username != member.name or dbmember.discriminator != int(member.discriminator) or dbmember.nickname != member.nick or dbmember.avatar != member.avatar or set(json.loads(dbmember.roles)) != set(list_role_ids(member.roles)):
|
||||
dbmember.banned = banned
|
||||
dbmember.active = active
|
||||
dbmember.username = member.name
|
||||
|
Loading…
Reference in New Issue
Block a user