aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-03-24 21:00:01 +0000
committerGravatar Chris Lovering <[email protected]>2024-03-24 21:00:01 +0000
commit301d15c4327d103c6c36eab84d1234156711fadd (patch)
treec48b236219a172db80d2954b2344ef6881675f5c
parentEnsure project root is on sys path before importing the docs module (diff)
Lint repo with new ruff rules
-rw-r--r--pydis_core/utils/interactions.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pydis_core/utils/interactions.py b/pydis_core/utils/interactions.py
index 41b98dc5..27456f4d 100644
--- a/pydis_core/utils/interactions.py
+++ b/pydis_core/utils/interactions.py
@@ -23,9 +23,10 @@ def user_has_access(
allowed_users: A sequence of user ids that are allowed access
allowed_roles: A sequence of role ids that are allowed access
"""
- if user.id in allowed_users or any(role.id in allowed_roles for role in getattr(user, "roles", [])):
- return True
- return False
+ return bool(
+ user.id in allowed_users or
+ any(role.id in allowed_roles for role in getattr(user, "roles", []))
+ )
async def _handle_modify_message(message: Message, action: Literal["edit", "delete"]) -> None: