Skip to content

Commit d61cb2b

Browse files
committed
Fixed remove_all_commands
1 parent f80b1ad commit d61cb2b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

discord_slash/utils/manage_commands.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import typing
12
import asyncio
23
import aiohttp
34
from ..error import RequestFailure
@@ -95,18 +96,18 @@ async def get_all_commands(bot_id,
9596

9697
async def remove_all_commands(bot_id,
9798
bot_token,
98-
guild_ids):
99+
guild_ids: typing.List[int] = None):
99100
"""
100101
Remove all slash commands.
101102
102103
:param bot_id: User ID of the bot.
103104
:param bot_token: Token of the bot.
104-
:param guild_ids: List ID of the guild to remove commands.
105+
:param guild_ids: List of the guild ID to remove commands. Pass ``None`` to remove only the global commands.
105106
"""
106107

107108
await remove_all_commands_in(bot_id, bot_token, None)
108109

109-
for x in guild_ids:
110+
for x in guild_ids if guild_ids else []:
110111
try:
111112
await remove_all_commands_in(bot_id, bot_token, x)
112113
except RequestFailure:

0 commit comments

Comments
 (0)