mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +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() {
|
||||
if (browser) return window.WebSocket; // eslint-disable-line no-undef
|
||||
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) {
|
||||
return require('ws');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue