From 7b1fab6de714d63aae90ce54686697d8b539a48e Mon Sep 17 00:00:00 2001 From: AstreaTSS <25420078+AstreaTSS@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:31:41 -0500 Subject: [PATCH 1/2] feat: add Client.mention_command This makes it much easier to mention a command if you don't know how to use bot internals. --- interactions/client/client.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/interactions/client/client.py b/interactions/client/client.py index 9ce1d7d30..190231775 100644 --- a/interactions/client/client.py +++ b/interactions/client/client.py @@ -2461,6 +2461,19 @@ def get_bot_voice_state(self, guild_id: "Snowflake_Type") -> Optional[ActiveVoic """ return self._connection_state.get_voice_state(guild_id) + def mention_command(self, name: str, scope: int = 0) -> str: + """ + Returns a string that would mention the interaction specified. + + Args: + name (str): The name of the interaction. + scope (int, optional): The scope of the interaction. Defaults to 0, the global scope. + + Returns: + str: The interaction's mention in the specified scope. + """ + return self.interactions_by_scope[scope][name].mention(scope) + async def change_presence( self, status: Optional[Union[str, Status]] = Status.ONLINE, From 44210486bdc26ee6384a3777971992bd5687295e Mon Sep 17 00:00:00 2001 From: AstreaTSS <25420078+AstreaTSS@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:34:53 -0500 Subject: [PATCH 2/2] docs: remove pointless typehint notes --- interactions/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interactions/client/client.py b/interactions/client/client.py index 190231775..96cdef32b 100644 --- a/interactions/client/client.py +++ b/interactions/client/client.py @@ -2466,8 +2466,8 @@ def mention_command(self, name: str, scope: int = 0) -> str: Returns a string that would mention the interaction specified. Args: - name (str): The name of the interaction. - scope (int, optional): The scope of the interaction. Defaults to 0, the global scope. + name: The name of the interaction. + scope: The scope of the interaction. Defaults to 0, the global scope. Returns: str: The interaction's mention in the specified scope.