Skip to content

Conversation

@sdanialraza
Copy link
Member

Please describe the changes this PR makes and why it should be merged:
Resolves #11271

BREAKING CHANGE: BaseClient has been removed and its functionality has been merged into Client.

Depends on:

@vercel
Copy link

vercel bot commented Nov 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
discord-js Skipped Skipped Nov 13, 2025 9:01pm
discord-js-guide Skipped Skipped Nov 13, 2025 9:01pm

@sdanialraza sdanialraza changed the title refactor(Webhooks)!: remove WebhookClient refactor(client)!: remove BaseClient Nov 12, 2025
@Jiralite Jiralite force-pushed the refactor/remove-base-client branch from 6ced9bd to 514b015 Compare November 13, 2025 21:01
@Jiralite Jiralite marked this pull request as ready for review November 13, 2025 21:01
@vercel vercel bot temporarily deployed to Preview – discord-js November 13, 2025 21:01 Inactive
@Jiralite Jiralite requested a review from a team as a code owner November 13, 2025 21:01
@vercel vercel bot temporarily deployed to Preview – discord-js-guide November 13, 2025 21:01 Inactive
@sdanialraza sdanialraza requested review from Copilot and removed request for SpaceEEC, iCrawl, kyranet and vladfrangu November 13, 2025 21:54
Copilot finished reviewing on behalf of sdanialraza November 13, 2025 21:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the BaseClient class and merges all its functionality directly into the Client class, simplifying the inheritance hierarchy.

  • Eliminates the BaseClient abstraction layer
  • Client now extends AsyncEventEmitter directly instead of inheriting from BaseClient
  • All BaseClient methods and properties moved to Client class

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
packages/discord.js/typings/index.d.ts Removed BaseClient type definition and updated Client to extend AsyncEventEmitter directly, added previously inherited methods and properties
packages/discord.js/src/index.js Removed BaseClient export
packages/discord.js/src/client/Client.js Now extends AsyncEventEmitter directly and includes all functionality previously in BaseClient (REST management, options handling, helper methods)
packages/discord.js/src/client/BaseClient.js Deleted entire file as functionality merged into Client

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

throw new DiscordjsTypeError(ErrorCodes.InvalidType, 'options', 'object', true);
}

const defaultOptions = Options.createDefault();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now a duplicate of the variable defaults defined later on and should be done only once.

actions: false,
presence: false,
});
toJSON(...props) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering we don't need nor want to be able to pass more properties to toJSON() this can probably be simplified by removing `...props’ here and on next line

public login(token?: string): Promise<string>;
public isReady(): this is Client<true>;
public toJSON(): unknown;
public toJSON(...props: Record<string, boolean | string>[]): unknown;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

*/
constructor(options) {
super(options);
constructor(options = {}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options are a required parameter for Client constructor (in particular the intents are), so why have a default value defined here?

@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Review in Progress

Development

Successfully merging this pull request may close these issues.

Remove BaseClient from discord.js

3 participants