Search in sources :

Example 1 with WoWLinkPlugin

use of com.greatmancode.legendarybot.plugins.wowlink.WoWLinkPlugin in project legendarybot by greatman.

the class WowCommand method preFlight.

@Override
default String[] preFlight(MessageReceivedEvent event, LegendaryBot bot, String[] args) {
    String[] newArgs = args;
    if (args.length == 0) {
        WoWLinkPlugin plugin = ((WoWLinkPlugin) bot.getPluginManager().getPlugin("wowLink").getPlugin());
        String character = plugin.getMainCharacterForUserInGuild(event.getAuthor(), event.getGuild());
        if (character != null) {
            newArgs = new String[1];
            newArgs[0] = character;
        }
    }
    return newArgs;
}
Also used : WoWLinkPlugin(com.greatmancode.legendarybot.plugins.wowlink.WoWLinkPlugin)

Aggregations

WoWLinkPlugin (com.greatmancode.legendarybot.plugins.wowlink.WoWLinkPlugin)1