lunarflu HF staff commited on
Commit
ee5d8f7
1 Parent(s): 3967fb1
Files changed (1) hide show
  1. app.py +27 -1
app.py CHANGED
@@ -121,6 +121,7 @@ async def on_message_delete(message):
121
  @bot.event
122
  async def on_member_update(before, after):
123
  try:
 
124
  if before.name != after.name:
125
  print(f"Username changed for {after.mention}: {before.name} -> {after.name}")
126
  """
@@ -138,7 +139,32 @@ async def on_member_update(before, after):
138
  async for entry in bot.guild.audit_logs(limit=5):
139
  print(f'{entry.user} did {entry.action} to {entry.target}')
140
  except Exception as e:
141
- print(f"Error: {e}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  @bot.event
144
  async def on_member_ban(guild, user):
 
121
  @bot.event
122
  async def on_member_update(before, after):
123
  try:
124
+ print("member update")
125
  if before.name != after.name:
126
  print(f"Username changed for {after.mention}: {before.name} -> {after.name}")
127
  """
 
139
  async for entry in bot.guild.audit_logs(limit=5):
140
  print(f'{entry.user} did {entry.action} to {entry.target}')
141
  except Exception as e:
142
+ print(f"Error: {e}")
143
+
144
+
145
+ @bot.event
146
+ async def on_user_update(before, after):
147
+ try:
148
+ print("user update")
149
+ if before.name != after.name:
150
+ print(f"Username changed for {after.mention}: {before.name} -> {after.name}")
151
+ """
152
+ embed = Embed(description=f"Username changed for {after.mention}: {before.name} -> {after.name}", color=Color.blue())
153
+ await bot.log_channel.send(embed=embed)
154
+ """
155
+
156
+ if before.global_name != after.global_name:
157
+ print(f"global_name changed for {after.mention}: {before.global_name} -> {after.global_name}")
158
+
159
+ if before.display_name != after.display_name:
160
+ print(f"display_name changed for {after.mention}: {before.display_name} -> {after.display_name}")
161
+
162
+
163
+ async for entry in bot.guild.audit_logs(limit=5):
164
+ print(f'{entry.user} did {entry.action} to {entry.target}')
165
+ except Exception as e:
166
+ print(f"Error: {e}")
167
+
168
 
169
  @bot.event
170
  async def on_member_ban(guild, user):