DiscordTextChannel
public protocol DiscordTextChannel : DiscordChannel
Protocol that declares a type will be a Discord text-based channel.
-
The snowflake id of the last received message on this channel.
Declaration
Swift
var lastMessageId: MessageID
-
pinMessage(_:)
Extension methodPins a message to this channel.
Declaration
Swift
public func pinMessage(_ message: DiscordMessage)
Parameters
message
The message to pin
-
deleteMessage(_:)
Extension methodDeletes a message from this channel.
Declaration
Swift
public func deleteMessage(_ message: DiscordMessage)
Parameters
message
The message to delete
-
getPinnedMessages(callback:)
Extension methodGets the pinned messages for this channel.
Declaration
Swift
public func getPinnedMessages(callback: @escaping ([DiscordMessage], HTTPURLResponse?) -> ())
Parameters
callback
The callback.
-
send(_:)
Extension methodSends a message to this channel. Can be used to send embeds and files as well.
channel.send("This is just a simple message")
Sending a message with an embed:
channel.send(DiscordMessage(content: "This message also comes with an embed", embeds: [embed]))
Sending a fully loaded message:
channel.send(DiscordMessage(content: "This message has it all", embeds: [embed], files: [file]))
Declaration
Swift
public func send(_ message: DiscordMessage)
Parameters
message
The message to send.
-
triggerTyping()
Extension methodSends that this user is typing on this channel.
Declaration
Swift
public func triggerTyping()
-
unpinMessage(_:)
Extension methodUnpins a message from this channel.
Declaration
Swift
public func unpinMessage(_ message: DiscordMessage)
Parameters
message
The message to unpin.