discord bot slash command

hello i created slash command like 3days ago but i cant still use it others slash commandss is working
No description
34 Replies
JavaBot
JavaBot2d ago
This post has been reserved for your question.
Hey @xcel_dev! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
xcel_dev
xcel_devOP2d ago
the /ping is working but /love not
ayylmao123xdd
ayylmao123xdd2d ago
but whats the problem is the command not visible ir something
dan1st
dan1st2d ago
What happens when using it? Did you register the command?
xcel_dev
xcel_devOP2d ago
i can't add new commands only the old ones works
dan1st
dan1st2d ago
What happens and how did you register the commands?
Hype_the_Time (PING ON REPLY)
yeah it seems like you might not have it registered. I personally have a start up routine
jda.updateCommands().addCommands(globalCommands).complete()
jda.updateCommands().addCommands(globalCommands).complete()
adding all commands to it using a list. (this will overwrite all global commands you have registered updating or deleting ones no longer used. ids wont change) keep in mind that after registration you need to reload discord which you can do using CTRL+R Im not to sure whether your emojis mention will work since Discord Emojis work differently for bots and users
dan1st
dan1st2d ago
reloading is typically not necessary any more and tbh I wouldn't recommend recreating all commands every time - doing this too often can result in hitting rate limits and you not being able to use (some or any) commands for a few hours
Hype_the_Time (PING ON REPLY)
never saw that i would have hit rate limits using this. I think there is something that it only counts as 1 upsert or sth. you have to use that specific way though. otherwise its gets a lot more poblematic if you upsert them all individually. pretty sure its still the case. I think dv8 used dc client while in stage (componets v2 stage like a week ago) and browser so he could reload because he had too in browser
dan1st
dan1st2d ago
We had this issue with @JavaBot at some point though there were many restarts there
Hype_the_Time (PING ON REPLY)
interesting. you manually uploaded each or used that specifiec method?
dan1st
dan1st2d ago
in bulk
Hype_the_Time (PING ON REPLY)
i had a lot of restarts never saw that issue yet. i made it so it auto configures role overrides in my server for it. THAT one is rate limited!
JavaBot
JavaBot2d ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
xcel_dev
xcel_devOP22h ago
Thank you so much
JavaBot
JavaBot22h ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
xcel_dev
xcel_devOP22h ago
and where to add this
xcel_dev
xcel_devOP22h ago
No description
xcel_dev
xcel_devOP22h ago
here?
Hype_the_Time (PING ON REPLY)
Uh yeah should work. However there is a method like waitforready or something. It's a blocking method that ensures JDA is fully loaded. Call it first and then use the command registering method. Also keep in mind that Java can be decompiled revealing your token if shared or uploaded to github etc. Change it over to properties file or sth.
xcel_dev
xcel_devOP21h ago
i have it in private errors 😦
Hype_the_Time (PING ON REPLY)
stacktrace?
xcel_dev
xcel_devOP21h ago
No description
xcel_dev
xcel_devOP21h ago
Cannot resolve symbol 'jda'
Hype_the_Time (PING ON REPLY)
assign the return value of the jda builder to a vartiable
xcel_dev
xcel_devOP21h ago
Cannot resolve symbol 'globalCommands'
Hype_the_Time (PING ON REPLY)
also call awaitReady() list of commands you want to upsert
xcel_dev
xcel_devOP21h ago
like jda.awaitready
Hype_the_Time (PING ON REPLY)
Commands.slash()
dan1st
dan1st21h ago
Alternatively one could just put it in a listener that gets executed on startup
Hype_the_Time (PING ON REPLY)
jda.awaitReady()
xcel_dev
xcel_devOP21h ago
ye
dan1st
dan1st21h ago
no - it would need to be the JDABuilder object
ayylmao123xdd
ayylmao123xdd21h ago
so specific :GnuTrolling:

Did you find this page helpful?