lunarflu HF staff commited on
Commit
73f4ac6
1 Parent(s): 2aa3643

on raw message delete

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -195,11 +195,15 @@ async def on_message_edit(before, after):
195
  print(f"on_message_edit Error: {e}")
196
 
197
  @bot.event
198
- async def on_message_delete(message):
199
  try:
200
- cached_message = message_cache.pop(message.id, None)
 
 
 
 
201
  if cached_message:
202
- if message.author == bot.user:
203
  return
204
 
205
  embed = Embed(color=Color.red())
 
195
  print(f"on_message_edit Error: {e}")
196
 
197
  @bot.event
198
+ async def on_raw_message_delete(message):
199
  try:
200
+ message_id = payload.message_id
201
+ channel_id = payload.channel_id
202
+
203
+ cached_message = message_cache.pop(message_id, None)
204
+
205
  if cached_message:
206
+ if cached_message.author == bot.user:
207
  return
208
 
209
  embed = Embed(color=Color.red())