messages
caution
All props/parameters are optional unless they are marked with an asterisk ( * ).
Functions
| Name | Parameters | Return Type | Description |
|---|---|---|---|
clearChannel | * channelId: string | void | Clears all messages in a channel. This will only apply locally and the messages will be re-fetched. |
createBotMessage | * options: CreateBotMessageOptions | Message | Creates a bot message without sending it |
createMessage | * options: CreateMessageOptions | Message | Creates a message without sending it |
createNonce | string | Generate 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: Message | void | Dismisses an ephemeral message |
editMessage | * channelId: string * messageId: string * message: { content: string } | Promise<void> | Edits a message |
endEditMessage | * channelId: string response: HTTPResponse | void | Dispatches an edited message |
fetchLocalMessages | * channelId: string * before: boolean * after: boolean * limit: number * localFetchComplete: LocalFetchComplete | Promise<void> | Fetches local messages |
fetchMessages | * options: FetchMessagesOptions | Promise<boolean> | Fetches messages |
fetchNewLocalMessages | * channelId: string * limit: number | Promise<void> | Fetches local messages (new version) |
focusMessage | * options: FocusMessageOptions | void | Fetches with a focused message |
getMessage | * channelId: string * messageId: string | Message | Gets the message by its id |
getMessages | * channelId: string | MessagesData | Gets all messages in a channel, with a system to manage data |
getSendMessageOptionsForReply | * options: SendMessageForReplyOptions | SendMessageOptionsForReply | {} | Gets options for a reply |
jumpToMessage | * options: MessageJumpOptions | Promise<boolean> | Jumps to a message |
jumpToPresent | * channelId: string * limit: number | void | Jumps 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 | void | Reveals 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 | void | Clyde sends a custom message |
sendClydeError | * channelId: string code: number | void | Clyde 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 | void | Starts editing a message |
suppressEmbeds | * channelId: string * messageId: string | Promise<void> | Deletes an embed from a message |
trackInvite | * options: TrackInviteOptions | void | Tracks an invite for analytics |
trackJump | * channelId: string * messageId: string * context: string extraProperties: Record<string, unknown> | void | Tracks a jump for analytics |
truncateMessages | * channelId: string * truncateBottom: boolean * truncateTop: boolean | void | Truncates a message list |
updateEditMessage | * channelId: string * textValue: string * richValue: unknown | void | Updates an edit message |
userRecordToServer | * user: User | UserServer | Converts an user record into a simplified version for the server |
Types
AllowedMentions
| Name | Type | Description |
|---|---|---|
parse | string[] | Array of allowed mention types to parse from the content |
replied_user | boolean | Whether to mention the author of the message being replied to |
CreateBotMessageOptions
| Name | Type | Default | Description |
|---|---|---|---|
channelId | * string | Id of the channel where the message belongs to | |
content | * string | Content of the message | |
embeds | Embed[] | Array of embedded content | |
loggingName | string | Message name for analytics |
CreateMessageOptions
| Name | Type | Default | Description |
|---|---|---|---|
allowedMentions | AllowedMentions | Allowed mentions for the message | |
author | * User | Author of the message | |
channelId | * string | Id of the channel where the message belongs to | |
content | * string | Content of the message | |
flags | number | Message flags | |
messageReference | MessageReference | Contains information for a reply | |
nonce | string | Id of the message | |
tts | boolean | false | Whether the message is a TTS message |
type | number | 0 | Type of message |
FocusMessageOptions
| Name | Type | Default | Description |
|---|---|---|---|
channelId | string | Id of the channel where the focused message is present | |
messageId | string | Id of the focused message |
InviteSuggestion
| Name | Type | Description |
|---|---|---|
isAffinitySuggestion | * boolean | Whether is a real suggestion, not filtered from searching |
isFiltered | * boolean | Whether the suggestion list is filtered |
numAffinityConnections | * number | How many real suggestions are available |
numTotal | * number | How many suggestions are available |
rowNum | * number | Suggestion position |
MessageGreetOptions
| Name | Type | Default | Description |
|---|---|---|---|
allowedMentions | AllowedMentions | Allowed mentions for the greet message | |
messageReference | MessageReference | Contains information for a reply |
MessageReference
| Name | Type | Description |
|---|---|---|
channel_id | string | Id of the originating message's channel |
guild_id | string | Id of the originating message's guild |
message_id | string | Id of the originating message |
OutgoingMessage
| Name | Type | Default | Description |
|---|---|---|---|
content | * string | Content of the message | |
invalidEmojis | Emoji[] | Array with invalid emoji | |
tts | boolean | false | Whether the mention toggle should be visible |
validNonShortcutEmojis | * Emoji[] | Array with valid emojis |
OutgoingMessageOptions
| Name | Type | Default | Description |
|---|---|---|---|
activityAction | number | Activity action type | |
allowedMentions | AllowedMentions | Allowed mentions for the message | |
location | string | Location of the invite | |
messageReference | MessageReference | Contains information for a reply | |
stickerIds | string[] | Array with sticker ids | |
suggestedInvite | InviteSuggestion | Object that includes information on a invite suggestion |
SendMessageForReplyOptions
| Name | Type | Default | Description |
|---|---|---|---|
channel | * Channel | Channel object where to reply | |
message | * Message | Message object to reply to | |
shouldMention | * boolean | Whether to mention the author of the message being replied to | |
showMentionToggle | * boolean | Whether the mention toggle should be visible |
SendMessageOptionsForReply
| Name | Type | Description |
|---|---|---|
allowedMentions | AllowedMentions | Allowed mentions for the message |
messageReference | MessageReference | Contains information for a reply |
TrackInviteOptions
| Name | Type | Default | Description |
|---|---|---|---|
channelId | * string | Id of the channel where the invite is present | |
inviteKey | * string | Invite code | |
location | * string | Location of the invite | |
messageId | * string | Id of the message where the invite is present | |
overrideProperties | Record<string, unknown> | Object that includes information to override for the tracker | |
suggested | InviteSuggestion | Object that includes information on a invite suggestion |