mirror of
https://github.com/danbulant/discord.js
synced 2026-06-07 16:52:16 +00:00
src: add deprecation warning related to removel of uws (#3648)
* src: Add deprecation warning related to uws * lint: Fix lint * src: Simplify code
This commit is contained in:
parent
fbe9bc499b
commit
5556b05241
1 changed files with 4 additions and 1 deletions
|
|
@ -16,7 +16,10 @@ const erlpack = (function findErlpack() {
|
||||||
const WebSocket = (function findWebSocket() {
|
const WebSocket = (function findWebSocket() {
|
||||||
if (browser) return window.WebSocket; // eslint-disable-line no-undef
|
if (browser) return window.WebSocket; // eslint-disable-line no-undef
|
||||||
try {
|
try {
|
||||||
return require('@discordjs/uws');
|
const uws = require('@discordjs/uws');
|
||||||
|
process.emitWarning('uws support is being removed in the next version of discord.js',
|
||||||
|
'DeprecationWarning', findWebSocket);
|
||||||
|
return uws;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return require('ws');
|
return require('ws');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue