mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-25 06:27:03 +01:00
Filter presence updates to prevent updating everything, which might create cpu hog
This commit is contained in:
parent
aa4fa4ed16
commit
46f5594763
@ -168,8 +168,10 @@ class Titan(discord.Client):
|
|||||||
await self.socketio.on_guild_member_remove(member)
|
await self.socketio.on_guild_member_remove(member)
|
||||||
|
|
||||||
async def on_member_update(self, memberbefore, memberafter):
|
async def on_member_update(self, memberbefore, memberafter):
|
||||||
await self.database.update_guild_member(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.status != memberafter.status:
|
||||||
await self.socketio.on_guild_member_update(memberafter)
|
if memberbefore.status == memberafter.status:
|
||||||
|
await self.database.update_guild_member(memberafter)
|
||||||
|
await self.socketio.on_guild_member_update(memberafter)
|
||||||
|
|
||||||
async def on_member_ban(self, member):
|
async def on_member_ban(self, member):
|
||||||
if self.user.id == member.id:
|
if self.user.id == member.id:
|
||||||
|
Loading…
Reference in New Issue
Block a user