mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
update for d.py 1.3 (#3445)
* update for d.py 1.3 * Update redbot/core/commands/commands.py Co-Authored-By: Danny <Rapptz@users.noreply.github.com> * a few more places we use owner info * add the cli flag + handling * set fix * Handle MaxConcurrencyReached. * Bump `aiohttp-json-rpc` Co-authored-by: Danny <Rapptz@users.noreply.github.com> Co-authored-by: Kowlin <Kowlin@users.noreply.github.com> Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -757,16 +757,10 @@ class _RulesDict(Dict[Union[int, str], PermState]):
|
||||
|
||||
|
||||
def _validate_perms_dict(perms: Dict[str, bool]) -> None:
|
||||
invalid_keys = set(perms.keys()) - set(discord.Permissions.VALID_FLAGS)
|
||||
if invalid_keys:
|
||||
raise TypeError(f"Invalid perm name(s): {', '.join(invalid_keys)}")
|
||||
for perm, value in perms.items():
|
||||
try:
|
||||
attr = getattr(discord.Permissions, perm)
|
||||
except AttributeError:
|
||||
attr = None
|
||||
|
||||
if attr is None or not isinstance(attr, property):
|
||||
# We reject invalid permissions
|
||||
raise TypeError(f"Unknown permission name '{perm}'")
|
||||
|
||||
if value is not True:
|
||||
# We reject any permission not specified as 'True', since this is the only value which
|
||||
# makes practical sense.
|
||||
|
||||
Reference in New Issue
Block a user