slashcommand wont appear
Tried to implement slash command but it wont show up. The bot is invited with the bot and application.commands scope and it still wont work.
ping.js
index.js
26 Replies
Please follow the guide for creating a slash command: https://sapphirejs.dev/docs/Guide/getting-started/creating-a-basic-app-command
Sapphire Framework
Creating a basic slash command | Sapphire
This section covers the absolute minimum for setting up a slash command. We have an entire "Application Commands"
currently you're only implementing message commands
message commands are the old style of !prefix command, what your screenshot is looking for is called a context menu command https://sapphirejs.dev/docs/Guide/getting-started/creating-a-basic-context-menu-command
Sapphire Framework
Creating a basic context menu command | Sapphire
This section covers the absolute minimum for setting up a message context menu command. We have an entire
Ii just pasted the code to see if it works but it still wont update the slash command
is it supposed to take time or am i doing something wrong?
you'll be doing something wrong. Please show your current code.
you can also generate a starter template using @sapphire/cli
ping.js
main file is the same
and this is my project structure
by "main file is the same" what is the main file? are you referring to you main in package.json? how do you start the bot?
oh my bad
i was refering to index.js
i start the bot using nodemon
nodemon src/index.js
?
just nodemon
try changing it to
nodemon .
instead of nodemon index.js
same logs as before
let me check if the slash command appears
it would have logged if it did so no it doesnt
nope still dead
logged what exatly???
can you try to generate a template with @sapphire/cli? I can't quite tell what is wrong at a glance but if you generate with the template it must be right
i shall try this then
usage is also documented on the website
i see
this is for @Dragonite . See how there is a line between initializing and the time it took.
oh
yes this never came up
also what was the cli command to create a template again? i am unable to find it on docs
https://sapphirejs.dev/docs/Guide/CLI/getting-started please put in a little bit of effort... the header "official Sapphire CLI" really shouldn't be that hard to find
no i did find this
do you mean the command to install the packages for saphhirejs?
or like a fullblown starter project template
I hate doing this just as much as people hate receiving it but ...
oh god
sorry
had problems with teh cli too so i just gave up and then figured out that i forgot the defaultPrefix: '!' parameter in the client object :)
normal commands work when i do this
still gotta try slash commands
and sub commands too
the cli should create a ready made template, make sure when you invite your bot you add the application commands scope.
yes yes did taht
the logs of the cli said that it registered 4 commands but none of them worked in the server