mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
feat: add support for using keyword on discord.js Client and WebSocketManager (#10063)
* feat: add support for `using` keyword on client * fix: use async dispose * feat: add support for web socket manager disposing * fix: use interface for client --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -106,6 +106,10 @@ class BaseClient extends EventEmitter {
|
||||
toJSON(...props) {
|
||||
return flatten(this, ...props);
|
||||
}
|
||||
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = BaseClient;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
const { polyfillDispose } = require('@discordjs/util');
|
||||
const { __exportStar } = require('tslib');
|
||||
|
||||
polyfillDispose();
|
||||
|
||||
// "Root" classes (starting points)
|
||||
exports.BaseClient = require('./client/BaseClient');
|
||||
exports.Client = require('./client/Client');
|
||||
|
||||
Reference in New Issue
Block a user