-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message and slash checks for components #154
base: master
Are you sure you want to change the base?
Message and slash checks for components #154
Conversation
@@ -576,7 +628,11 @@ def unbind_client(self, client: abc.Client, /) -> None: | |||
self._client = None | |||
|
|||
async def _check_context(self, ctx: abc.Context, /) -> bool: | |||
return await utilities.gather_checks(ctx, self._checks) | |||
if abc.SlashContext in type(ctx).mro(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than instance check here, we could just specifically call utilitiys.gather_checks(ctx, self._slash_checks/self._message_checks)
around line 645 and 656
@@ -228,6 +242,10 @@ def name(self) -> str: | |||
def slash_commands(self) -> collections.Collection[abc.BaseSlashCommand]: | |||
return self._slash_commands.copy().values() | |||
|
|||
@property | |||
def slash_checks(self) -> collections.Collection[abc.CheckSig]: | |||
return tuple(check.callback for check in self._slash_checks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get a quick 1 line docstring here explaining it
@@ -236,13 +254,17 @@ def slash_hooks(self) -> typing.Optional[abc.SlashHooks]: | |||
def message_commands(self) -> collections.Collection[abc.MessageCommand]: | |||
return self._message_commands.copy() | |||
|
|||
@property | |||
def message_checks(self) -> collections.Collection[abc.CheckSig]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get a quick 1 line docstring here explaining it
Looks like you'll also need to rebase now ;3 |
Grand Dad |
Grand Dad Part 2 |
Summary
Implements message and slash checks on components
Checklist
nox
and all the pipelines have passed.Related issues
One of the todo cards iunno