Interface TextChannel

    • Method Detail

      • getTopic

        java.lang.String getTopic()
        The topic set for this TextChannel.
        If no topic has been set, this returns null.
        Returns:
        Possibly-null String containing the topic of this TextChannel.
      • isNSFW

        boolean isNSFW()
        Whether or not this channel is considered as "NSFW" (Not-Safe-For-Work)
        This will check whether the name of this TextChannel begins with nsfw- or is equal to nsfw!
        Returns:
        True, If this TextChannel is considered NSFW by the official Discord Client
      • getSlowmode

        int getSlowmode()
        The slowmode set for this TextChannel.
        If slowmode is set this returns an int between 1 and 120. If not set this returns 0.

        Note that only CLIENT type accounts are affected by slowmode, and that BOT accounts are immune to the restrictions.
        Having MESSAGE_MANAGE or MANAGE_CHANNEL permission also grants immunity to slowmode.

        Returns:
        The slowmode for this TextChannel, between 1 and 120, or 0 if no slowmode is set.
      • getWebhooks

        @CheckReturnValue
        RestAction<java.util.List<Webhook>> getWebhooks()
        Retrieves the Webhooks attached to this TextChannel.

        Possible ErrorResponses include:

        Returns:
        RestAction - Type: List<Webhook>
        An immutable list of Webhook attached to this channel
      • createWebhook

        @CheckReturnValue
        WebhookAction createWebhook​(java.lang.String name)
        Creates a new Webhook.

        Possible ErrorResponses caused by the returned RestAction include the following:

        Parameters:
        name - The default name for the new Webhook.
        Returns:
        A specific WebhookAction
        This action allows to set fields for the new webhook before creating it
        Throws:
        PermissionException - If you do not hold the permission Manage Webhooks
        java.lang.IllegalArgumentException - If the provided name is null, blank or not between 2-100 characters in length
      • clearReactionsById

        @CheckReturnValue
        RestAction<java.lang.Void> clearReactionsById​(java.lang.String messageId)
        Attempts to remove all reactions from a message with the specified messageId in this TextChannel
        This is useful for moderator commands that wish to remove all reactions at once from a specific message.

        The following ErrorResponses are possible:

        Parameters:
        messageId - The not-empty valid message id
        Returns:
        AuditableRestAction
        Throws:
        InsufficientPermissionException - If the currently logged in account does not have Permission.MESSAGE_MANAGE in this channel.
        java.lang.IllegalArgumentException - If the provided id is null or empty.
      • removeReactionById

        @CheckReturnValue
        RestAction<java.lang.Void> removeReactionById​(java.lang.String messageId,
                                                      java.lang.String unicode,
                                                      User user)
        Attempts to remove the reaction from a message represented by the specified messageId in this MessageChannel.

        The unicode provided has to be a unicode representation of the emoji that is supposed to be represented by the Reaction.
        To retrieve the characters needed you can use an api or the official discord client by escaping the emoji (\:emoji-name:) and copying the resulting emoji from the sent message.

        This method encodes the provided unicode for you. Do not encode the emoji before providing the unicode.

        The following ErrorResponses are possible:

        Parameters:
        messageId - The messageId to remove the reaction from
        unicode - The unicode characters of the emoji
        user - The target user of which to remove from
        Returns:
        RestAction
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is null or empty.
        • If provided unicode is null or empty.
        InsufficientPermissionException - If the currently logged in account does not have Permission.MESSAGE_MANAGE in this channel.
      • removeReactionById

        @CheckReturnValue
        default RestAction<java.lang.Void> removeReactionById​(long messageId,
                                                              java.lang.String unicode,
                                                              User user)
        Attempts to remove the reaction from a message represented by the specified messageId in this MessageChannel.

        The unicode provided has to be a unicode representation of the emoji that is supposed to be represented by the Reaction.
        To retrieve the characters needed you can use an api or the official discord client by escaping the emoji (\:emoji-name:) and copying the resulting emoji from the sent message.

        This method encodes the provided unicode for you. Do not encode the emoji before providing the unicode.

        The following ErrorResponses are possible:

        Parameters:
        messageId - The messageId to remove the reaction from
        unicode - The unicode characters of the emoji
        user - The target user of which to remove from
        Returns:
        RestAction
        Throws:
        java.lang.IllegalArgumentException -
        • If provided messageId is null or empty.
        • If provided unicode is null or empty.
        InsufficientPermissionException - If the currently logged in account does not have Permission.MESSAGE_MANAGE in this channel.
      • canTalk

        boolean canTalk​(Member member)
        Whether the specified Member can send messages in this channel.
        Checks for both Permission.MESSAGE_READ and Permission.MESSAGE_WRITE.
        Parameters:
        member - The Member to check
        Returns:
        True, if the specified member is able to read and send messages in this channel
      • formatTo

        default void formatTo​(java.util.Formatter formatter,
                              int flags,
                              int width,
                              int precision)
        Specified by:
        formatTo in interface java.util.Formattable
        Specified by:
        formatTo in interface IMentionable
        Specified by:
        formatTo in interface MessageChannel