Serverless

Is possible running on a serverless platform like Vercel, AWS Lambda, etc..??
5 Replies
Favna
Favna7mo ago
It is not because serverless platforms all use their own little wrapper around NodeJS and we use various NodeJS internals. Serverless functions also always shut down after a while and boot back up when a request comes in, but that doesn't suit discord bots which need to be up and watching messages/interactions non stop.
Balllaz
BalllazOP6mo ago
Not even with webhooks? Oh ok... to provide the slash comands on discord, the bot need to be Online in the full time. But for custom prefix commands like > or ! almost wrbhook triggers can work fine, or not?
Favna
Favna6mo ago
Webhooks do not receive message content anymore since the introduction of the privileged intent. Either way, discordjs and by association sapphire will not let you write a webhook only bot.
Balllaz
BalllazOP6mo ago
It's true!... In this case, for a serverless implementation we would have to use the discord-interactions lib, but it wouldn't be a complete bot.
Favna
Favna6mo ago
I would recommend you look into the discordjs subpackages of @discordjs/rest or @discordjs/core instead. discord-interactions is very raw and not the best DX. You can also use @Skyra/http-framework which powers @Spinel @Nekokai @Iriss and @Teryl and is very sapphire-like in structure. (it is made by me and Kyra after all, 2 of 3 core devs of sapphire)
Want results from more Discord servers?
Add your server