mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[Core] Prevent users from locking out themselves or guild owner with localblacklist (#3221)
* Update core_commands.py * Update core_commands.py * Create 3207.bugfix.rst * Update core_commands.py * Create 3221.bugfix.rst * Update redbot/core/core_commands.py Co-Authored-By: Michael H <michael@michaelhall.tech> * Update bot.py * Rename 3221.bugfix.rst to 3221.bugfix.1.rst * Create 3221.bugfix.2.rst * Update bot.py Co-authored-by: Michael H <michael@michaelhall.tech>
This commit is contained in:
@@ -223,6 +223,11 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin): # pylint: d
|
||||
------
|
||||
TypeError
|
||||
Did not provide ``who`` or ``who_id``
|
||||
|
||||
Returns
|
||||
-------
|
||||
bool
|
||||
`True` if user is allowed to run things, `False` otherwise
|
||||
"""
|
||||
# Contributor Note:
|
||||
# All config calls are delayed until needed in this section
|
||||
@@ -254,6 +259,9 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin): # pylint: d
|
||||
return False
|
||||
|
||||
if guild:
|
||||
if guild.owner_id == who.id:
|
||||
return True
|
||||
|
||||
# The delayed expansion of ids to check saves time in the DM case.
|
||||
# Converting to a set reduces the total lookup time in section
|
||||
if mocked:
|
||||
|
||||
Reference in New Issue
Block a user