Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
on raw message delete
Browse files
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
|
199 |
try:
|
200 |
-
|
|
|
|
|
|
|
|
|
201 |
if cached_message:
|
202 |
-
if
|
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())
|