Creating a Discord Bot in Python (2025) | Episode 3: Slash Commands
ฝัง
- เผยแพร่เมื่อ 5 ก.พ. 2025
- Looking to add Slash Commands to your Discord Bot? In Episode 3 of our 2025 series, "Creating a Discord Bot in Python," we walk you through everything to do with Slash Commands. By the end of this episode, you'll fully understand what slash commands are and how you can program them in Python for your Discord Bot. This tutorial is perfect for beginners who want to dive into Discord bot development using Python in 2025.
🚀 In this episode, you will learn:
1. What Slash Commands are
2. How to program Slash Commands
3. How to get your Slash Commands to accept input from a user
►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_
Patreon - / s_james
Discord - / discord
► Business Inquiries ONLY
james.d.s.business@gmail.com
Amazing series, this has really helped me out. I tried programming a discord bot in python a few years ago but never figured out slash commands. I instead used a prefix of '.' instead to determine behaviours similar to a command. But this is so much better! It allows me to pass parameters so easy and track my commands easy too. Thank you James! Keep it up with the discord bot stuff!
praying part 4 comes out soon! These are great and very well made please keep going
dude just learn on your own from here
I have been making a bot for a friend and your clear and up-to-date information (as well as your infectious enthusiasm) have given me the tools to run off on my own :D. thank you very much
bro can u help me
@@4B_short lmaoooo
@ wsp
AHHHHHH!!!!! I'm a bot maker transitioning to slash commands and I could not figure out why it just wasn't working - your tip about specifying the guild worked perfectly and fixed my issue so I could get on with my life. THANK YOU!
Amazing tutorial, easy to follow and is very clear for someone who knows absolutely nothing at coding. Awaiting for part 4, keep it up!
Thank you very much I really enjoy your tutorials! We need more frequent videosssss ❤
Nicely demonstrated! Don't forget to reset the token
love this series. very well done.
EPIC MAKE PART 4!!
Pretty slick, love the tutorial
you earned a sub after this series. please keep it up!
can we not do the thing where you intentionally make a mistake and then go back afterwards to point it out and fix it, intentionally??? i just spent 20 minutes trying to troubleshoot my slash command NOT showing up only to give up and hear you say you did it on purpose......
OMG I was losing my mind rewriting my code three times in a row till I saw your comment.
how would you write the slash commands in a cog file and then sync them ??
Nice!
MAKE MORE PLEASE!
thx bro
Thanks man this is helping so much. I tried reading the API Refrence but it's not entirely clear. I'm curious about timed events and sending links.
i should clarify, sending a message and link to a site at a specific time every week/day/month like for a news channel.
hey, how could i make my bot always be online and answer?
i have a problem it dont say anything about syncing
Client can't run .tree?
Everything is exactly the same when i type the python3 main.py command nothing happens at all no erros nothing i got no idea what the hell is goin on
So what jf you have your bot and you want to separate commands in folders how will you implement slash cmds
next episode when
Should be coming out in the next few days
@@James_S a few days huh...
@@James_Swhen
could you include the source code as well, pls
when i put the try and except in 15:27 it says on the async below and the except it says Expected indented block Pylance
I can't make slash command😢 I followed every step and do it again and still didn't work
When I type / in discord chat box nothing from my bot appear 😢
Help
same have u fixed urs yet?
@bennydog2021 yes I coppied my code sent to Chat GPT and asked it to fix my code and it works.. some how
@@lilithgjahro-trpgandstoryt5123 ah alright
how to link channel with bot?
I'm getting the "Error syncing commands: 403 Forbidden (error code: 50001): Missing Access". I've tried the things suggested in Stack Overflow but I'm still not getting the slash command to activate.
same here
@@fong8375 Its been a little while so I forget the exact fix, but it was something with the permissions of the bot in the dashboard. I am not doing slash, im doing emoji reactions for my bot but I think I redid the permissions in the portal and it worked.
bot doesn't have permissions
Music bot pls !
what was the vscode theme he was using?
hes not using vscode hes using pycharm
@@dawn5423 Use your eyes pal.
Bro is in 2025 since October 🤣
Bro what the heck is that syntax on line 29? since when can you use a colon inside function arguments? I'm so confused. I know in some other languages you can use that to inherit a class but never have i seen that in python. And I'm having a hard time finding any documentation of that online. I know "@" is used to overload a method on line 28 but somebody help me out here.
Update: I understand it now. I had to ask Bing AI because I didn't know what to call that syntax. But apparently its called "Type Hints". In other languages you must declare the type of variable before setting it. in python we never had to do that. But after python 3.5 they added this for better code readability and error debugging. so basically you are just letting the interpreter and who ever is reading your code know, that "this variable: should be this type". if not then the discord module should have its on error detection to tell what problem occurred.
it justs run the hello feature
Thank you sooo much for the tutorial. !! You're the best ❤
did you purposely show your secret?
tragic 1 month ago
I don't wanna be mean, but horrible tutorial. This tutorial could have been finished in 5 minutes and u literally waste 20 minute of peoples time for no reason. Just go straight to the point and making people rewrite the code 3 times is very annoying as well.
Can anyone help me with my code? - in comment below
It doesn’t show any error in consol but the role isn’t given the commands work perfectly
@@Fasky005 logic error