diff --git a/index.d.ts b/index.d.ts index 6cd2a5d39..8e2348cf0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -510,6 +510,7 @@ declare namespace Eris { /** @deprecated */ agent?: HTTPSAgent; allowedMentions?: AllowedMentions; + application?: { id: string; flags?: number }; autoreconnect?: boolean; compress?: boolean; connectionTimeout?: number; diff --git a/lib/Client.js b/lib/Client.js index 97f9ea634..991ef7dcd 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -79,6 +79,7 @@ class Client extends EventEmitter { * Create a Client * @arg {String} token The auth token to use. Bot tokens should be prefixed with `Bot` (e.g. `Bot MTExIHlvdSAgdHJpZWQgMTEx.O5rKAA.dQw4w9WgXcQ_wpV-gGA4PSk_bm8`). Prefix-less bot tokens are [DEPRECATED] * @arg {Object} options Eris client options + * @arg {Object} [options.application] Object containing the bot application's ID and its public flags * @arg {Object} [options.agent] [DEPRECATED] A HTTPS Agent used to proxy requests. This option has been moved under `options.rest` * @arg {Object} [options.allowedMentions] A list of mentions to allow by default in createMessage/editMessage * @arg {Boolean} [options.allowedMentions.everyone] Whether or not to allow @everyone/@here @@ -152,6 +153,13 @@ class Client extends EventEmitter { ws: {}, reconnectDelay: (lastDelay, attempts) => Math.pow(attempts + 1, 0.7) * 20000, }, options); + + if (options.application) { + this.application = { + id: options.application.id, + flags: options.application.flags ?? 0, + }; + } this.options.allowedMentions = this._formatAllowedMentions(this.options.allowedMentions); if (this.options.lastShardID === undefined && this.options.maxShards !== "auto") { this.options.lastShardID = this.options.maxShards - 1;