File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ the many subclasses offered in *discord-py-slash-command*.
5858 from discord_slash.utils import manage_commands # Allows us to manage the command settings.
5959
6060 client = discord.Client(intents = discord.Intents.all())
61- slash = SlashCommand(client, auto_register = True )
61+ slash = SlashCommand(client, sync_commands = True )
6262
6363 guild_ids = [789032594456576001 ]
6464
@@ -78,13 +78,14 @@ the many subclasses offered in *discord-py-slash-command*.
7878 guild_ids = guild_ids
7979 )
8080 async def _test (ctx , argone : str ):
81- await ctx.send(content = f " You responded with { argone} . " )
81+ await ctx.respond()
82+ await ctx.send(f " You responded with { argone} . " )
8283
8384 client.run(" your_bot_token_here" )
8485
8586 The main changes that you need to know about are with the lines calling the import
8687of ``manage_commands ``, as well as the ``options = [] ... `` code within the ``@slash.slash() ``
87- context coroutine. This will now create a new option called "argOne " when shown for
88+ context coroutine. This will now create a new option called "argone " when shown for
8889the slash command.
8990
9091.. _quickstart : https://discord-py-slash-command.readthedocs.io/en/latest/quickstart.html
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ For this example, ``main.py`` will be used.
2828 from discord_slash import SlashCommand # Importing the newly installed library.
2929
3030 client = discord.Client(intents = discord.Intents.all())
31- slash = SlashCommand(client, auto_register = True ) # Declares slash commands through the client.
31+ slash = SlashCommand(client, sync_commands = True ) # Declares slash commands through the client.
3232
3333 @client.event
3434 async def on_ready ():
@@ -47,7 +47,7 @@ We can do so by adding this code shown here:
4747 from discord_slash import SlashCommand # Importing the newly installed library.
4848
4949 client = discord.Client(intents = discord.Intents.all())
50- slash = SlashCommand(client, auto_register = True ) # Declares slash commands through the client.
50+ slash = SlashCommand(client, sync_commands = True ) # Declares slash commands through the client.
5151
5252 guild_ids = [789032594456576001 ] # Put your server ID in this array.
5353
@@ -57,7 +57,8 @@ We can do so by adding this code shown here:
5757
5858 @slash.slash (name = " ping" , guild_ids = guild_ids)
5959 async def _ping (ctx ): # Defines a new "context" (ctx) command called "ping."
60- await ctx.send(content = f " Pong! ( { client.latency* 1000 } ms) " )
60+ await ctx.respond()
61+ await ctx.send(f " Pong! ( { client.latency* 1000 } ms) " )
6162
6263 client.run(" your_bot_token_here" )
6364
You can’t perform that action at this time.
0 commit comments