Message

public struct Message

Message Type

  • Array of Attachment structs that was sent with the message

    Declaration

    Swift

    public internal(set) var attachments = [Attachment]()
  • User struct of the author (not returned if webhook)

    Declaration

    Swift

    public let author: User?
  • Content of the message

    Declaration

    Swift

    public let content: String
  • Channel struct of the message

    Declaration

    Swift

    public let channel: TextChannel
  • If message was edited, this is the time it happened

    Declaration

    Swift

    public let editedTimestamp: Date?
  • Array of embeds sent with message

    Declaration

    Swift

    public internal(set) var embeds = [Embed]()
  • id

    Message ID

    Declaration

    Swift

    public let id: Snowflake
  • Whether or not this message mentioned everyone

    Declaration

    Swift

    public let isEveryoneMentioned: Bool
  • Whether or not this message is pinned in it’s channel

    Declaration

    Swift

    public let isPinned: Bool
  • Whether or not this messaged was ttsed

    Declaration

    Swift

    public let isTts: Bool
  • Member struct for message

    Declaration

    Swift

    public internal(set) var member: Member?
  • Array of Users that were mentioned

    Declaration

    Swift

    public internal(set) var mentions = [User]()
  • Array of Roles that were mentioned

    Declaration

    Swift

    public internal(set) var mentionedRoles = [Snowflake]()
  • Used to validate a message was sent

    Declaration

    Swift

    public let nonce: Snowflake?
  • Array of reactions with message

    Declaration

    Swift

    public internal(set) var reactions = [[String: Any]]()
  • Time when message was sent

    Declaration

    Swift

    public let timestamp: Date
  • Determines what type of message was sent

    Declaration

    Swift

    public let type: Type
  • If message was sent by webhook, this is that webhook’s ID

    Declaration

    Swift

    public let webhookId: Snowflake?
  • Depicts what kind of message was sent in chat

    See more

    Declaration

    Swift

    public enum `Type`: Int