Skip to content

Commit b50c3ad

Browse files
committed
Add support for custom sent emoji and blocked emoji resolves #112
1 parent 786d672 commit b50c3ad

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
# v2.0.9
99

10+
### Added
11+
- Support for custom blocked emoji and sent emoji
12+
- Use the `config set blocked_emoji` or `sent_emoji` commands.
13+
1014
### Quick Fix
1115
- Support multiple image and file attachments in one message
1216
- This is only possible on mobile so its good to handle it in code.

bot.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,13 @@ async def on_ready(self):
182182
else:
183183
await self.threads.populate_cache()
184184

185-
186185
async def process_modmail(self, message):
187186
"""Processes messages sent to the bot."""
188187

189-
reaction = '🚫' if message.author.id in self.blocked_users else '✅'
188+
blocked_emoji = self.config.get('blocked_emoji', '🚫')
189+
sent_emoji = self.config.get('sent_emoji', '✅')
190+
191+
reaction = blocked_emoji if message.author.id in self.blocked_users else sent_emoji
190192

191193
try:
192194
await message.add_reaction(reaction)

core/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ConfigManager:
88

99
allowed_to_change_in_command = {
1010
'status', 'log_channel_id', 'mention', 'disable_autoupdates', 'prefix',
11-
'main_category_id'
11+
'main_category_id', 'sent_emoji', 'blocked_emoji'
1212
}
1313

1414
internal_keys = {

0 commit comments

Comments
 (0)