Make localwhitelist check if caller will still be able to use bot after changes #3903

Merged
Drapersniper merged 6 commits from fixes-3222 into V3/develop 2020-07-07 20:08:07 +02:00
Drapersniper commented 2020-06-03 18:13:59 +02:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

fixes #3222

### Type - [ ] Bugfix - [x] Enhancement - [ ] New feature ### Description of the changes fixes #3222
tekulvw (Migrated from github.com) reviewed 2020-06-03 18:13:59 +02:00
Jackenmen commented 2020-06-04 13:18:54 +02:00 (Migrated from github.com)

Adding guild owner is actually unnecessary - the linked issue description is slightly outdated and we always return True for guild owner already:
github.com/Cog-Creators/Red-DiscordBot@2c313594da/redbot/core/bot.py (L383-L385)

(I just happened to look at issue tracker :P)

Adding guild owner is actually unnecessary - the linked issue description is slightly outdated and we always return `True` for guild owner already: https://github.com/Cog-Creators/Red-DiscordBot/blob/2c313594dacf298e47e3e5ec339f2af2c545b9b2/redbot/core/bot.py#L383-L385 *(I just happened to look at issue tracker :P)*
Drapersniper commented 2020-06-04 14:06:44 +02:00 (Migrated from github.com)

Adding guild owner is actually unnecessary - the linked issue description is slightly outdated and we always return True for guild owner already:
github.com/Cog-Creators/Red-DiscordBot@2c313594da/redbot/core/bot.py (L383-L385)

(I just happened to look at issue tracker :P)

yeah i saw this after i added but forgot to remove it, thanks for spotting it

> Adding guild owner is actually unnecessary - the linked issue description is slightly outdated and we always return `True` for guild owner already: > https://github.com/Cog-Creators/Red-DiscordBot/blob/2c313594dacf298e47e3e5ec339f2af2c545b9b2/redbot/core/bot.py#L383-L385 > > _(I just happened to look at issue tracker :P)_ yeah i saw this after i added but forgot to remove it, thanks for spotting it
Jackenmen (Migrated from github.com) requested changes 2020-06-19 00:10:40 +02:00
Jackenmen (Migrated from github.com) left a comment

Similar check is needed [p]localwhitelist remove as well - I can add myself, then someone else and later remove myself and then I will lose my access to the bot.

Also, I was thinking that the error message in [p]localwhitelist add could mention that to prevent access loss, you should add yourself to the whitelist first.

Similar check is needed `[p]localwhitelist remove` as well - I can add myself, then someone else and later remove myself and then I will lose my access to the bot. Also, I was thinking that the error message in `[p]localwhitelist add` could mention that to prevent access loss, you should add yourself to the whitelist first.
Jackenmen (Migrated from github.com) requested changes 2020-06-21 20:41:32 +02:00
Jackenmen (Migrated from github.com) left a comment

The comment I made in Discord that would be good to address in this PR:
These checks are not needed for guild owners and bot owners as they're not affected by the local whitelist and it may make it unnecessarily harder to add/remove some role on the whitelist.

The comment I made in Discord that would be good to address in this PR: These checks are not needed for guild owners and bot owners as they're not affected by the local whitelist and it may make it unnecessarily harder to add/remove some role on the whitelist.
Jackenmen (Migrated from github.com) requested changes 2020-07-07 01:23:30 +02:00
@ -1946,8 +1946,20 @@ class Core(commands.Cog, CoreLogic):
return
Jackenmen (Migrated from github.com) commented 2020-07-07 01:23:07 +02:00

You're concatenating list and set here which raises an error.

You're concatenating list and set here which raises an error.
Jackenmen (Migrated from github.com) approved these changes 2020-07-07 20:03:59 +02:00
Jackenmen (Migrated from github.com) left a comment

Looks good to me.

Looks good to me.
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!3903
No description provided.