Skip to content

Commit

Permalink
Merge pull request #272 from discordjs/main
Browse files Browse the repository at this point in the history
Create a new pull request by comparing changes across two branches
  • Loading branch information
GulajavaMinistudio authored Sep 5, 2024
2 parents abbff7e + c13f18e commit 8010d49
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/discord.js/src/managers/ApplicationEmojiManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ class ApplicationEmojiManager extends CachedManager {
* @returns {Promise<ApplicationEmoji|Collection<Snowflake, ApplicationEmoji>>}
* @example
* // Fetch all emojis from the application
* message.application.emojis.fetch()
* application.emojis.fetch()
* .then(emojis => console.log(`There are ${emojis.size} emojis.`))
* .catch(console.error);
* @example
* // Fetch a single emoji
* message.application.emojis.fetch('222078108977594368')
* application.emojis.fetch('222078108977594368')
* .then(emoji => console.log(`The emoji name is: ${emoji.name}`))
* .catch(console.error);
*/
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/src/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ class Message extends Base {
/**
* Partial data of the interaction that this message is a reply to
* @type {?MessageInteraction}
* @deprecated Use {@link Message#interactionMetadata} instead.
*/
this.interaction = {
id: data.interaction.id,
Expand Down
31 changes: 16 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 Expand Up @@ -6416,6 +6416,7 @@ export interface MessageInteractionMetadata {
triggeringInteractionMetadata: MessageInteractionMetadata | null;
}

/** @deprecated Use {@link MessageInteractionMetadata} instead. */
export interface MessageInteraction {
id: Snowflake;
type: InteractionType;
Expand Down

0 comments on commit 8010d49

Please sign in to comment.