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 method

    Pins a message to this channel.

    Declaration

    Swift

    public func pinMessage(_ message: DiscordMessage)

    Parameters

    message

    The message to pin

  • deleteMessage(_:) Extension method

    Deletes a message from this channel.

    Declaration

    Swift

    public func deleteMessage(_ message: DiscordMessage)

    Parameters

    message

    The message to delete

  • getPinnedMessages(callback:) Extension method

    Gets the pinned messages for this channel.

    Declaration

    Swift

    public func getPinnedMessages(callback: @escaping ([DiscordMessage], HTTPURLResponse?) -> ())

    Parameters

    callback

    The callback.

  • send(_:) Extension method

    Sends 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 method

    Sends that this user is typing on this channel.

    Declaration

    Swift

    public func triggerTyping()
  • unpinMessage(_:) Extension method

    Unpins a message from this channel.

    Declaration

    Swift

    public func unpinMessage(_ message: DiscordMessage)

    Parameters

    message

    The message to unpin.