diff options
| author | 2020-12-27 17:01:17 +0200 | |
|---|---|---|
| committer | 2020-12-27 17:01:17 +0200 | |
| commit | 203454f187c4937b755e869568ff7d21a9b5a718 (patch) | |
| tree | 3e1c9588b981a5af0a4f7a3ce00832d2e5890f27 | |
| parent | Merge pull request #1328 from python-discord/swfarnsworth/developer_command (diff) | |
Add check does user can see channel in raw command
| -rw-r--r-- | bot/exts/info/information.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index 2057876e4..c1db0c230 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -423,6 +423,10 @@ class Information(Cog): @in_whitelist(channels=(constants.Channels.bot_commands,), roles=constants.STAFF_ROLES) async def raw(self, ctx: Context, *, message: Message, json: bool = False) -> None: """Shows information about the raw API response.""" + if ctx.author not in message.channel.members: + await ctx.send(":x: You can't get message from channel that you don't see.") + return + # I *guess* it could be deleted right as the command is invoked but I felt like it wasn't worth handling # doing this extra request is also much easier than trying to convert everything back into a dictionary again raw_data = await ctx.bot.http.get_message(message.channel.id, message.id) |