TextChannel
public protocol TextChannel: Channel
Used to distinguish channels that are pure text base and voice channels
-
The last message’s id
Declaration
Swift
var lastMessageId: Snowflake?
-
addReaction(_:to:then:)
Extension methodAdds a reaction (unicode or custom emoji) to message
Declaration
Swift
func addReaction( _ reaction: String, to messageId: Snowflake, then completion: ((RequestError?) -> ())? = nil )
-
deleteMessage(_:then:)
Extension methodDeletes a message from this channel
Declaration
Swift
func deleteMessage( _ messageId: Snowflake, then completion: ((RequestError?) -> ())? = nil )
-
deleteMessages(_:then:)
Extension methodBulk deletes messages
Declaration
Swift
func deleteMessages( _ messages: [Snowflake], then completion: ((RequestError?) -> ())? = nil )
-
deleteReaction(_:from:by:then:)
Extension methodDeletes a reaction from message by user
Declaration
Swift
func deleteReaction( _ reaction: String, from messageId: Snowflake, by userId: Snowflake? = nil, then completion: ((RequestError?) -> ())? = nil )
-
editMessage(_:with:then:)
Extension methodEdits a message’s content
Declaration
Swift
func editMessage( _ messageId: Snowflake, with options: [String: Any], then completion: ((Message?, RequestError?) -> ())? = nil )
-
getMessage(_:then:)
Extension methodGets a message from this channel
Declaration
Swift
func getMessage( _ messageId: Snowflake, then completion: @escaping (Message?, RequestError?) -> () )
-
getMessages(with:then:)
Extension methodGets an array of messages from this channel
Option Params
- around: Message Id to get messages around
- before: Message Id to get messages before this one
- after: Message Id to get messages after this one
limit: Number of how many messages you want to get (1-100)
Declaration
Swift
func getMessages( with options: [String: Any]? = nil, then completion: @escaping ([Message]?, RequestError?) -> () )
-
getReaction(_:from:then:)
Extension methodGets an array of users who used reaction from message
Declaration
Swift
func getReaction( _ reaction: String, from messageId: Snowflake, then completion: @escaping ([User]?, RequestError?) -> () )
-
getPinnedMessages(then:)
Extension methodGet Pinned messages for this channel
Declaration
Swift
func getPinnedMessages( then completion: @escaping ([Message]?, RequestError?) -> () )
-
pin(_:then:)
Extension methodPins a message to this channel
Declaration
Swift
func pin( _ messageId: Snowflake, then completion: ((RequestError?) -> ())? = nil )
-
send(_:then:)
Extension methodSends a message to channel
Declaration
Swift
func send( _ message: String, then completion: ((Message?, RequestError?) -> ())? = nil )
-
send(_:then:)
Extension methodSends a message to channel
Declaration
Swift
func send( _ message: [String: Any], then completion: ((Message?, RequestError?) -> ())? = nil )
-
send(_:then:)
Extension methodSends a message to channel
Declaration
Swift
func send( _ message: Embed, then completion: ((Message?, RequestError?) -> ())? = nil )
-
unpin(_:then:)
Extension methodUnpins a pinned message from this channel
Declaration
Swift
func unpin( _ messageId: Snowflake, then completion: ((RequestError?) -> ())? = nil )