Skip to content

Commit

Permalink
Merge branch 'main' into chore/pin-ws
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx authored Aug 8, 2024
2 parents b33bba6 + 54303d0 commit 8da55ec
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .commitlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"always",
["chore", "build", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", "types"]
],
"scope-case": [0]
"scope-case": [0],
"subject-exclamation-mark": [0]
}
}
3 changes: 2 additions & 1 deletion .github/COMMIT_CONVENTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Messages must be matched by the following regex:

```js
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore|types)(\(.+\))?: .{1,72}/;
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore|types)(\(.+\))?!?: .{1,72}/;
```

#### Examples
Expand Down Expand Up @@ -55,6 +55,7 @@ A commit message consists of a **header**, **body** and **footer**. The header h
```

The **header** is mandatory and the **scope** of the header is optional.
If the commit contains **Breaking Changes**, a `!` can be added before the `:` as an indicator.

### Revert

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
REGEX="^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore|types)(\\(.+\\))?: .{1,72}$"
REGEX="^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore|types)(\\(.+\\))?!?: .{1,72}$"
echo "Title: \"$TITLE\""
Expand Down
15 changes: 1 addition & 14 deletions packages/discord.js/src/client/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ 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 @@ -140,7 +139,7 @@ class Client extends BaseClient {
* @private
* @type {ClientPresence}
*/
this.presence = new ClientPresence(this, this.options.ws.presence ?? this.options.presence);
this.presence = new ClientPresence(this, this.options.presence);

Object.defineProperty(this, 'token', { writable: true });
if (!this.token && 'DISCORD_TOKEN' in process.env) {
Expand Down Expand Up @@ -220,15 +219,6 @@ 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 Expand Up @@ -557,9 +547,6 @@ class Client extends BaseClient {
if (typeof options.ws !== 'object' || options.ws === null) {
throw new DiscordjsTypeError(ErrorCodes.ClientInvalidOption, 'ws', 'an object');
}
if (typeof options.ws.presence !== 'object' || options.ws.presence === null) {
throw new DiscordjsTypeError(ErrorCodes.ClientInvalidOption, 'ws.presence', 'an object');
}
if (typeof options.rest !== 'object' || options.rest === null) {
throw new DiscordjsTypeError(ErrorCodes.ClientInvalidOption, 'rest', 'an object');
}
Expand Down
1 change: 0 additions & 1 deletion packages/discord.js/src/util/Options.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ const { version } = require('../../package.json');
* only set this if you know what you are doing</warn>
* @property {BuildStrategyFunction} [buildStrategy] Builds the strategy to use for sharding
* @property {IdentifyThrottlerFunction} [buildIdentifyThrottler] Builds the identify throttler to use for sharding
* @property {PresenceData} [presence={}] Presence data to use upon login
*/

/**
Expand Down
3 changes: 0 additions & 3 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ import {
APISelectMenuDefaultValue,
SelectMenuDefaultValueType,
InviteType,
GatewayPresenceUpdateData,
} from 'discord-api-types/v10';
import { ChildProcess } from 'node:child_process';
import { EventEmitter } from 'node:events';
Expand Down Expand Up @@ -5305,7 +5304,6 @@ export interface ClientOptions {
allowedMentions?: MessageMentionOptions;
partials?: readonly Partials[];
failIfNotExists?: boolean;
/** @deprecated Use {@link ClientOptions.ws.presence} instead */
presence?: PresenceData;
intents: BitFieldResolvable<GatewayIntentsString, number>;
waitGuildTimeout?: number;
Expand Down Expand Up @@ -6878,7 +6876,6 @@ export interface WebhookMessageCreateOptions extends Omit<MessageCreateOptions,
export interface WebSocketOptions {
large_threshold?: number;
version?: number;
presence?: GatewayPresenceUpdateData;
buildStrategy?(manager: WSWebSocketManager): IShardingStrategy;
buildIdentifyThrottler?(manager: WSWebSocketManager): Awaitable<IIdentifyThrottler>;
}
Expand Down

0 comments on commit 8da55ec

Please sign in to comment.