nroggendorff commited on
Commit
eb78e6c
1 Parent(s): 70a5666

attempt at removing some of that endless clutter

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -225,6 +225,10 @@ async def on_raw_message_delete(payload):
225
  except Exception as e:
226
  print(f"on_message_delete Error: {e}")
227
 
 
 
 
 
228
  # nickname stuff ---------------------------------------------------------------------------------------------------------------------------
229
  @bot.event
230
  async def on_member_update(before, after):
@@ -270,6 +274,8 @@ async def on_member_update(before, after):
270
  # removed
271
  removed_roles = before_roles - after_roles
272
  for role in removed_roles:
 
 
273
  async for entry in after.guild.audit_logs(action=discord.AuditLogAction.member_role_update, limit=5):
274
  if entry.target == after and role in entry.changes.before.roles:
275
  moderator = entry.user
 
225
  except Exception as e:
226
  print(f"on_message_delete Error: {e}")
227
 
228
+ class WARNING(ValueError):
229
+ def __init__(self, msg='1'):
230
+ super().__init__(msg)
231
+
232
  # nickname stuff ---------------------------------------------------------------------------------------------------------------------------
233
  @bot.event
234
  async def on_member_update(before, after):
 
274
  # removed
275
  removed_roles = before_roles - after_roles
276
  for role in removed_roles:
277
+ if str(role.name).startswith('lvl'):
278
+ raise WARNING('Deducible Update Detected, Skipping..')
279
  async for entry in after.guild.audit_logs(action=discord.AuditLogAction.member_role_update, limit=5):
280
  if entry.target == after and role in entry.changes.before.roles:
281
  moderator = entry.user