Skip to content

Commit ddbee35

Browse files
committed
Persistent notes are now properly deleted,resolve #3013
1 parent 20b31f8 commit ddbee35

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ v3.10 adds group conversations while resolving othre bugs and QOL changes. It is
3131
- Invalid arguments are now properly catched and a proper error message is sent.
3232
- Update database after resetting/purging all plugins. ([GH #3011](https://github.com/kyb3r/modmail/pull/3011))
3333
- `thread_auto_close` timer now only resets on non-note and replies from mods. ([GH #3030](https://github.com/kyb3r/modmail/issues/3030))
34+
- Deleted messages are now deleted on both ends. ([GH #3041](https://github.com/kyb3r/modmail/issues/3041), [@JerrieAries](https://github.com/kyb3r/modmail/commit/20b31f8e8b5497943513997fef788d72ae668438))
35+
- Persistent notes are now properly deleted from the database. ([GH #3013](https://github.com/kyb3r/modmail/issues/3013))
3436

3537
## Internal
3638

Diff for: core/thread.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -679,13 +679,17 @@ async def delete_message(
679679
else:
680680
message1, *message2 = await self.find_linked_messages(message, note=note)
681681
tasks = []
682+
682683
if not isinstance(message, discord.Message):
683684
tasks += [message1.delete()]
684-
elif message2 is not [None]:
685-
for m2 in message2:
685+
686+
for m2 in message2:
687+
if m2 is not None:
686688
tasks += [m2.delete()]
687-
elif message1.embeds[0].author.name.startswith("Persistent Note"):
689+
690+
if message1.embeds[0].author.name.startswith("Persistent Note"):
688691
tasks += [self.bot.api.delete_note(message1.id)]
692+
689693
if tasks:
690694
await asyncio.gather(*tasks)
691695

0 commit comments

Comments
 (0)