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

types(DirectoryChannel): Ensure directory channels cannot contain user mentions when stringified #10043

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

Jiralite
Copy link
Member

@Jiralite Jiralite commented Dec 10, 2023

Please describe the changes this PR makes and why it should be merged:
Directory channels when stringified cannot possibly be a user mention (which is typed through the inheritance chain):

export class DirectoryChannel extends BaseChannel {

export abstract class BaseChannel extends Base {
public constructor(client: Client<true>, data?: RawChannelData, immediatePatch?: boolean);
public get createdAt(): Date | null;
public get createdTimestamp(): number | null;
public id: Snowflake;
public flags: Readonly<ChannelFlagsBitField> | null;
public get partial(): false;
public type: ChannelType;
public get url(): string;
public delete(): Promise<this>;
public fetch(force?: boolean): Promise<this>;
public isThread(): this is AnyThreadChannel;
public isTextBased(): this is TextBasedChannel;
public isDMBased(): this is PartialGroupDMChannel | DMChannel | PartialDMChannel;
public isVoiceBased(): this is VoiceBasedChannel;
public isThreadOnly(): this is ThreadOnlyChannel;
public toString(): ChannelMention | UserMention;
}

Also added tests for the remaining channels.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Copy link

vercel bot commented Dec 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Dec 18, 2023 10:25pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Dec 18, 2023 10:25pm

@Jiralite Jiralite force-pushed the types/directory-channel-mention branch from eb9b366 to 10cab26 Compare December 18, 2023 22:25
@kodiakhq kodiakhq bot merged commit db56324 into main Dec 18, 2023
7 checks passed
@kodiakhq kodiakhq bot deleted the types/directory-channel-mention branch December 18, 2023 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants