Adding Slash Commands to your Discord Bot | Nextcord (Full Tutorial)
HTML-код
- Опубликовано: 28 ноя 2024
- It's time to add Slash Command's to your Discord Bot!
In April 2022 Discord has said that ALL Discord Bot's will have to use Slash Commands in order for the user to interact with the Discord Bot.
In this video, I show you exactly how you can add Slash Commands to your Discord Bot as well as everything else to do with the topic. By the end of this video, you will have a fully functioning Discord Bot that uses Slash Commands.
►Links
Switching from Discord.py to Nextcord: • Moving away from Disco...
►Please consider joining my discord server
/ discord
►If you would like to support me and this channel please consider donating on Patreon / s_james
►Social Media
Instagram - / james.d.s_
Twitter - / james_d_s
Patreon - / s_james
Discord - / discord
► Business Inquiries ONLY
james.d.s.business@gmail.com
ngl, i felt upset that Discord is removing the the prefix commands, but this is helpful for helping me migrate from prefix to slash commands.
Make sure when inviting your bot that it is set to "applications.command"
any other specific permissions needed? thanks very much appreciated "applications.command" solved my issue.
Great video james! I've been strugling for days before your video! +1 subscriber!
Thank you so much, I’m really glad that I was able to help :)
Hey, I want to use slash commands in my bot but I cant find my slash commands also It's not working. I have reinvited the bot with application.command too,k stiil not working. What is the problem here?
Can you please make a new playlist because many of the things are updated!
how can we make this work without knowing the serverid ? if we are not testing the bot and it is available to all servers, what do we do ?
Great and very useful video, will you make a video about buttons?
Thank you, glad you like it. Yes definitely, video on that will be coming out shortly
Love u James ure amazing ❤❤❤❤❤❤❤❤
will you make a video of slash commands in cogs?
Yes definitely, video coming out very soon
Thank you so much James
No problem at all, glad I was able to help :)
James, is it possible to make moderation commands as a slash command?
how do we make the slash commands global? i've let the bot up overnight without any guild_ids?
How do you set up slash commands to play the audio clips that you've shown in past videoes? Like the piano clip
Bro in next episode pls make all slash commands of ban kick all
I'll add that to my list of to do videos, thank you :)
How to do optional arguments with slash commands? It seems like they are always required.
to make the argument optional, the parameter arg should be arg=None
im not downloading anything
Hey, any idea if one is able to send embeds with the interaction response? It doesn't seem to work for me, and i'm getting a weird traceback error. When i use the same code in in a normal bot event and use ctx.send(embed = embed) there is no error.
You need to use: await interaction.response.send_message(embed=embed)
I'm having a an error when running my commands document. I don't know how to solve it
raise HTTPException(response, data)
nextcord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In description: This field is required
pls help
same lol
I used to have that error in javascript make sure you arent using javascript and using python
@@Mythical_Spectra how could someone mistake the coding language they are writing in like I am a stupid coder but i never had that issue no offence
Are you fully aware this is full tutorial?
next episode when?
This week :)
Could you share your code? my bot doesn't work 😥😥
Hi, I'm really sorry that your bot doesn't work. I'm happy to help you fix it. I don't share code as I personally don't believe thats the best way to learn. Feel free to join my discord server and we'd be happy to help you get your bot working :)
How can I do it in Cogs?
I’ve released another tutorial explaining how to do this :)
@@James_S Ok Thanks😊
I'd imagine your sub count would be higher if you did away with the weird vocal fry.
dude nice videos but this isnt youtube kids (i think), stop it with the attention retention voice and cringy over emphasis.
It is made for All ages
when i run the / command i get the
"The application did not respond"
message on discord, and the
"Ignoring exception in command :
Traceback (most recent call last):
File "C:\Users\*myusername*\AppData\Roaming\Python\Python311\site-packages
extcord\application_command.py", line 890, in invoke_callback_with_hooks
await self(interaction, *args, **kwargs)
File "C:\Users\thisi\OneDrive\Pictures\stuff (tm)\python\BobBot\main.py", line 36, in test
await interaction.responce.send_message("Hello!!!")
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Interaction' object has no attribute 'responce'
The above exception was the direct cause of the following exception:
nextcord.errors.ApplicationInvokeError: Command raised an exception: AttributeError: 'Interaction' object has no attribute 'responce'"
message in the terminal?
my code reads as
"@client.slash_command(name = "testcommand", description = "this is a test command", guild_ids=[*server id numbers, because when i had it as testServerId i kept getting errors*])
async def test(interaction: Interaction):
await interaction.responce.send_message("Hello!!!")"
ik im super late but I fixed it by writing the arguments in this specific order: guild_ids,description,name
example: @nextcord.slash_command(guild_ids=[testServerId],description="WOW",name="okk")
I hope it helped