How to register slash commands in Typescript
I do apologize for asking a simple and basic question here, but I've already searched for it here and google but couldn't find an appropriate solution to apply to my code...
This is my code to register events to my bot and I didn't write this code by myself but it was from a tutorial video on Youtube.
I don't demand to teach me the full process to register slash commands, but please just give me some tiny hints!
+ I want to make it global commands!
client.ts
index.ts
message.ts
events.ts
4 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPIt wasn't like this before I try to apply this(https://stackoverflow.com/questions/68431146/use-slash-commands-in-all-servers-where-have-a-bot-without-guildid-discord-js-v) solution to my code... thats my fault I put the wrong code on my question... Here is the previous one which replies to a certain message without slash command.
message.ts
Stack Overflow
Use Slash Commands in all servers where have a bot without GuildID ...
I want people to be able to use Slash Commands against my bot on any server, as long as the bot is there. I have further granted the bot application.commands permission. I was referencing this answ...
I tried to follow this guide but it didn't seem like using Typescript...
Maybe I can just make another project with Javascript so I can follow the guide but I'm using Typescript not just because of making a bot to use in discord but also wanted to improve my Typescript skill and comprehension of Javascript and Typescript...