how to handle interactions through interaction URL, no gateway
Hey, I haven't made bots in quite a while, so im kinda lost on how to do this in discordJS.
question:
- How do I use discord.js without connecting to gateway, purely through interaction URL
why I want it:
- I want a stateless discord bot, so its easy to scale with the rest of my app
- I just need basic responding to slash commands
I could simply make a route and handle it all myself using the rest client, but I would prefer the nice utilities that discord.js provides like
interaction.reply()
6 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 OPHTTP-only applications receive interactions through HTTP webhooks instead of the Discord Gateway. Bots that are not connected to the Gateway, but use HTTP interactions appear as online without a status. Discord.js does not support HTTP interactions. Use discord-interactions instead.
@discordjs/core
also ships with @discordjs/core/http-only
if you just want the utility methodsdiscord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
though afaik, for an interactions endpoint, you'd be responding to a request rather than making a POST request to the appropriate endpoint
that is an interface you'd be able to use yes
Oh true, forgot about that.
either way, discord.js doesn't have it in scope, according to the tag. thanks anyway
very quick response as well, thanks a lot 🙂