From 89349b9eac9f3706f5ad8d47309b1a3ac72362c0 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Mon, 15 Aug 2022 19:50:11 +0700 Subject: [PATCH] fix(Client): Emit Warning fixed #253 --- src/client/BaseClient.js | 5 ++++- src/client/Client.js | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/client/BaseClient.js b/src/client/BaseClient.js index 3bf037f..cedb9f9 100644 --- a/src/client/BaseClient.js +++ b/src/client/BaseClient.js @@ -1,6 +1,7 @@ 'use strict'; const EventEmitter = require('node:events'); +const process = require('node:process'); const RESTManager = require('../rest/RESTManager'); const Options = require('../util/Options'); const Util = require('../util/Util'); @@ -12,7 +13,9 @@ const Util = require('../util/Util'); class BaseClient extends EventEmitter { constructor(options = {}) { super(); - + if (options.intents) { + process.emitWarning('Intents is not available.', 'DeprecationWarning'); + } /** * The options the client was instantiated with * @type {ClientOptions} diff --git a/src/client/Client.js b/src/client/Client.js index 81bfbe4..782352e 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -244,10 +244,6 @@ class Client extends BaseClient { this.options.messageSweepInterval * 1_000, ).unref(); } - - if (this.options.intents) { - process.emitWarning('Intent is not available.', 'DeprecationWarning'); - } } /**