Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: deprecate client options presence #10419

Merged
merged 6 commits into from
Jul 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/discord.js/src/client/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const Status = require('../util/Status');
const Sweepers = require('../util/Sweepers');

let deprecationEmittedForPremiumStickerPacks = false;
let deprecationEmittedForClientPresence = false;

/**
* The main hub for interacting with the Discord API, and the starting point for any bot.
Expand Down Expand Up @@ -219,6 +220,15 @@ class Client extends BaseClient {
this.emit(Events.Debug, `Provided token: ${this._censoredToken}`);

if (this.options.presence) {
if (!deprecationEmittedForClientPresence) {
process.emitWarning(
'ClientOptions#presence is deprecated and will be removed. Use ClientOptions#ws#presence instead.',
'DeprecationWarning',
);

deprecationEmittedForClientPresence = true;
}

this.options.ws.presence = this.presence._parse(this.options.presence);
}

Expand Down
Loading