File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -252,18 +252,19 @@ async def on_message_delete(self, message):
252
252
async for msg in channel .history ():
253
253
if msg .embeds and msg .embeds [0 ].author :
254
254
url = msg .embeds [0 ].author .url
255
- if message_id == re .findall (r'\d+' , url ):
255
+ if message_id == re .findall (r'\d+' , url )[ 0 ] :
256
256
return await msg .delete ()
257
257
258
258
async def on_message_edit (self , before , after ):
259
259
if before .author .bot :
260
260
return
261
261
if isinstance (before .channel , discord .DMChannel ):
262
- channel = await self .find_or_create_thread ( before .author )
263
- async for msg in channel .history ():
262
+ thread = await self .threads . find ( recipient = before .author )
263
+ async for msg in thread . channel .history ():
264
264
if msg .embeds :
265
265
embed = msg .embeds [0 ]
266
- if f'User - { before .id } ' in embed .footer .text :
266
+ matches = re .findall (r'\d+' , str (embed .author .url ))
267
+ if matches and int (matches [0 ]) == before .id :
267
268
if ' - (Edited)' not in embed .footer .text :
268
269
embed .set_footer (text = embed .footer .text + ' - (Edited)' )
269
270
embed .description = after .content
You can’t perform that action at this time.
0 commit comments