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):
252252 async for msg in channel .history ():
253253 if msg .embeds and msg .embeds [0 ].author :
254254 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 ] :
256256 return await msg .delete ()
257257
258258 async def on_message_edit (self , before , after ):
259259 if before .author .bot :
260260 return
261261 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 ():
264264 if msg .embeds :
265265 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 :
267268 if ' - (Edited)' not in embed .footer .text :
268269 embed .set_footer (text = embed .footer .text + ' - (Edited)' )
269270 embed .description = after .content
You can’t perform that action at this time.
0 commit comments