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]
-
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
-
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?
-
Creates a message that can be used to send.
Declaration
Swift
public init(content: String, embed: DiscordEmbed? = nil, files: [DiscordFileUpload] = [], tts: Bool = false)
Parameters
content
The content of this message.
embeds
The embeds for this message.
files
The files to send with this message.
tts
Whether this message should be text-to-speach.
-
ExpressibleByStringLiteral conformance.
Declaration
Swift
public init(unicodeScalarLiteral value: UnicodeScalarLiteralType)
Parameters
unicodeScalarLiteral
The unicode scalar literal
-
ExpressibleByStringLiteral conformance.
Declaration
Swift
public init(extendedGraphemeClusterLiteral value: ExtendedGraphemeClusterLiteralType)
Parameters
extendedGraphemeClusterLiteral
The grapheme scalar literal
-
ExpressibleByStringLiteral conformance.
Declaration
Swift
public init(stringLiteral value: StringLiteralType)
Parameters
stringLiteral
The string literal
-
Type of message
See moreDeclaration
Swift
public enum MessageType : Int
-
Represents an action that be taken on a message.
See moreDeclaration
Swift
public struct MessageActivity
-
Represents an application in a
See moreDiscordMessage
object.Declaration
Swift
public struct MessageApplication