Skip to main content
Module

x/biscuit/mod.ts>Message

A Discord library that is easy to use but reliable on its core 🥠
Latest
class Message
implements Model
Re-export
import { Message } from "https://deno.land/x/biscuit@0.2.4/mod.ts";

Constructors

new
Message(session: Session, data: DiscordMessage)

Properties

optional
activity: MessageActivity

sent with Rich Presence-related chat embeds

optional
application: Partial<Application>

sent with Rich Presence-related chat embeds

optional
applicationId: Snowflake

if the message is an Interaction or application-owned webhook, this is the id of the application

attachments: Attachment[]

any attached files

author: User

the author of this message, this field is not sent on webhook messages

channelId: Snowflake

id of the channel the message was sent in

components: Component[]

sent if the message contains components like buttons, action rows, or other interactive components

content: string

contents of the message

readonly
createdAt: Date

gets the timestamp of this message as a Date

readonly
createdTimestamp: number

gets the timestamp of this message, this does not requires the timestamp field

readonly
edited: number | undefined

whether this message was edited

readonly
editedAt: Date | undefined

gets the edited timestamp as a Date

optional
editedTimestamp: number

when this message was edited

embeds: DiscordEmbed[]

any embedded content

optional
flags: MessageFlags

message flags combined as a bitfield

optional
guildId: Snowflake

id of the guild the message was sent in, this should exist on MESSAGE_CREATE and MESSAGE_UPDATE events

readonly
id: Snowflake

id of the message

optional
interaction: MessageInteraction

sent if the message is a response to an Interaction

readonly
isBot: boolean

Compatibility with Discordeno same as Message.author.bot

optional
member: Member

member properties for this message's author

mentionEveryone: boolean

whether this message mentions everyone

mentions: { users: User[]; roleIds: Snowflake[]; channels: Channel[]; }

mentions if any

optional
nonce: string | number

used for validating a message was sent

pinned: boolean

whether this message is pinned

readonly
publish

alias of Message.crosspost

readonly
react

alias for Message.addReaction

reactions: MessageReaction[]

reactions to the message

readonly
sentAt: Date

gets the timestamp of this message (sent by the API)

readonly
session: Session

Reference to the client that instantiated this Message

optional
stickers: StickerItem[]

sent if the message contains stickers this contains sticker items not stickers

optional
thread: ThreadChannel

the thread that was started from this message, includes ThreadMember

timestamp: number

when this message was sent

tts: boolean

whether this was a TTS message

type of message

readonly
url: string

gets the url of the message that points to the message

optional
webhook: WebhookAuthor

if the message is generated by a webhook, this is the webhook's author data

Methods

addReaction(reaction: EmojiResolvable): Promise<void>

adds a Reaction

crosspost(): Promise<Message>

publishes/crossposts a message to all followers

delete(reason?: string): Promise<Message>

deletes this message

edit(options: EditMessage): Promise<Message>

Edits the current message

fetch(): Promise<(Message | undefined)>

fetches this message, meant to be used with Function.call since its redundant

fetchReactions(reaction: EmojiResolvable, options?: GetReactions): Promise<User[]>

Get users who reacted with this emoji not recommended since the cache handles reactions already

wheter the message comes from a guild *

wheter the messages comes from a Webhook

nukeReactions(): Promise<void>

nukes every reaction on the message

pin(): Promise<void>

Pins this message

removeReaction(reaction: EmojiResolvable, options?: { userId: Snowflake; }): Promise<void>

removes a reaction from someone

removeReactionEmoji(reaction: EmojiResolvable): Promise<void>

same as Message.removeReaction but removes using a unicode emoji

reply(options: CreateMessage): Promise<Message>

Replies directly in the channel where the message was sent

suppressEmbeds(suppress: true): Promise<Message>

edits the current message flags to supress its embeds

suppressEmbeds(suppress: false): Promise<Message | undefined>
unpin(): Promise<void>

Unpins this message