discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.26k stars 3.96k forks source link

Add support for the @discordjs/rest package in browser environments #8436

Closed TheOnlyTails closed 11 months ago

TheOnlyTails commented 2 years ago

Which package is the feature request for?

rest

Feature

I started recently working on a web dashboard for one of my bots, and I was looking for a package to make requests to Discord API (which obviously are very common on a bot dashboard) easier than using the native fetch API. I was delighted to see that this package exists, but was quite disappointed to see it doesn't support browser environments due to its use of big integer literals.

Ideal solution or implementation

I would like the library to be compatible with browser environments.

Alternative solutions or implementations

No response

Other context

No response

ckohen commented 2 years ago

BigInt literals are supported in all modern browsers, this is not the problem with support for browser environments. The two major things are event emitter and undici.request over fetch (which is significantly faster for node)

tomprince commented 1 year ago

I'm interested in this, for running a bot in a cloudflare worker, using the interaction webhook.

didinele commented 1 year ago

once #9416 is merged and we move REST to async event emitter this will be resolved

Jiralite commented 11 months ago

This is supported as of 2.0.0.