Including Discord.js for the web?
I don’t know if there is any way to use discord js for the web, like I want to run a express website and use discord.js in client side, if there is a way to do that helping would be amazing
15 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Do you even need a full Gateway client? It's probably best to just use API calls with the helpers from discord-api-types and the REST package
I would say yes but if there is any other way of doing it it would be great to give me examples
You only need the gateway to listen for events like interactionCreate and guildMemberUpdate. If you're just doing stuff like sending messages and editing guilds, the gateway is irrelevant
Is there any way to do it with fetching? Cause I have been trying to get around it for a while and haven’t got the answer yet
What is the "it" you're doing?
I’m basically trying to get a button on my website to create channels (this is an example)
That's just a simple API call, no gateway required, so no discord.js necessary
Ah I got it, but any examples cause my brain isn’t good with api stuff
If you remember from the DJS' guide command deployment script, you can use a combination of a REST instance and a route. Eg,
rest.post(Routes.guildChannels(<guildId>), { body: {...} })
I’ll try that to see what I get, I’ll ping you or I’ll send a message here if I get a error
I wasn’t generally planning to do that, I was wondering if I can get the api to be included in the website as a script or smth
I can’t find any way to do that
I’ll try
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Thanks for suggestions
I’ll try em out
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I’m gonna probs use svelte