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:
Vlad Frangu
2020-01-12 16:16:27 +02:00
committed by SpaceEEC
parent fbe9bc499b
commit 5556b05241

View File

@@ -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');
}