Skip to content

Commit c59724c

Browse files
committed
Fixed a bug where blocked users are still able to message modmail
1 parent 39b5a5a commit c59724c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
# v2.0.10
8+
9+
### Security
10+
- Fix a bug where blocked users were still able to message modmail.
711

812
# v2.0.9
913

bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ async def process_modmail(self, message):
207207
except:
208208
pass
209209

210-
reaction = blocked_emoji if message.author.id in self.blocked_users else sent_emoji
210+
reaction = blocked_emoji if str(message.author.id) in self.blocked_users else sent_emoji
211211

212212
try:
213213
await message.add_reaction(reaction)
@@ -220,7 +220,7 @@ async def process_modmail(self, message):
220220
description='You have been blocked from using modmail.'
221221
)
222222

223-
if message.author.id in self.blocked_users:
223+
if str(message.author.id) in self.blocked_users:
224224
await message.author.send(embed=blocked_em)
225225
else:
226226
thread = await self.threads.find_or_create(message.author)

cogs/modmail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ async def block(self, ctx, user: Union[discord.Member, discord.User, obj]=None,
342342
await self.bot.config.update()
343343

344344
em.title = 'Success'
345-
em.description = f'{mention} is now blocked ' + f'for `{reason}`' if reason else ''
345+
em.description = f'{mention} is now blocked ' + (f'for `{reason}`' if reason else '')
346346

347347
await ctx.send(embed=em)
348348
else:

0 commit comments

Comments
 (0)