Skip to content

Commit 5f38959

Browse files
committed
Delete note command
1 parent 4587171 commit 5f38959

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.
77
however, insignificant breaking changes does not guarantee a major version bump, see the reasoning [here](https://github.com/kyb3r/modmail/issues/319).
88

99

10-
# v3.3.0-dev2
10+
# v3.3.0-dev3
1111

1212

1313
### Important
@@ -31,6 +31,7 @@ however, insignificant breaking changes does not guarantee a major version bump,
3131
### Changed
3232

3333
- `?contact` no longer send the "thread created" message to where the command is ran, instead, it's now sent to the newly created thread channel. (Thanks to DAzVise)
34+
- Automatically delete notes command `?note` when there's no attachments attached.
3435
- Plugins update (mostly internal).
3536
- `git` is no longer used to install plugins, it now downloads through zip files.
3637
- `?plugins enabled` renamed to `?plugins loaded` while `enabled` is still an alias to that command.

core/thread.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -734,17 +734,19 @@ async def send(
734734
embed.set_footer(text=mod_tag) # Normal messages
735735
else:
736736
embed.set_footer(text=self.bot.config["anon_tag"])
737+
elif note:
738+
embed.colour = self.bot.main_color
739+
else:
740+
embed.set_footer(text=f"Message ID: {message.id}")
741+
embed.colour = self.bot.recipient_color
742+
743+
if from_mod or note:
737744
delete_message = not bool(message.attachments)
738745
if delete_message and destination == self.channel:
739746
try:
740747
await message.delete()
741748
except Exception as e:
742749
logger.warning('Cannot delete message: %s.', str(e))
743-
elif note:
744-
embed.colour = self.bot.main_color
745-
else:
746-
embed.set_footer(text=f"Message ID: {message.id}")
747-
embed.colour = self.bot.recipient_color
748750

749751
try:
750752
await destination.trigger_typing()

0 commit comments

Comments
 (0)