Skip to content

Commit

Permalink
Merge pull request Pycord-Development#815 from plun1331/patch-7
Browse files Browse the repository at this point in the history
Make channel_id default to the current channel
  • Loading branch information
krittick authored Jan 19, 2022
2 parents 9feb8c1 + 3acb5a6 commit ae6270b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion discord/ext/commands/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,11 @@ def _get_id_matches(ctx, argument):
if not match:
raise MessageNotFound(argument)
data = match.groupdict()
channel_id = discord.utils._get_as_snowflake(data, 'channel_id')
channel_id = data.get('channel_id')
if channel_id is None:
channel_id = ctx.channel and ctx.channel.id
else:
channel_id = int(channel_id)
message_id = int(data['message_id'])
guild_id = data.get('guild_id')
if guild_id is None:
Expand Down

0 comments on commit ae6270b

Please sign in to comment.