I am creating a Discord Bot using Discord.js and want to change it to receive interactions through POST requests instead of websockets, as the new option for Discord Apps:
You can optionally configure an interactions endpoint to receive interactions via HTTP POSTs rather than over Gateway with a bot user.
Slash commands and interactions works as expected with websocks by using:
client.ws.on('INTERACTION_CREATE', async (interaction) => {
// receive and answer the interaction
})
The problem is, I can't find on the documentation how to explicitly receive interactions through http POST neither options to set the listening PORT.