mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 03:23:29 +01: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:
@@ -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');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user