Interface Bot


  • public interface Bot
    Represents the bot itself.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      reactor.core.publisher.Mono<discord4j.core.object.entity.Channel> getAttachmentsChannel()
      Gets the channel where the bot can send attachments for its embeds.
      CommandKernel getCommandKernel()
      Gets the command kernel of this bot.
      Database getDatabase()
      Gets the database of the bot.
      reactor.core.publisher.Mono<discord4j.core.object.entity.Channel> getDebugLogChannel()
      Gets the channel where the bot sends messages for debugging purposes.
      String getDefaultPrefix()
      Gets the default prefix.
      reactor.core.publisher.Flux<discord4j.core.DiscordClient> getDiscordClients()
      Gets the Flux containing the discord client for each shard.
      reactor.core.publisher.Mono<String> getEmoji​(String emojiName)
      Gets the String representation of an emoji installed on one of the emoji servers.
      org.slf4j.Logger getLogger()
      Gets the logger.
      discord4j.core.DiscordClient getMainDiscordClient()
      Gets the discord client representing shard 0.
      Set<Plugin> getPlugins()
      Gets a Set containing all successfully loaded plugins.
      int getReplyMenuTimeout()
      Gets the maximum time in seconds that the bot should wait for a reply when a reply menu is open.
      String getToken()
      Get the bot token.
      reactor.core.publisher.Mono<discord4j.core.object.entity.Message> log​(String message)
      Sends a message into the debug log channel.
      reactor.core.publisher.Mono<discord4j.core.object.entity.Message> log​(java.util.function.Consumer<discord4j.core.spec.MessageCreateSpec> spec)
      Sends a message into the debug log channel.
      reactor.core.publisher.Mono<discord4j.core.object.entity.Message> logStackTrace​(Context ctx, Throwable t)
      Prints a Throwable's stack trace in the log channel.
    • Method Detail

      • getToken

        String getToken()
        Get the bot token.
        Returns:
        the token
      • getDefaultPrefix

        String getDefaultPrefix()
        Gets the default prefix.
        Returns:
        the default prefix
      • getMainDiscordClient

        discord4j.core.DiscordClient getMainDiscordClient()
        Gets the discord client representing shard 0.
        Returns:
        the discord client
      • getDiscordClients

        reactor.core.publisher.Flux<discord4j.core.DiscordClient> getDiscordClients()
        Gets the Flux containing the discord client for each shard.
        Returns:
        a Flux of discord client
      • getDatabase

        Database getDatabase()
        Gets the database of the bot.
        Returns:
        the database
      • getLogger

        org.slf4j.Logger getLogger()
        Gets the logger.
        Returns:
        the logger
      • getDebugLogChannel

        reactor.core.publisher.Mono<discord4j.core.object.entity.Channel> getDebugLogChannel()
        Gets the channel where the bot sends messages for debugging purposes.
        Returns:
        a Mono emitting the debug log channel
      • getAttachmentsChannel

        reactor.core.publisher.Mono<discord4j.core.object.entity.Channel> getAttachmentsChannel()
        Gets the channel where the bot can send attachments for its embeds.
        Returns:
        a Mono emitting the attachments channel
      • log

        reactor.core.publisher.Mono<discord4j.core.object.entity.Message> log​(String message)
        Sends a message into the debug log channel.
        Parameters:
        message - the message to send
        Returns:
        a Mono emitting the message sent
      • log

        reactor.core.publisher.Mono<discord4j.core.object.entity.Message> log​(java.util.function.Consumer<discord4j.core.spec.MessageCreateSpec> spec)
        Sends a message into the debug log channel.
        Parameters:
        spec - the spec of the message to send
        Returns:
        a Mono emitting the message sent
      • logStackTrace

        reactor.core.publisher.Mono<discord4j.core.object.entity.Message> logStackTrace​(Context ctx,
                                                                                        Throwable t)
        Prints a Throwable's stack trace in the log channel. The message may be splitted in case it doesn't fit in 2000 characters.
        Parameters:
        ctx - the context in which the error occured
        t - the throwable to print the strack trace of
        Returns:
        a Flux emitting all messages sent to logs (if splitted due to character limit), or only one message otherwise.
      • getEmoji

        reactor.core.publisher.Mono<String> getEmoji​(String emojiName)
        Gets the String representation of an emoji installed on one of the emoji servers. If the emoji is not found, the returned value is the given name wrapped in colons.
        Parameters:
        emojiName - the name of the emoji to look for
        Returns:
        a Mono emitting the emoji code corresponding to the given name
      • getReplyMenuTimeout

        int getReplyMenuTimeout()
        Gets the maximum time in seconds that the bot should wait for a reply when a reply menu is open.
        Returns:
        the value as int (in seconds)
      • getCommandKernel

        CommandKernel getCommandKernel()
        Gets the command kernel of this bot.
        Returns:
        the command kernel
      • getPlugins

        Set<Plugin> getPlugins()
        Gets a Set containing all successfully loaded plugins.
        Returns:
        a Set of Plugin