mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 03:23:29 +01:00
feat(Message*): add missing fields, add support for flag editing (#3795)
This commit is contained in:
30
typings/index.d.ts
vendored
30
typings/index.d.ts
vendored
@@ -804,6 +804,7 @@ declare module 'discord.js' {
|
||||
public editedTimestamp: number;
|
||||
public readonly edits: Message[];
|
||||
public embeds: MessageEmbed[];
|
||||
public flags: Readonly<MessageFlags>;
|
||||
public readonly guild: Guild;
|
||||
public hit: boolean;
|
||||
public id: Snowflake;
|
||||
@@ -813,6 +814,7 @@ declare module 'discord.js' {
|
||||
public readonly pinnable: boolean;
|
||||
public pinned: boolean;
|
||||
public reactions: Collection<Snowflake, MessageReaction>;
|
||||
public reference: MessageReference | null;
|
||||
public system: boolean;
|
||||
public tts: boolean;
|
||||
public type: string;
|
||||
@@ -833,6 +835,7 @@ declare module 'discord.js' {
|
||||
public react(emoji: string | Emoji | ReactionEmoji): Promise<MessageReaction>;
|
||||
public reply(content?: StringResolvable, options?: MessageOptions): Promise<Message | Message[]>;
|
||||
public reply(options?: MessageOptions): Promise<Message | Message[]>;
|
||||
public suppressEmbeds(suppress?: boolean): Promise<Message>;
|
||||
public toString(): string;
|
||||
public unpin(): Promise<Message>;
|
||||
}
|
||||
@@ -940,6 +943,11 @@ declare module 'discord.js' {
|
||||
public width: number;
|
||||
}
|
||||
|
||||
export class MessageFlags extends BitField<MessageFlagsString> {
|
||||
public static FLAGS: Record<MessageFlagsString, number>;
|
||||
public static resolve(bit?: BitFieldResolvable<MessageFlagsString>): number;
|
||||
}
|
||||
|
||||
export class MessageMentions {
|
||||
private _channels: Collection<Snowflake, GuildChannel>;
|
||||
private _client: Client;
|
||||
@@ -948,6 +956,7 @@ declare module 'discord.js' {
|
||||
private _members: Collection<Snowflake, GuildMember>;
|
||||
|
||||
public readonly channels: Collection<Snowflake, TextChannel>;
|
||||
public crosspostedChannels: Collection<Snowflake, CrosspostedChannel>;
|
||||
public everyone: boolean;
|
||||
public readonly members: Collection<Snowflake, GuildMember>;
|
||||
public roles: Collection<Snowflake, Role>;
|
||||
@@ -1361,6 +1370,7 @@ declare module 'discord.js' {
|
||||
public lastMessageID: string;
|
||||
public readonly note: string;
|
||||
public readonly presence: Presence;
|
||||
public system?: boolean;
|
||||
public readonly tag: string;
|
||||
public username: string;
|
||||
public addFriend(): Promise<User>;
|
||||
@@ -1849,6 +1859,13 @@ declare module 'discord.js' {
|
||||
| number
|
||||
| string;
|
||||
|
||||
type CrosspostedChannel = {
|
||||
channelID: Snowflake;
|
||||
guildID: Snowflake;
|
||||
type: Channel["type"] | 'unknown';
|
||||
name: string;
|
||||
};
|
||||
|
||||
type DeconstructedSnowflake = {
|
||||
timestamp: number;
|
||||
date: Date;
|
||||
@@ -2040,8 +2057,15 @@ declare module 'discord.js' {
|
||||
type MessageEditOptions = {
|
||||
embed?: RichEmbedOptions;
|
||||
code?: string | boolean;
|
||||
flags?: BitFieldResolvable<MessageFlagsString>;
|
||||
};
|
||||
|
||||
type MessageFlagsString = 'CROSSPOSTED'
|
||||
| 'IS_CROSSPOST'
|
||||
| 'SUPRRESS_EMBEDS'
|
||||
| 'SOURCE_MESSAGE_DELETED'
|
||||
| 'URGENT';
|
||||
|
||||
type MessageNotifications = 'EVERYTHING'
|
||||
| 'MENTIONS'
|
||||
| 'NOTHING';
|
||||
@@ -2100,6 +2124,12 @@ declare module 'discord.js' {
|
||||
nsfw?: boolean;
|
||||
};
|
||||
|
||||
type MessageReference = {
|
||||
channelID: Snowflake;
|
||||
guildID: Snowflake | null;
|
||||
messageID: Snowflake | null;
|
||||
};
|
||||
|
||||
type MessageSearchResult = {
|
||||
totalResults: number;
|
||||
messages: Message[][];
|
||||
|
||||
Reference in New Issue
Block a user