Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
2 changes: 2 additions & 0 deletions src/main/java/org/jointheleague/discord_bot/DiscordBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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){
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}


}
}

}