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