Search in sources :

Example 1 with InfoCommand

use of com.greatmancode.legendarybot.plugin.botgeneral.commands.InfoCommand in project legendarybot by greatman.

the class BotGeneralPlugin method start.

@Override
public void start() {
    getBot().getCommandHandler().addCommand("invite", new InviteCommand(getBot()), "General Commands");
    log.info("Command !invite loaded!");
    getBot().getCommandHandler().addCommand("help", new HelpCommand(getBot()), "General Commands");
    log.info("Command !help loaded!");
    getBot().getCommandHandler().addCommand("info", new InfoCommand(getBot()), "General Commands");
    // We find our main guild
    Guild guild = null;
    for (JDA jda : getBot().getJDA()) {
        Guild guildEntry = jda.getGuildById("330748360673722381");
        if (guildEntry != null) {
            guild = guildEntry;
        }
    }
    listener = new MessageListener(guild);
    getBot().getJDA().forEach(jda -> jda.addEventListener(listener));
}
Also used : InviteCommand(com.greatmancode.legendarybot.plugin.botgeneral.commands.InviteCommand) HelpCommand(com.greatmancode.legendarybot.plugin.botgeneral.commands.HelpCommand) JDA(net.dv8tion.jda.core.JDA) InfoCommand(com.greatmancode.legendarybot.plugin.botgeneral.commands.InfoCommand) Guild(net.dv8tion.jda.core.entities.Guild)

Aggregations

HelpCommand (com.greatmancode.legendarybot.plugin.botgeneral.commands.HelpCommand)1 InfoCommand (com.greatmancode.legendarybot.plugin.botgeneral.commands.InfoCommand)1 InviteCommand (com.greatmancode.legendarybot.plugin.botgeneral.commands.InviteCommand)1 JDA (net.dv8tion.jda.core.JDA)1 Guild (net.dv8tion.jda.core.entities.Guild)1