diff --git a/src/main/java/com/bbn/hadder/Hadder.java b/src/main/java/com/bbn/hadder/Hadder.java index 063d826..b4a6cbb 100644 --- a/src/main/java/com/bbn/hadder/Hadder.java +++ b/src/main/java/com/bbn/hadder/Hadder.java @@ -103,8 +103,7 @@ public class Hadder { new StopCommand(), new BlacklistCommand(), new PauseCommand(), - new LoopCommand(), - new WakaTimeCommand()), config, helpCommand); + new LoopCommand()), config, helpCommand); builder.addEventListeners( new MentionListener(rethink), diff --git a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java deleted file mode 100644 index c1ad8d9..0000000 --- a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.bbn.hadder.commands.misc; - -import com.bbn.hadder.commands.Command; -import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.IOException; - -/** - * @author Skidder / GregTCLTK - */ - -public class WakaTimeCommand implements Command { - - @Override - public void executed(String[] args, CommandEvent event) { - if (args.length == 1) { - Request request = new Request.Builder().url("https://wakatime.com/api/v1/users/" + args[0]).addHeader("Authorization", "Basic " + event.getConfig().getWakaTimeToken()).build(); - - try { - Response response = new OkHttpClient().newCall(request).execute(); - JSONObject json = new JSONObject(response.body().string()); - event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, - "", - "").build()).queue(); - } catch (JSONException e) { - event.getTextChannel().sendMessage(event.getMessageEditor().getMessage( - MessageEditor.MessageType.ERROR, - "commands.misc.wakatime.user.error.title", - "commands.misc.wakatime.user.error.description").build()).queue(); - } catch (IOException | NullPointerException e) { - event.getTextChannel().sendMessage( - event.getMessageEditor().getMessage( - MessageEditor.MessageType.ERROR, - "commands.misc.wakatime.api.error.title", - "commands.misc.wakatime.api.error.description") - .build() - ).queue(); - } - } else { - event.getHelpCommand().sendHelp(this, event); - } - } - - @Override - public String[] labels() { - return new String[]{"wakatime", "wk"}; - } - - @Override - public String description() { - return "commands.misc.wakatime.help.description"; - } - - @Override - public String usage() { - return "[WakaTime-User]"; - } - - @Override - public String example() { - return "@Skidder"; - } -} diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index a3f02b3..9167e2d 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -73,11 +73,6 @@ commands.misc.screenshare.number.error.description = This isn't a Number. commands.misc.screenshare.channel.existing.error = Hol' up commands.misc.screenshare.channel.existing.description = There is no Voice Channel named like this. \n\nNote\: Make sure the Voice Channel is in this Guild. commands.misc.screenshare.help.description = Shows you the link to share your screen. -commands.misc.wakatime.api.error.title = API error -commands.misc.wakatime.api.error.description = The WakaTime API might be down at the moment\! -commands.misc.wakatime.user.error.title = User doesn't exist -commands.misc.wakatime.user.error.description = I can not find a user named like this\! -commands.misc.wakatime.help.description = Show the WakaTime stats of the specified user. commands.moderation.ban.success.title = Successfully banned commands.moderation.ban.success.description = I successfully baned %extra%