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: export GroupDM helper type #10478

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Changes from all commits
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
30 changes: 15 additions & 15 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2192,27 +2192,27 @@ export class Message<InGuild extends boolean = boolean> extends Base {
public createMessageComponentCollector<ComponentType extends MessageComponentType>(
options?: MessageCollectorOptionsParams<ComponentType, InGuild>,
): InteractionCollector<MappedInteractionTypes<InGuild>[ComponentType]>;
public delete(): Promise<NonPartialGroupDMChannel<Message<InGuild>>>;
public delete(): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
public edit(
content: string | MessageEditOptions | MessagePayload,
): Promise<NonPartialGroupDMChannel<Message<InGuild>>>;
): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
public equals(message: Message, rawData: unknown): boolean;
public fetchReference(): Promise<NonPartialGroupDMChannel<Message<InGuild>>>;
public fetchReference(): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
public fetchWebhook(): Promise<Webhook>;
public crosspost(): Promise<NonPartialGroupDMChannel<Message<InGuild>>>;
public fetch(force?: boolean): Promise<NonPartialGroupDMChannel<Message<InGuild>>>;
public pin(reason?: string): Promise<NonPartialGroupDMChannel<Message<InGuild>>>;
public crosspost(): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
public fetch(force?: boolean): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
public pin(reason?: string): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
public react(emoji: EmojiIdentifierResolvable): Promise<MessageReaction>;
public removeAttachments(): Promise<NonPartialGroupDMChannel<Message<InGuild>>>;
public removeAttachments(): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
public reply(
options: string | MessagePayload | MessageReplyOptions,
): Promise<NonPartialGroupDMChannel<Message<InGuild>>>;
): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
public resolveComponent(customId: string): MessageActionRowComponent | null;
public startThread(options: StartThreadOptions): Promise<PublicThreadChannel<false>>;
public suppressEmbeds(suppress?: boolean): Promise<NonPartialGroupDMChannel<Message<InGuild>>>;
public suppressEmbeds(suppress?: boolean): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
public toJSON(): unknown;
public toString(): string;
public unpin(reason?: string): Promise<NonPartialGroupDMChannel<Message<InGuild>>>;
public unpin(reason?: string): Promise<OmitPartialGroupDMChannel<Message<InGuild>>>;
public inGuild(): this is Message<true>;
}

Expand Down Expand Up @@ -5270,7 +5270,7 @@ export interface GuildMembersChunk {
nonce: string | undefined;
}

type NonPartialGroupDMChannel<Structure extends { channel: Channel }> = Structure & {
export type OmitPartialGroupDMChannel<Structure extends { channel: Channel }> = Structure & {
channel: Exclude<Structure['channel'], PartialGroupDMChannel>;
};

Expand Down Expand Up @@ -5316,17 +5316,17 @@ export interface ClientEvents {
guildUpdate: [oldGuild: Guild, newGuild: Guild];
inviteCreate: [invite: Invite];
inviteDelete: [invite: Invite];
messageCreate: [message: NonPartialGroupDMChannel<Message>];
messageDelete: [message: NonPartialGroupDMChannel<Message | PartialMessage>];
messageCreate: [message: OmitPartialGroupDMChannel<Message>];
messageDelete: [message: OmitPartialGroupDMChannel<Message | PartialMessage>];
messagePollVoteAdd: [pollAnswer: PollAnswer, userId: Snowflake];
messagePollVoteRemove: [pollAnswer: PollAnswer, userId: Snowflake];
messageReactionRemoveAll: [
message: NonPartialGroupDMChannel<Message | PartialMessage>,
message: OmitPartialGroupDMChannel<Message | PartialMessage>,
reactions: ReadonlyCollection<string | Snowflake, MessageReaction>,
];
messageReactionRemoveEmoji: [reaction: MessageReaction | PartialMessageReaction];
messageDeleteBulk: [
messages: ReadonlyCollection<Snowflake, NonPartialGroupDMChannel<Message | PartialMessage>>,
messages: ReadonlyCollection<Snowflake, OmitPartialGroupDMChannel<Message | PartialMessage>>,
channel: GuildTextBasedChannel,
];
messageReactionAdd: [
Expand Down