From e59f69f813d8df35ca3ab39df60a5b86310de77a Mon Sep 17 00:00:00 2001 From: Austin Keener Date: Thu, 9 Mar 2017 02:41:31 -0500 Subject: [PATCH] Removed TestCommand --- src/main/java/net/dv8tion/discord/Yui.java | 1 - .../dv8tion/discord/commands/TestCommand.java | 88 ------------------- 2 files changed, 89 deletions(-) delete mode 100644 src/main/java/net/dv8tion/discord/commands/TestCommand.java diff --git a/src/main/java/net/dv8tion/discord/Yui.java b/src/main/java/net/dv8tion/discord/Yui.java index c68953b..8a7c3b2 100644 --- a/src/main/java/net/dv8tion/discord/Yui.java +++ b/src/main/java/net/dv8tion/discord/Yui.java @@ -113,7 +113,6 @@ private static void setupBot() HelpCommand help = new HelpCommand(); jdaBuilder.addListener(help.registerCommand(help)); - jdaBuilder.addListener(help.registerCommand(new TestCommand())); if (settings.getGoogleApiKey() != null && !settings.getGoogleApiKey().isEmpty()) { GoogleSearch.setup(settings.getGoogleApiKey()); diff --git a/src/main/java/net/dv8tion/discord/commands/TestCommand.java b/src/main/java/net/dv8tion/discord/commands/TestCommand.java deleted file mode 100644 index 9030d9f..0000000 --- a/src/main/java/net/dv8tion/discord/commands/TestCommand.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright 2015-2016 Austin Keener - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.dv8tion.discord.commands; - -import net.dv8tion.jda.core.MessageBuilder; -import net.dv8tion.jda.core.entities.ChannelType; -import net.dv8tion.jda.core.events.message.GenericMessageEvent; -import net.dv8tion.jda.core.events.message.MessageReceivedEvent; -import net.dv8tion.jda.core.events.message.guild.GenericGuildMessageEvent; -import net.dv8tion.jda.core.events.message.priv.GenericPrivateMessageEvent; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -public class TestCommand extends Command -{ - @Override - public void onCommand(MessageReceivedEvent e, String[] args) - { - if (!e.isFromType(ChannelType.PRIVATE)) - return; - - sendMessage(e, new MessageBuilder() - .append("Yes, ") - .append(e.getAuthor()) - .append("?") - .build()); - } - - @Override - public void onGenericMessage(GenericMessageEvent e) - { - //Don't care about Delete and Embed events. (both have null messages). - if (e.getMessage() == null) - return; - - if (e instanceof GenericGuildMessageEvent) - { - GenericGuildMessageEvent event = (GenericGuildMessageEvent) e; - if (event.getGuild().getId().equals("107563502712954880")) //Gaming Bunch Guild Id - System.out.println((event.getMessage().isEdited() ? "# " : "") + "[#" + event.getChannel().getName() + "] <" + event.getAuthor().getName() + "> " + event.getMessage().getContent()); - } - - if (e instanceof GenericPrivateMessageEvent) - System.out.println((e.getMessage().isEdited() ? "# " : "") + "[Private Message] <" + e.getAuthor().getName() + "> " + e.getMessage().getContent()); - } - - @Override - public List getAliases() - { - return Arrays.asList(".t", ".test"); - } - - @Override - public String getDescription() - { - return "Just a test method, haven't removed yet for some reason"; - } - - @Override - public String getName() - { - return "Test Command"; - } - - @Override - public List getUsageInstructions() - { - return Collections.singletonList( - ".test\n" - + "Really, this command is just a test, however, it will @Mention you.\n" - + "Also, it is restricted to PMs currently."); - } -}