MessagesMethods
Signature
@Mixins(BaseNoEditableChannel<ChannelType>)export declare class MessagesMethods extends DiscordBasePrivate types
IChannelTypesInterface
interface IChannelTypes { GuildStageVoice: StageChannel; GuildMedia: MediaChannel; DM: DMChannel; GuildForum: ForumChannel; AnnouncementThread: ThreadChannel; PrivateThread: ThreadChannel; PublicThread: ThreadChannel; GuildDirectory: DirectoryChannel; GuildVoice: VoiceChannel; GuildText: TextGuildChannel; GuildCategory: CategoryChannel; GuildAnnouncement: NewsChannel;}Properties
9Methods
24Properties
messages: { write: (body: MessageCreateBodyRequest) => Promise<MessageStructure>; edit: (messageId: string, body: MessageUpdateBodyRequest) => Promise<MessageStructure>; crosspost: (messageId: string, reason?: string) => Promise<MessageStructure>; delete: (messageId: string, reason?: string) => Promise<void>; fetch: (messageId: string, force?: boolean) => Promise<MessageStructure>; purge: (messages: string[], reason?: string) => Promise<void | undefined>; list: (fetchOptions?: RESTGetAPIChannelMessagesQuery) => Promise<MessageStructure[]>;};pins: { fetch: (query?: RESTGetAPIChannelMessagesPinsQuery) => Promise<{ hasMore: boolean; items: { pinnedAt: number; message: MessageStructure; }[]; }>; set: (messageId: string, reason?: string) => Promise<undefined>; delete: (messageId: string, reason?: string) => Promise<undefined>;};reactions: { add: (messageId: string, emoji: EmojiResolvable) => Promise<void>; delete: (messageId: string, emoji: EmojiResolvable, userId?: string) => Promise<void>; fetch: (messageId: string, emoji: EmojiResolvable, query?: RESTGetAPIChannelMessageReactionUsersQuery) => Promise<UserStructure[]>; purge: (messageId: string, emoji?: EmojiResolvable) => Promise<void>;};id: string;createdTimestampGetterget createdTimestamp(): number;Create a timestamp for the current object.
createdAtGetterget createdAt(): Date;createdAt gets the creation Date instace of the current object.
readonly client: UsingClient;type: T;urlGetterget url(): `https://discord.com/channels/${string}/${string}`;The URL to the channel
Methods
typing(): Promise<void>;static messages(ctx: MethodContext<{ channelId: string;}>): { write: (body: MessageCreateBodyRequest) => Promise<MessageStructure>; edit: (messageId: string, body: MessageUpdateBodyRequest) => Promise<MessageStructure>; crosspost: (messageId: string, reason?: string) => Promise<MessageStructure>; delete: (messageId: string, reason?: string) => Promise<void>; fetch: (messageId: string, force?: boolean) => Promise<MessageStructure>; purge: (messages: string[], reason?: string) => Promise<void | undefined>; list: (fetchOptions?: RESTGetAPIChannelMessagesQuery) => Promise<MessageStructure[]>;};static reactions(ctx: MethodContext<{ channelId: string;}>): { add: (messageId: string, emoji: EmojiResolvable) => Promise<void>; delete: (messageId: string, emoji: EmojiResolvable, userId?: string) => Promise<void>; fetch: (messageId: string, emoji: EmojiResolvable, query?: RESTGetAPIChannelMessageReactionUsersQuery) => Promise<UserStructure[]>; purge: (messageId: string, emoji?: EmojiResolvable) => Promise<void>;};static pins(ctx: MethodContext<{ channelId: string;}>): { fetch: (query?: RESTGetAPIChannelMessagesPinsQuery) => Promise<{ hasMore: boolean; items: { pinnedAt: number; message: MessageStructure; }[]; }>; set: (messageId: string, reason?: string) => Promise<undefined>; delete: (messageId: string, reason?: string) => Promise<undefined>;};static transformMessageBody<T>(body: MessageCreateBodyRequest | MessageUpdateBodyRequest, files: RawFile[] | undefined, self: UsingClient): T;fetch(mode?: 'rest' | 'flow'): Promise<AllChannels>;fetch(mode: 'cache'): ReturnCache<AllChannels | undefined>;delete(reason?: string): Promise<this>;toString(): `<#${string}>`;Returns a string representation of an object.
isStage(): this is StageChannel;isMedia(): this is MediaChannel;isDM(): this is DMChannel;isForum(): this is ForumChannel;isThread(): this is ThreadChannel;isDirectory(): this is DirectoryChannel;isVoice(): this is VoiceChannel;isTextGuild(): this is TextGuildChannel;isCategory(): this is CategoryChannel;isNews(): this is NewsChannel;isTextable(): this is AllTextableChannels;isGuildTextable(): this is AllGuildTextableChannels;isNamed(): this is AllNamedChannels;isGuild(): this is AllGuildChannels | BaseGuildChannelStructure;isThreadOnly(): this is ForumChannel | MediaChannel;is<T extends (keyof IChannelTypes)[]>(channelTypes: T): this is IChannelTypes[T[number]];