first tutorial that actually worked in the end. i tried dozens of tutorials because i want the badge but didnt want to go the sketchy route and wanted to try to learn something while doing it. worked like a charm, and i ended up refreshing my memory of programming things as well , thanks! was fun!
it works :D for the second time, first time it worked and then I forgot about this channel I did subscribe but I forgot the channel name, now I will remember it.
Great tutorial! I have been struggling to understand the documentation so this really helped a lot. Just one question if you know, how do you make a parameter optional? Is there a flag for it or do you have to manually code the logic?
Thank you so much bro this is an amazing tutorial! I've been trying to find videos that could help me and I finally found the one! You are such a talented programmer! Your tutorial was amazing and now my bot works now! Keep up the great work! Again, Thank you so much again!!!
I printed the results of bot.tree.sync() and saw that both the commands I coded are, in fact, in the command tree, but when I type / in my test server, the slash commands I made don't appear. Any idea what might have gone wrong?
I should have thought to update this. If anyone has the same problem I had, all you need to do is restart Discord. For whatever reason, new slash commands don't appear until you restart the application.
how can I add a description to the command, like the ones below the command name when you go to slash commands. Also the ephemeral thing is what makes it only appear to the person who ran the command right EDIT: NVM I found it, and to anyone wondering the same thing, it's quite simple. you just change @bot.tree.command(name="[your command]") to @bot.tree.command(name="[your command]", description ="[whatever description you want]")
@@glowstik as soon as I wrote this I made it work on PyCharm... however I'm using a hosting platfom where my files are stored in there, but it doesn t work because now I see that my discord.py is v1.7.3... so that was the problem.. I want to change it but I don t know how..
You have to give the roles on your Server Permissions. Go into your Settings of the Server and klick onto integrations and then onto your bot. There you will see your commands. You can add some roles there
it's either something wrong with the discord.ext library, or how you used "commands.Bot" (see line 6 from the video) I couldn't replicate the problem, so if you send more info that'd help
Hey bro, thanks for this tutorial, but I need to enable the command only for one of my servers. How can I do it? How do I call a snowflake? Here's the string from the docs: guild (Optional[Snowflake]) - The guild to add the command to. If not given or None then it becomes a global command instead. I can't understand how to call a snowflake.
@@glowstik tysm I didn't know dpy supported slash commands till somebody told me on discord. Glad I know how to add slash commands instead doing the old way
I had forgotten how to use arguments within my slash commands and couldn't find anybody explaining in a simple way. I really appriciate how this was explained and how simplified the code is compared to other people's tutorials. Very good job!
Thank you for this tutorial! Do you know which intents this bot requires? I can't get the bot to work and I don't want to set all intents as that's very dangerous
how does the ide tells you error as you're typing? like when you typed try: it said it must have an exception. is it a vscode extension or are you even using vscode?🤣
it gives me this error:Client does not have an application_id set. Either the function was called before on_ready was called or application_id was not passed to the Client constructor
do you have also a video to remove a command again? i made a lot of bullshit yesterday in my code and want to remove some commands but i know that i have to do more then just delete them from the code
@@glowstik For some reason, my commands stay even when rebooting the bot without the command code, and there’s no option to delete it in the integrations settings.
How can I solve the error ValueError: 'activation comfirm' must be between 1-32 characters and contain only lower-case letters, numbers, hyphens, or underscores.
I need help with smth. I wanna make a command that is a reminder, so it has to be responded to twice (1 time to confirm the reminder and the other one to actually remind the person.) but when it gets to the 2nd response it gives me the error: "InteractionResponded: This interaction has already been responded to before". Is there any way to fix this?
you can use hybrid commands which would make the command both a slash and prefix command discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.HybridCommand
Yep! Discord has a built in decorator for this, here are the docs with an example to get you started discordpy.readthedocs.io/en/stable/interactions/api.html#discord.app_commands.checks.has_permissions
first tutorial that actually worked in the end.
i tried dozens of tutorials because i want the badge but didnt want to go the sketchy route and wanted to try to learn something while doing it.
worked like a charm, and i ended up refreshing my memory of programming things as well , thanks! was fun!
Don't you ever call 'hello, world' a cliche. I will use that as a placeholder until the day I die!
I get the print message that my commands are syncing, however nothing shows up on my server
I loved this tutorial... However "Hello World" shall never die lmaooo
Thanks Man now i can apply for the Developer Badge and create as many commands as i want for free. Keep it up
it works :D for the second time, first time it worked and then I forgot about this channel I did subscribe but I forgot the channel name, now I will remember it.
Good job dude, just jumping back into coding and was a bit rusty. Finally got around to updating my bot thanks to your video. Keep it up.
Great tutorial! I have been struggling to understand the documentation so this really helped a lot. Just one question if you know, how do you make a parameter optional? Is there a flag for it or do you have to manually code the logic?
kinda late but this might help you prompt: str=None put this on the method
NOTHING WORKED EXCEPT THIS TYSM
This was really short and to the point. Well done. Maybe include a paste bin of the example code for reference in the description
thx u buddy this helped me to finish my bot. You teaches really good
Thank you for this tutorial, I had lots of problems with other videos but this one really helped.
Thank you so much bro this is an amazing tutorial! I've been trying to find videos that could help me and I finally found the one! You are such a talented programmer! Your tutorial was amazing and now my bot works now! Keep up the great work! Again, Thank you so much again!!!
I printed the results of bot.tree.sync() and saw that both the commands I coded are, in fact, in the command tree, but when I type / in my test server, the slash commands I made don't appear. Any idea what might have gone wrong?
same error
For me I hit COMMAND & R (CTRL & R on Windows and Linux) to reload my discord.
I should have thought to update this. If anyone has the same problem I had, all you need to do is restart Discord. For whatever reason, new slash commands don't appear until you restart the application.
the syncing part helped me alot!
Thank you so much
Thanks bro, nice tutorial! What theme do you use?
monakai julia
I copied exactly no errors but says 0 command(s) connected
how can I add a description to the command, like the ones below the command name when you go to slash commands. Also the ephemeral thing is what makes it only appear to the person who ran the command right
EDIT: NVM I found it, and to anyone wondering the same thing, it's quite simple. you just change @bot.tree.command(name="[your command]") to @bot.tree.command(name="[your command]", description ="[whatever description you want]")
Thanks i was looking for a tutorial on this for so long and it finally helped.
It doesn t work for me, what version of discord or python do you need, youu need nextcord and not discord? Or Pycord? 0_o?
it requires discord.py 2.0
@@glowstik as soon as I wrote this I made it work on PyCharm... however I'm using a hosting platfom where my files are stored in there, but it doesn t work because now I see that my discord.py is v1.7.3... so that was the problem.. I want to change it but I don t know how..
the / commands are saying its synced but the commands arent showing up when i type / any idea why?
You have to give the roles on your Server Permissions. Go into your Settings of the Server and klick onto integrations and then onto your bot. There you will see your commands. You can add some roles there
I'm getting "Attribute error: 'Bot' object has no attribute 'tree'
it's either something wrong with the discord.ext library, or how you used "commands.Bot" (see line 6 from the video)
I couldn't replicate the problem, so if you send more info that'd help
@@mad3567 same thing happened to me, I replicated everything from the video.
Use tree =commands.app_command(bot)
import the tree by in the on_ready thing put await bot.tree.sync()
amazing tutorial, keep up the work bro
I subbed, I like your vids. :D
Thanks. Exactly what I needed.
thanks for the tutorial!! Thank you very much for uploading this video ;)
Fantastic tutorial, thank you! Are you also using Copilot?
Yeah, thats how I got the code completion!
Hey bro, thanks for this tutorial, but I need to enable the command only for one of my servers. How can I do it?
How do I call a snowflake?
Here's the string from the docs:
guild (Optional[Snowflake]) - The guild to add the command to. If not given or None then it becomes a global command instead.
I can't understand how to call a snowflake.
God tier tutorial. Thanks so much!❤
4:16 Work smarter not harder😂
yo ty for this vid, littl equestion, how do i add descriptions to the commands and make them optional/required?
you can add a required=True to make it required and you can add command descriptions in the decorator.
Thanks for your help, really helped me here I almost gonna scrap my code and move to pycord but any ideas about the cogs?
its pretty much the same thing, you can also just check their examples at github.com/Rapptz/discord.py/blob/master/examples/app_commands/basic.py
Tysm, may I ask what compiler that you are using? It looks super nice
I'm using visual studio code as the editor and the Sublime Monakai by Aryan Ahire theme
@@glowstik tysm I didn't know dpy supported slash commands till somebody told me on discord. Glad I know how to add slash commands instead doing the old way
Thanks for this dawg
I had forgotten how to use arguments within my slash commands and couldn't find anybody explaining in a simple way. I really appriciate how this was explained and how simplified the code is compared to other people's tutorials. Very good job!
AttributeError: 'Client' object has no attribute 'tree'....
Try replace it to bot
Really great tutorial! Thank you very much!
Thank you for this tutorial! Do you know which intents this bot requires? I can't get the bot to work and I don't want to set all intents as that's very dangerous
yeah for slash commands alone you dpnt need any
how does the ide tells you error as you're typing? like when you typed try: it said it must have an exception. is it a vscode extension or are you even using vscode?🤣
what code editor do you use? it looks amazing!
Visual Studio Code and I've got the Julia Monakai Vibrant theme
what app do u use for the prediction and that? is it vs code, is it pycharm like what is it
i use github copilot (which is paid) although there is tabnine which is free
What program are you using for this
Ayo what keyboard switches you got? they sound realll smooth
gatreon reds, just modded the case with some foam
I’ve been looking for a tutorial on how to do slash commands for 2 months now. Thank you so much for making this video!! 😭
hey quick question what if i want one of the options to open a drop down menu of options they can select?
it WORKED thanks a lot
is it possible to still use embeds when using the slash commands, like you can with ctx?
yep, it works the same way also!
How do you connect this to the bot?
Btw its really useful.
I just put in my bot token which I stored in another variable so it cant be stolen
it gives me this error:Client does not have an application_id set. Either the function was called before on_ready was called or application_id was not passed to the Client constructor
Is it possible to build the command tree to sync using cogs ? That would be great to update commands with a list based arguments input.
how did your slash commands work when you put an exclamation point as your command prefix?
i'm not using bot.command() and so I can use whatever prefix I want and it will still not work.
Good video. Needs a github link with the completed code.
This actually worked but how do I get it to work with current commands in Cogs? Can't seem to get them to work
unfortunately this didnt work for me because the commands dont show up
ITS ALIVE! (ty)
I LOVE YOU I FUCKING LOVE YOU FIRST TUTORIAL THAT ACTUALLY WORKS NOTHING ELSE WORKED NOT MY BRAIN NOT TUTORIALS NOT CHAT GPT BUT YOU DID THANK YOU
chatgpt :D
help pls,
I got an error: ImportError: cannot import name 'app_commands' from 'discord'
same here
is there a way to hide certain commands from users?
can someone help me, I have installed discord with pip3 since pip doesnt work & it keeps saying it cant connect to discord when I click run
But how to categorize or create a sperate help command for the slash commands?
i keep getting errors on line 14 ( except Exception as e: ) its saying invalid syntax... what should i do?
How would you access the context (ctx) in order to get things like discord attachments in a message? Thanks!
unfortunately, slash commands use interactions and not ctx so you would have to find work arounds to getting what you need through interactions.
Can you do with discord webhooks?
alr did bro
th-cam.com/video/wysbyiGNQHE/w-d-xo.html
@@glowstik oh, thanks! Didnt saw, sorry
How to add a description to the command itself?
You can just use the description argument in the decorator
@@glowstik ye. Got it, thanks.
None of the commands are syncing
how about user commands?
it says "discord.ext.commands.errors.CommandNotFound: Command "hello" is not found and the hello command does not work
how to do it but instead of sending a message, it sends out the user avatar ?
you deserve a sub man
how did you get that italic f thing?
Your auto fill for commands, How did you set that up? Can you tell us?
Thats automaticly built in to discord lol
@@glowstik I am talking about VS code. My VS code doesn't prompt codes like that
@@SapiPlays ohh, I use github copilot but you can also use tabnine.
Very useful! Thanks
bro, is this vscode, if yes how did you make it fill the lines like that easily?
Yeah, I have github copilot so it helps me when coding by auto filling code that I might use.
do you have also a video to remove a command again? i made a lot of bullshit yesterday in my code and want to remove some commands but i know that i have to do more then just delete them from the code
They should remove them selves if you delete it from the code, you can also manually delete it from the server settings
@@glowstik oh sure true becaus when in start the bot the commands get new synced thanks man ^^'
@@glowstik For some reason, my commands stay even when rebooting the bot without the command code, and there’s no option to delete it in the integrations settings.
Was wondering if i could use an embed with this
yeah you can, its just like any other message so you can do all the same things with it
@glowstik I'm having a little trouble with it can u perhaps show me how 😅
thank you so much! I guess with this you can get the new batch or i hope so! :) xd
you may have to wait 24h for it to register and also have a friend or alt run the command just to make sure you get it!
@@glowstik okay thank you! :)
for some reason i cant start the bot with bot.run("my token") do you know why? :)
edit: it works now! thank you so much :)
How can I solve the error ValueError: 'activation comfirm' must be between 1-32 characters and contain only lower-case letters, numbers, hyphens, or underscores.
you can not have spaces in your slash command name
Is there any variable for the message itself (like the "/hello" itself)?
@app_commands.describe(var = "Variable)
sooo helpfull❤
For the first slash command I followed everything, but it says "(" was not closed. What can I do to fix it?
did you find a fix for this?
so the ( must have a closing bracket, opposite to the first one, which would be )
Why i have error - in interaction.response.send_message unknown parameter "interaction"? Please help!
interaction must equal discord.Interaction (captial i)
@@Topher7lol niceee response after 7 months
Hey can u help me to make slash commands in my scrip possible?
Thanks so much !!
I need help with smth. I wanna make a command that is a reminder, so it has to be responded to twice (1 time to confirm the reminder and the other one to actually remind the person.) but when it gets to the 2nd response it gives me the error: "InteractionResponded: This interaction has already been responded to before". Is there any way to fix this?
Use channel = bot.get_channel(your channel id) and then use channel.send to send a second message.
instead of using send_message again, use interaction.channel.send() and just mention
Cogs, please help someone.
theres no errors but if i do slash nothing shows up and if i put /hello or /say nothing came up
The program needs to be running while you try the command
hey its saying app not defined
is there way to make slash and prefix both work for command
you can use hybrid commands which would make the command both a slash and prefix command discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.HybridCommand
@@glowstik can u tell me how can i embed smthing in slassh it just show
how did you make this "F"?
when i add more commands, why don't they show up?
They might take some time to show up, you can also try creating a sync command and running that to speed up the proccess
@@glowstik I already fixed it, but thank you!
Hi, it work but I don’t see the commands
Great video! Can you provide a documentary?
can I make the commands require prems?
Yep! Discord has a built in decorator for this, here are the docs with an example to get you started discordpy.readthedocs.io/en/stable/interactions/api.html#discord.app_commands.checks.has_permissions
I tried a lot of things, this is the only working thing for me!
bro it says "Synced 0 commands"
Why are we not using a wrapper like pycord or something
well it was quite asked for and dpy now has slash commands... also dpy is also a wrapper lmao
Object method can’t be used in „await“ expression
Wen haben wir denn da 😂
@@n1klasli kennen wir uns ?
Is there a way to make describe with spaces? 'cause underlines and other stuff kinda sucks :c
since those are variable names, no
womp womp
hey what's your vs code theme?
Sublime Monokai by Aryan Ahire
@@glowstik bro i wanna say to you one thing. you are amazing about that focus on yourself and go to 10k followers
Hi, I use VSC and it says I cannot import app_commands from discord. Is there a reason why?
you may need to update discord.py
@@glowstik How would I do that?
@@glowstik So, I tried updating it, but it doesn't work still.
Same here. Tried updating it and still didnt work