Skip to content

Commit

Permalink
Add support for custom sent emoji and blocked emoji resolves #112
Browse files Browse the repository at this point in the history
  • Loading branch information
kyb3r committed Jan 9, 2019
1 parent 786d672 commit b50c3ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

# v2.0.9

### Added
- Support for custom blocked emoji and sent emoji
- Use the `config set blocked_emoji` or `sent_emoji` commands.

### Quick Fix
- Support multiple image and file attachments in one message
- This is only possible on mobile so its good to handle it in code.
Expand Down
6 changes: 4 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,13 @@ async def on_ready(self):
else:
await self.threads.populate_cache()


async def process_modmail(self, message):
"""Processes messages sent to the bot."""

reaction = '🚫' if message.author.id in self.blocked_users else '✅'
blocked_emoji = self.config.get('blocked_emoji', '🚫')
sent_emoji = self.config.get('sent_emoji', '✅')

reaction = blocked_emoji if message.author.id in self.blocked_users else sent_emoji

try:
await message.add_reaction(reaction)
Expand Down
2 changes: 1 addition & 1 deletion core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ConfigManager:

allowed_to_change_in_command = {
'status', 'log_channel_id', 'mention', 'disable_autoupdates', 'prefix',
'main_category_id'
'main_category_id', 'sent_emoji', 'blocked_emoji'
}

internal_keys = {
Expand Down

0 comments on commit b50c3ad

Please sign in to comment.