libduvet/model/message

Types

What a new message says about the mentions it makes beyond the users its text names (allowed_mentions).

pub type AllowedMentions {
  AllowedMentions(replied_user: Bool)
}

Constructors

  • AllowedMentions(replied_user: Bool)

    Whether a reply mentions the author of the message it replies to. A reply sent without allowed mentions does; false sends it without notifying them.

pub type GatewayMessage {
  GatewayMessage(
    id: String,
    room_id: String,
    author_id: option.Option(String),
    webhook_id: option.Option(String),
    content: option.Option(String),
    type_: message_type.MessageType,
    created_at: timestamp.Timestamp,
    updated_at: timestamp.Timestamp,
    deleted_at: option.Option(timestamp.Timestamp),
    nonce: option.Option(String),
    user: option.Option(user.GatewayUser),
    member_alias: option.Option(String),
    referenced_message: option.Option(ReferencedMessage),
    ref_message_id: option.Option(String),
    embeds: option.Option(List(embed.Embed)),
    attachments: option.Option(List(attachment.Attachment)),
    reactions: option.Option(List(MessageReaction)),
    sticker_attachment_id: option.Option(String),
    pinned_at: option.Option(timestamp.Timestamp),
    flags: Int,
    components: option.Option(
      List(dict.Dict(String, dynamic.Dynamic)),
    ),
    interaction_metadata: option.Option(InteractionMetadata),
  )
}

Constructors

What a message a bot sends for an interaction says about it.

pub type InteractionMetadata {
  InteractionMetadata(
    id: String,
    type_: Int,
    user: user.InteractionUser,
    interacted_message_id: option.Option(String),
    original_response_message_id: option.Option(String),
    name: option.Option(String),
  )
}

Constructors

  • InteractionMetadata(
      id: String,
      type_: Int,
      user: user.InteractionUser,
      interacted_message_id: option.Option(String),
      original_response_message_id: option.Option(String),
      name: option.Option(String),
    )

    Arguments

    type_

    2 for a command, 3 for a component.

    user

    Who used it, as they were when the message was made.

    interacted_message_id

    The message whose component was used, for a component’s interaction.

    original_response_message_id

    The interaction’s first response, on its follow-ups.

    name

    The command’s name, for a command’s interaction.

pub type Message {
  Message(
    id: String,
    content: String,
    type_: message_type.MessageType,
    author_id: String,
    author_name: String,
    author_avatar_url: option.Option(String),
    created_at: timestamp.Timestamp,
    updated_at: timestamp.Timestamp,
    nonce: option.Option(String),
    referenced_message: option.Option(ReferencedMessage),
    ref_message_id: option.Option(String),
    embeds: option.Option(List(embed.Embed)),
    attachments: option.Option(List(attachment.Attachment)),
    reactions: option.Option(List(MessageReaction)),
    sticker_attachment_id: option.Option(String),
  )
}

Constructors

pub type MessageReaction {
  MessageReaction(
    emoji_name: String,
    emoji_id: option.Option(String),
    count: Int,
    users: List(String),
  )
}

Constructors

  • MessageReaction(
      emoji_name: String,
      emoji_id: option.Option(String),
      count: Int,
      users: List(String),
    )
pub type MessageReference {
  MessageReference(
    type_: option.Option(
      message_reference_type.MessageReferenceType,
    ),
    message_id: option.Option(String),
    room_id: option.Option(String),
    space_id: option.Option(String),
    fail_if_not_exists: option.Option(Bool),
  )
}

Constructors

pub type ReferencedMessage {
  ReferencedMessage(
    type_: option.Option(Int),
    message_id: option.Option(String),
    room_id: option.Option(String),
    space_id: option.Option(String),
    content: option.Option(String),
    author_id: option.Option(String),
    author_name: option.Option(String),
    author_avatar: option.Option(String),
    created_at: option.Option(timestamp.Timestamp),
    mention_author: Bool,
  )
}

Constructors

Values

pub fn allowed_mentions_to_json(
  mentions: AllowedMentions,
) -> json.Json
pub fn from_json(
  object: dict.Dict(String, dynamic.Dynamic),
) -> GatewayMessage
pub fn interaction_metadata_from_json(
  object: dict.Dict(String, dynamic.Dynamic),
) -> InteractionMetadata
pub fn message_from_json(
  object: dict.Dict(String, dynamic.Dynamic),
) -> Message
pub fn message_reaction_from_json(
  object: dict.Dict(String, dynamic.Dynamic),
) -> MessageReaction
pub fn message_reference_from_json(
  object: dict.Dict(String, dynamic.Dynamic),
) -> MessageReference
pub fn message_reference_from_message(
  message: GatewayMessage,
) -> MessageReference
pub fn message_reference_to_json(
  reference: MessageReference,
) -> json.Json
pub fn referenced_message_from_json(
  object: dict.Dict(String, dynamic.Dynamic),
) -> ReferencedMessage
✨ Search Document