DiscordPartialMessage

data class DiscordPartialMessage(val id: Snowflake, val channelId: Snowflake, val guildId: OptionalSnowflake = OptionalSnowflake.Missing, val author: Optional<DiscordUser> = Optional.Missing(), val member: Optional<DiscordGuildMember> = Optional.Missing(), val content: Optional<String> = Optional.Missing(), val timestamp: Optional<Instant> = Optional.Missing(), val editedTimestamp: Optional<Instant?> = Optional.Missing(), val tts: OptionalBoolean = OptionalBoolean.Missing, val mentionEveryone: OptionalBoolean = OptionalBoolean.Missing, val mentions: Optional<List<DiscordOptionallyMemberUser>> = Optional.Missing(), val mentionRoles: Optional<List<Snowflake>> = Optional.Missing(), val mentionedChannels: Optional<List<DiscordMentionedChannel>> = Optional.Missing(), val attachments: Optional<List<DiscordAttachment>> = Optional.Missing(), val embeds: Optional<List<DiscordEmbed>> = Optional.Missing(), val reactions: Optional<List<Reaction>> = Optional.Missing(), val nonce: Optional<String> = Optional.Missing(), val pinned: OptionalBoolean = OptionalBoolean.Missing, val webhookId: OptionalSnowflake = OptionalSnowflake.Missing, val type: Optional<MessageType> = Optional.Missing(), val activity: Optional<MessageActivity> = Optional.Missing(), val application: Optional<MessageApplication> = Optional.Missing(), val messageReference: Optional<DiscordMessageReference> = Optional.Missing(), val flags: Optional<MessageFlags> = Optional.Missing(), val stickers: Optional<List<DiscordStickerItem>> = Optional.Missing(), val referencedMessage: Optional<DiscordMessage?> = Optional.Missing(), val interaction: Optional<DiscordMessageInteraction> = Optional.Missing(), val position: OptionalInt = OptionalInt.Missing)(source)

Represents a partial message sent in a channel within Discord.

Parameters

id

id of the message.

channelId

id of the channel the message was sent in.

guildId

id of the guild the message was sent in.

author

The author of this message.

The author is only a valid user in the case where the message is generated by a user or bot user.

If the message is generated by a webhook, the author object corresponds to the webhook's DiscordWebhook.id, DiscordWebhook.name, and DiscordWebhook.avatar. You can tell if a message is generated by a webhook by checking for the webhookId on the message object.

member

Member properties for this message's author.

It only exists in MESSAGE_CREATE and MESSAGE_UPDATE events from text-based guild channels.

content

Contents of the message.

editedTimestamp

When this message was edited, null if never.

tts

Whether this was a text-to-speech message.

mentionEveryone

Whether this message mentions everyone.

mentions

Users specifically mentioned in the message.

mentionRoles

Roles specifically mentioned in this message.

mentionedChannels

Channels specifically mentioned in this message.

Not all channel mentions in a message will appear in mentionedChannels:

  • Only textual channels that are visible to everyone in a lurkable guild will ever be included.

  • Only crossposted messages (via Channel Following) currently include mentionedChannels at all.

If no mentions in the message meet these requirements, this field will not be sent.

attachments

Any attached files.

embeds

Any embedded content.

reactions

reactions to the message.

nonce

Used for validating a message was sent.

pinned

Whether this message is pinned.

webhookId

If the message is generated by a webhook, this is the webhook's id.

type

Type of message.

activity

Sent with Rich Presence-related chat embeds.

application

Sent with Rich Presence-related chat embeds.

messageReference

Reference data sent with crossposted messages and replies.

flags

Message flags.

stickers

The stickers sent with the message (bots currently can only receive messages with stickers, not send).

referencedMessage

the message associated with messageReference.

Constructors

Link copied to clipboard
constructor(id: Snowflake, channelId: Snowflake, guildId: OptionalSnowflake = OptionalSnowflake.Missing, author: Optional<DiscordUser> = Optional.Missing(), member: Optional<DiscordGuildMember> = Optional.Missing(), content: Optional<String> = Optional.Missing(), timestamp: Optional<Instant> = Optional.Missing(), editedTimestamp: Optional<Instant?> = Optional.Missing(), tts: OptionalBoolean = OptionalBoolean.Missing, mentionEveryone: OptionalBoolean = OptionalBoolean.Missing, mentions: Optional<List<DiscordOptionallyMemberUser>> = Optional.Missing(), mentionRoles: Optional<List<Snowflake>> = Optional.Missing(), mentionedChannels: Optional<List<DiscordMentionedChannel>> = Optional.Missing(), attachments: Optional<List<DiscordAttachment>> = Optional.Missing(), embeds: Optional<List<DiscordEmbed>> = Optional.Missing(), reactions: Optional<List<Reaction>> = Optional.Missing(), nonce: Optional<String> = Optional.Missing(), pinned: OptionalBoolean = OptionalBoolean.Missing, webhookId: OptionalSnowflake = OptionalSnowflake.Missing, type: Optional<MessageType> = Optional.Missing(), activity: Optional<MessageActivity> = Optional.Missing(), application: Optional<MessageApplication> = Optional.Missing(), messageReference: Optional<DiscordMessageReference> = Optional.Missing(), flags: Optional<MessageFlags> = Optional.Missing(), stickers: Optional<List<DiscordStickerItem>> = Optional.Missing(), referencedMessage: Optional<DiscordMessage?> = Optional.Missing(), interaction: Optional<DiscordMessageInteraction> = Optional.Missing(), position: OptionalInt = OptionalInt.Missing)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "channel_id")
val channelId: Snowflake
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "edited_timestamp")
val editedTimestamp: Optional<Instant?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "guild_id")
val guildId: OptionalSnowflake
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "mention_everyone")
val mentionEveryone: OptionalBoolean
Link copied to clipboard
@SerialName(value = "mention_roles")
val mentionRoles: Optional<List<Snowflake>>
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "message_reference")
val messageReference: Optional<DiscordMessageReference>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "referenced_message")
val referencedMessage: Optional<DiscordMessage?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "webhook_id")
val webhookId: OptionalSnowflake