DiscordMessage

public struct DiscordMessage : DiscordClientHolder, ExpressibleByStringLiteral

Represents a Discord chat message.

  • ExpressibleByStringLiteral conformance

    Declaration

    Swift

    public typealias StringLiteralType = String
  • ExpressibleByStringLiteral conformance.

    Declaration

    Swift

    public typealias ExtendedGraphemeClusterLiteralType = String.ExtendedGraphemeClusterLiteralType
  • ExpressibleByStringLiteral conformance.

    Declaration

    Swift

    public typealias UnicodeScalarLiteralType = String.UnicodeScalarLiteralType
  • The activity for this message, if any.

    Declaration

    Swift

    public let activity: MessageActivity?
  • Sent with Rich-Presence messages.

    Declaration

    Swift

    public let application: MessageApplication?
  • The attachments included in this message.

    Declaration

    Swift

    public let attachments: [DiscordAttachment]
  • Who sent this message.

    Declaration

    Swift

    public let author: DiscordUser
  • The snowflake id of the channel this message is on.

    Declaration

    Swift

    public let channelId: ChannelID
  • A reference to the client.

    Declaration

    Swift

    public weak var client: DiscordClient?
  • The content of this message.

    Declaration

    Swift

    public let content: String
  • When this message was last edited.

    Declaration

    Swift

    public let editedTimestamp: Date
  • The embeds that are in this message.

    Declaration

    Swift

    public let embeds: [DiscordEmbed]
  • id

    The snowflake id of this message.

    Declaration

    Swift

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

    Declaration

    Swift

    public let mentionEveryone: Bool
  • List of snowflake ids of roles that were mentioned in this message.

    Declaration

    Swift

    public let mentionRoles: [RoleID]
  • List of users that were mentioned in this message.

    Declaration

    Swift

    public let mentions: [DiscordUser]
  • Used for validating a message was sent.

    Declaration

    Swift

    public let nonce: Snowflake
  • Whether this message is pinned.

    Declaration

    Swift

    public let pinned: Bool
  • The reactions a message has.

    Declaration

    Swift

    public let reactions: [DiscordReaction]
  • The timestamp of this message.

    Declaration

    Swift

    public let timestamp: Date
  • tts

    Whether or not this message should be read by a screen reader.

    Declaration

    Swift

    public let tts: Bool
  • The type of this message.

    Declaration

    Swift

    public let type: MessageType
  • The channel that this message originated from. Can return nil if the channel couldn’t be found.

    Declaration

    Swift

    public var channel: DiscordTextChannel?
  • Returns a DiscordGuildMember for this author, or nil if this message is not from a guild.

    Declaration

    Swift

    public var guildMember: DiscordGuildMember?
  • Deletes this message from Discord.

    Declaration

    Swift

    public func delete()