Skip to main content

messages

caution

All props/parameters are optional unless they are marked with an asterisk ( * ).

Functions

NameParametersReturn TypeDescription
clearChannel* channelId: stringvoidClears all messages in a channel. This will only apply locally and the messages will be re-fetched.
createBotMessage* options: CreateBotMessageOptionsMessageCreates a bot message without sending it
createMessage* options: CreateMessageOptionsMessageCreates a message without sending it
createNoncestringGenerate a new snowflake id
crosspostMessage* channelId: string
* messageId: string
Promise<HTTPResponse | void>Makes a message public in an announcement channel
deleteMessage* channelId: string
* messageId: string
keepThreadArchived: boolean
Promise<void>Deletes a message from a channel
dismissAutomatedMessage* message: MessagevoidDismisses an ephemeral message
editMessage* channelId: string
* messageId: string
* message: { content: string }
Promise<void>Edits a message
endEditMessage* channelId: string
response: HTTPResponse
voidDispatches an edited message
fetchLocalMessages* channelId: string
* before: boolean
* after: boolean
* limit: number
* localFetchComplete: LocalFetchComplete
Promise<void>Fetches local messages
fetchMessages* options: FetchMessagesOptionsPromise<boolean>Fetches messages
fetchNewLocalMessages* channelId: string
* limit: number
Promise<void>Fetches local messages (new version)
focusMessage* options: FocusMessageOptionsvoidFetches with a focused message
getMessage* channelId: string
* messageId: string
MessageGets the message by its id
getMessages* channelId: stringMessagesDataGets all messages in a channel, with a system to manage data
getSendMessageOptionsForReply* options: SendMessageForReplyOptionsSendMessageOptionsForReply | {}Gets options for a reply
jumpToMessage* options: MessageJumpOptionsPromise<boolean>Jumps to a message
jumpToPresent* channelId: string
* limit: number
voidJumps to the most recent message
patchMessageAttachments* channelId: string
* messageId: string
* attachments: MessageAttachment[]
Promise<void>Changes the attachments of a message
receiveMessage* channelId: string
* message: Message
optimistic: boolean
options: OutgoingMessageOptions
voidReveals a message
sendActivityBookmark* channelId: string
* activityDetails: string
analyticsTriggeredFrom: string
suggestedInvite: InviteSuggestion
Promise<HTTPResponse | void>Sends an activity bookmark
sendBotMessage* channelId: string
* content: string
messageName: string
voidClyde sends a custom message
sendClydeError* channelId: string
code: number
voidClyde sends an error message
sendClydeProfileOverride* channelId: string
* clydeProfileURL: string
analyticsTriggeredFrom: string
suggestedInvite: InviteSuggestion
Promise<HTTPResponse | void>Sends a Clyde profile override
sendGreetMessage* channelId: string
* stickerId: string
options: MessageGreetOptions
Promise<HTTPResponse | void>Sends a greet message
sendInvite* channelId: string
* inviteCode: string
analyticsTriggeredFrom: string
suggestedInvite: InviteSuggestion
Promise<HTTPResponse | void>Sends an invite
sendMessage* channelId: string
* message: OutgoingMessage
promise: boolean
options: OutgoingMessageOptions
Promise<HTTPResponse | void>Sends a message
sendStickers* channelId: string
* stickersIds: string[]
content: string
options: SendMessageOptionsForReply | {}
tts: boolean
Promise<HTTPResponse | void>Sends a sticker
startEditMessage* channelId: string
* messageId: string
* content: string
voidStarts editing a message
suppressEmbeds* channelId: string
* messageId: string
Promise<void>Deletes an embed from a message
trackInvite* options: TrackInviteOptionsvoidTracks an invite for analytics
trackJump* channelId: string
* messageId: string
* context: string
extraProperties: Record<string, unknown>
voidTracks a jump for analytics
truncateMessages* channelId: string
* truncateBottom: boolean
* truncateTop: boolean
voidTruncates a message list
updateEditMessage* channelId: string
* textValue: string
* richValue: unknown
voidUpdates an edit message
userRecordToServer* user: UserUserServerConverts an user record into a simplified version for the server

Types

AllowedMentions

NameTypeDescription
parsestring[]Array of allowed mention types to parse from the content
replied_userbooleanWhether to mention the author of the message being replied to

CreateBotMessageOptions

NameTypeDefaultDescription
channelId* stringId of the channel where the message belongs to
content* stringContent of the message
embedsEmbed[]Array of embedded content
loggingNamestringMessage name for analytics

CreateMessageOptions

NameTypeDefaultDescription
allowedMentionsAllowedMentionsAllowed mentions for the message
author* UserAuthor of the message
channelId* stringId of the channel where the message belongs to
content* stringContent of the message
flagsnumberMessage flags
messageReferenceMessageReferenceContains information for a reply
noncestringId of the message
ttsbooleanfalseWhether the message is a TTS message
typenumber0Type of message

FocusMessageOptions

NameTypeDefaultDescription
channelIdstringId of the channel where the focused message is present
messageIdstringId of the focused message

InviteSuggestion

NameTypeDescription
isAffinitySuggestion* booleanWhether is a real suggestion, not filtered from searching
isFiltered* booleanWhether the suggestion list is filtered
numAffinityConnections* numberHow many real suggestions are available
numTotal* numberHow many suggestions are available
rowNum* numberSuggestion position

MessageGreetOptions

NameTypeDefaultDescription
allowedMentionsAllowedMentionsAllowed mentions for the greet message
messageReferenceMessageReferenceContains information for a reply

MessageReference

NameTypeDescription
channel_idstringId of the originating message's channel
guild_idstringId of the originating message's guild
message_idstringId of the originating message

OutgoingMessage

NameTypeDefaultDescription
content* stringContent of the message
invalidEmojisEmoji[]Array with invalid emoji
ttsbooleanfalseWhether the mention toggle should be visible
validNonShortcutEmojis* Emoji[]Array with valid emojis

OutgoingMessageOptions

NameTypeDefaultDescription
activityActionnumberActivity action type
allowedMentionsAllowedMentionsAllowed mentions for the message
locationstringLocation of the invite
messageReferenceMessageReferenceContains information for a reply
stickerIdsstring[]Array with sticker ids
suggestedInviteInviteSuggestionObject that includes information on a invite suggestion

SendMessageForReplyOptions

NameTypeDefaultDescription
channel* ChannelChannel object where to reply
message* MessageMessage object to reply to
shouldMention* booleanWhether to mention the author of the message being replied to
showMentionToggle* booleanWhether the mention toggle should be visible

SendMessageOptionsForReply

NameTypeDescription
allowedMentionsAllowedMentionsAllowed mentions for the message
messageReferenceMessageReferenceContains information for a reply

TrackInviteOptions

NameTypeDefaultDescription
channelId* stringId of the channel where the invite is present
inviteKey* stringInvite code
location* stringLocation of the invite
messageId* stringId of the message where the invite is present
overridePropertiesRecord<string, unknown>Object that includes information to override for the tracker
suggestedInviteSuggestionObject that includes information on a invite suggestion