Class SimpleBot

  • All Implemented Interfaces:
    Bot

    public class SimpleBot
    extends Object
    implements Bot
    Basic implementation of a Discord bot, configured with default Discord4J settings.
    • Method Detail

      • config

        public BotConfig config()
        Description copied from interface: Bot
        Gets the config of the bot.
        Specified by:
        config in interface Bot
        Returns:
        the config
      • database

        public Database database()
        Description copied from interface: Bot
        Gets the database of the bot.
        Specified by:
        database in interface Bot
        Returns:
        the database
      • commandKernel

        public CommandKernel commandKernel()
        Description copied from interface: Bot
        Gets the command kernel of this bot.
        Specified by:
        commandKernel in interface Bot
        Returns:
        the command kernel
      • rest

        public discord4j.core.DiscordClient rest()
        Description copied from interface: Bot
        Gets the REST client of the bot.
        Specified by:
        rest in interface Bot
        Returns:
        the Discord client
      • gateway

        public discord4j.core.GatewayDiscordClient gateway()
        Description copied from interface: Bot
        Gets the gateway client of the bot.
        Specified by:
        gateway in interface Bot
        Returns:
        the gateway client
      • plugins

        public Set<Plugin> plugins()
        Description copied from interface: Bot
        Gets a Set containing all successfully loaded plugins.
        Specified by:
        plugins in interface Bot
        Returns:
        a Set of Plugin
      • owner

        public reactor.core.publisher.Mono<discord4j.core.object.entity.User> owner()
        Description copied from interface: Bot
        Gets the bot owner.
        Specified by:
        owner in interface Bot
        Returns:
        a Mono emitting the bot owner
      • log

        public reactor.core.publisher.Mono<Void> log​(String message)
        Description copied from interface: Bot
        Sends a message into the debug log channel.
        Specified by:
        log in interface Bot
        Parameters:
        message - the message to send
        Returns:
        a Mono completing when the log message is sent
      • emoji

        public reactor.core.publisher.Mono<String> emoji​(String emojiName)
        Description copied from interface: Bot
        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.
        Specified by:
        emoji in interface Bot
        Parameters:
        emojiName - the name of the emoji to look for
        Returns:
        a Mono emitting the emoji code corresponding to the given name
      • start

        public void start()
        Description copied from interface: Bot
        Starts the bot. This method blocks until the bot disconnects.
        Specified by:
        start in interface Bot