Search in sources :

Example 6 with Wiimmfi

use of com.gamebuster19901.excite.Wiimmfi in project ExciteBot by TheGameCommunity.

the class OnlineCommand method sendResponse.

public static int sendResponse(MessageContext context, CommandContext<MessageContext> cmdContext) {
    Wiimmfi wiimmfi = Main.discordBot.getWiimmfi();
    String response;
    if (wiimmfi.getError() == null) {
        response = "Players Online " + Wiimmfi.getOnlinePlayerList(cmdContext.getInput().equals("online"));
    } else {
        response = "Bot offline due to an error: \n\n" + StacktraceUtil.getStackTrace(wiimmfi.getError());
    }
    context.sendMessage(response);
    return 1;
}
Also used : Wiimmfi(com.gamebuster19901.excite.Wiimmfi)

Aggregations

Wiimmfi (com.gamebuster19901.excite.Wiimmfi)2 DiscordUser (com.gamebuster19901.excite.bot.user.DiscordUser)2 WiimmfiResponseException (com.gamebuster19901.excite.exception.WiimmfiResponseException)2 File (java.io.File)2 IOException (java.io.IOException)2 SQLException (java.sql.SQLException)2 Instant (java.time.Instant)2 HashSet (java.util.HashSet)2 Player (com.gamebuster19901.excite.Player)1 DiscordBot (com.gamebuster19901.excite.bot.DiscordBot)1 MessageContext (com.gamebuster19901.excite.bot.command.MessageContext)1 DatabaseConnection (com.gamebuster19901.excite.bot.database.sql.DatabaseConnection)1 ConsoleUser (com.gamebuster19901.excite.bot.user.ConsoleUser)1 UnknownDiscordUser (com.gamebuster19901.excite.bot.user.UnknownDiscordUser)1 Wii (com.gamebuster19901.excite.bot.user.Wii)1 WiimmfiErrorResponse (com.gamebuster19901.excite.exception.WiimmfiErrorResponse)1 Named (com.gamebuster19901.excite.util.Named)1 JsonArray (com.google.gson.JsonArray)1 JsonElement (com.google.gson.JsonElement)1 CJCommunicationsException (com.mysql.cj.exceptions.CJCommunicationsException)1