[V3] Ban peers with hackban #2127

Closed
opened 2018-09-13 23:53:31 +02:00 by Liante-0216 · 2 comments
Liante-0216 commented 2018-09-13 23:53:31 +02:00 (Migrated from github.com)

Command bugs

Command name

[p]hackban

What cog is this command from?

Mod

What were you expecting to happen?

When called by a mod on another mod, display error message: "I cannot let you do that. You are not higher than the user in the role hierarchy." and do nothing.

What actually happened?

Mod got banned, message displayed: "Done. The user will not be able to join this server."

How can we reproduce this issue?

  1. Set a role with ban permissions and access to the Mod cog and hackban command.
  2. Give the role to two members, it should be the highest role for both of them.
  3. Have one of them execute [p]hackban <other's id>
# Command bugs <!-- Did you find a bug with a command? Fill out the following: --> #### Command name [p]hackban #### What cog is this command from? Mod #### What were you expecting to happen? When called by a mod on another mod, display error message: "I cannot let you do that. You are not higher than the user in the role hierarchy." and do nothing. #### What actually happened? Mod got banned, message displayed: "Done. The user will not be able to join this server." #### How can we reproduce this issue? 1) Set a role with ban permissions and access to the Mod cog and hackban command. 2) Give the role to two members, it should be the highest role for both of them. 3) Have one of them execute [p]hackban <other's id>
Kowlin commented 2018-09-14 03:20:59 +02:00 (Migrated from github.com)

Can confirm that this is a bug. Also as an additional bug, ban does not check if you can actually ban the user and it will error out if the bot doesn't have the permissions to ban.

Traceback

Exception in command 'hackban' Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/discord/ext/commands/core.py", line 61, in wrapped ret = await coro(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/redbot/cogs/mod/mod.py", line 441, in hackban ban_list = await guild.bans() File "/usr/local/lib/python3.6/dist-packages/discord/guild.py", line 857, in bans data = await self._state.http.get_bans(self.id) File "/usr/local/lib/python3.6/dist-packages/discord/http.py", line 209, in request raise Forbidden(r, data) discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/discord/ext/commands/bot.py", line 898, in invoke
await ctx.command.invoke(ctx)
File "/usr/local/lib/python3.6/dist-packages/discord/ext/commands/core.py", line 550, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/usr/local/lib/python3.6/dist-packages/discord/ext/commands/core.py", line 70, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: FORBIDDEN (status code: 403): Missing Permissions

Can confirm that this is a bug. Also as an additional bug, ban does not check if you can actually ban the user and it will error out if the bot doesn't have the permissions to ban. <details><summary>Traceback</summary><p> Exception in command 'hackban' Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/discord/ext/commands/core.py", line 61, in wrapped ret = await coro(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/redbot/cogs/mod/mod.py", line 441, in hackban ban_list = await guild.bans() File "/usr/local/lib/python3.6/dist-packages/discord/guild.py", line 857, in bans data = await self._state.http.get_bans(self.id) File "/usr/local/lib/python3.6/dist-packages/discord/http.py", line 209, in request raise Forbidden(r, data) discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/discord/ext/commands/bot.py", line 898, in invoke await ctx.command.invoke(ctx) File "/usr/local/lib/python3.6/dist-packages/discord/ext/commands/core.py", line 550, in invoke await injected(*ctx.args, **ctx.kwargs) File "/usr/local/lib/python3.6/dist-packages/discord/ext/commands/core.py", line 70, in wrapped raise CommandInvokeError(e) from e discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: FORBIDDEN (status code: 403): Missing Permissions </p></details>
Tobotimus commented 2018-09-24 10:21:36 +02:00 (Migrated from github.com)

Thanks for this report. Resolved by #2128.

Thanks for this report. Resolved by #2128.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#2127
No description provided.