File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,6 @@ def add_application_command(self, command: ApplicationCommand) -> None:
106
106
command: :class:`.ApplicationCommand`
107
107
The command to add.
108
108
"""
109
-
110
109
if self .debug_guilds and command .guild_ids is None :
111
110
command .guild_ids = self .debug_guilds
112
111
self ._pending_application_commands .append (command )
@@ -132,6 +131,27 @@ def remove_application_command(
132
131
"""
133
132
return self .application_commands .pop (command .id )
134
133
134
+ def get_command (self , id : str , / ) -> Optional [ApplicationCommand ]:
135
+ """Get a :class:`.ApplicationCommand` from the internal list
136
+ of commands.
137
+
138
+ .. versionadded:: 2.0
139
+
140
+ Parameters
141
+ -----------
142
+ id: :class:`str`
143
+ The id of the command to get.
144
+
145
+ Returns
146
+ --------
147
+ Optional[:class:`ApplicationCommand`]
148
+ The command that was requested. If not found, returns ``None``.
149
+ """
150
+
151
+ return self .application_commands .get (id )
152
+
153
+ get_application_command = get_command
154
+
135
155
async def sync_commands (self ) -> None :
136
156
"""|coro|
137
157
You can’t perform that action at this time.
0 commit comments