Skip to content

Commit f049570

Browse files
authored
feat: add Client.mention_command (#1579)
* feat: add Client.mention_command This makes it much easier to mention a command if you don't know how to use bot internals. * docs: remove pointless typehint notes
1 parent 69b9feb commit f049570

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

interactions/client/client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,6 +2461,19 @@ def get_bot_voice_state(self, guild_id: "Snowflake_Type") -> Optional[ActiveVoic
24612461
"""
24622462
return self._connection_state.get_voice_state(guild_id)
24632463

2464+
def mention_command(self, name: str, scope: int = 0) -> str:
2465+
"""
2466+
Returns a string that would mention the interaction specified.
2467+
2468+
Args:
2469+
name: The name of the interaction.
2470+
scope: The scope of the interaction. Defaults to 0, the global scope.
2471+
2472+
Returns:
2473+
str: The interaction's mention in the specified scope.
2474+
"""
2475+
return self.interactions_by_scope[scope][name].mention(scope)
2476+
24642477
async def change_presence(
24652478
self,
24662479
status: Optional[Union[str, Status]] = Status.ONLINE,

0 commit comments

Comments
 (0)