Sopur / Discord-user-bots

Working discord user bots library.
MIT License
81 stars 35 forks source link

how to use slash commands? client.send() only send text as text but not as a command #42

Open sacredwolfon opened 1 year ago

Sopur commented 1 year ago

Slash commands do not work as of version 1.6.0.

CyberNinja2007 commented 1 year ago

I managed to send the slash commands through the client.fetch_request(), if I understand it right, all the slash commands are interactions, so you need to go to the web version of Discord, open the network and send the slash command and you should see the post request that is sended to 'interactions' url and with that you can do client.fetch_request(). For example: const answer = await client.fetch_request( 'interactions', { method: 'POST', body: {<THE BODY OF THE REQUEST FROM WEB DISCORD>} }