diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin new file mode 100644 index 00000000..4b7a3f98 Binary files /dev/null and b/build/tmp/compileJava/previous-compilation-data.bin differ diff --git a/src/main/java/org/jointheleague/discord_bot/DiscordBot.java b/src/main/java/org/jointheleague/discord_bot/DiscordBot.java index cefb5f79..4f981d15 100644 --- a/src/main/java/org/jointheleague/discord_bot/DiscordBot.java +++ b/src/main/java/org/jointheleague/discord_bot/DiscordBot.java @@ -14,6 +14,7 @@ import org.jointheleague.features.examples.first_features.RandomNumber; import org.jointheleague.features.help_embed.HelpListener; import org.jointheleague.features.student.first_feature.FeatureOne; +import org.jointheleague.features.student.first_feature.FeatureTwo; public class DiscordBot { @@ -61,6 +62,7 @@ public void connect(boolean printInvite) throws InterruptedException { addFeature(new HighLowGame(channelName)); addFeature(new NewsApi(channelName)); addFeature(new CatFactsApi(channelName)); + addFeature(new FeatureTwo(channelName)); } private void addFeature(Feature feature){ diff --git a/src/main/java/org/jointheleague/features/student/first_feature/FeatureTwo.java b/src/main/java/org/jointheleague/features/student/first_feature/FeatureTwo.java new file mode 100644 index 00000000..9ed0e015 --- /dev/null +++ b/src/main/java/org/jointheleague/features/student/first_feature/FeatureTwo.java @@ -0,0 +1,46 @@ +package org.jointheleague.features.student.first_feature; + +import org.jointheleague.api_wrapper.ReceivedMessage; +import org.jointheleague.features.abstract_classes.Feature; +import org.jointheleague.features.help_embed.plain_old_java_objects.help_embed.HelpEmbed; +import java.util.Random; + +public class FeatureTwo extends Feature { + + public final String COMMAND = "!chill"; + + public FeatureTwo(String channelName) { + super(channelName); + + //Create a help embed to describe feature when !help command is sent + helpEmbed = new HelpEmbed( + COMMAND, + "Just chill out the chat, be a chill guy." + ); + } + + @Override + public void handle(ReceivedMessage event) { + String messageContent = event.getMessageContent(); + if (messageContent.startsWith(COMMAND)) { + //respond to message here + int rand = new Random().nextInt(3); + switch (rand){ + case 0: + event.sendResponse("You all need to become chill guys, just like me."); + break; + + case 1: + event.sendResponse("Chill out man, we are all chill guys here."); + break; + + case 2: + event.sendResponse("This chat needs to chill fr fr, calm down."); + break; + } + + + } + } + +}