Compare commits

..

No commits in common. "01d023a2bf995d85b2ad3f9a0b730bc016605ff8" and "92f66779c1ea7789b7c7f8ec9a10a49ee975a971" have entirely different histories.

2 changed files with 3 additions and 21 deletions

View File

@ -4,14 +4,11 @@ import org.javacord.api.DiscordApi;
import org.javacord.api.DiscordApiBuilder; import org.javacord.api.DiscordApiBuilder;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.util.Date;
import java.util.Scanner; import java.util.Scanner;
public class Main { public class Main {
public static void main(String[] args) { public static void main(String[] args) {
String startupTime = String.format("%1$tY-%1$tm-%1$td %1$tI:%1$tM:%1$tS%1$tp UTC%1$tz", new Date());
// Insert your bot's token here // Insert your bot's token here
String token = args[0]; String token = args[0];
@ -26,7 +23,7 @@ public class Main {
// Add a listener which answers with "Pong!" if someone writes "!ping" // Add a listener which answers with "Pong!" if someone writes "!ping"
api.addMessageCreateListener(event -> { api.addMessageCreateListener(event -> {
if (event.getMessageContent().equalsIgnoreCase("!ping")) { if (event.getMessageContent().equalsIgnoreCase("!ping")) {
event.getChannel().sendMessage("Pong!\nHacky the quiz bot has been running since "+startupTime); event.getChannel().sendMessage("Pong!");
} }
}); });
@ -35,7 +32,6 @@ public class Main {
} }
//Deploy check thread
public static class CheckDeploy extends Thread { public static class CheckDeploy extends Thread {
private int interval; private int interval;
private String id; private String id;

View File

@ -2,7 +2,6 @@ package linux.general.hackyquizbot;
import org.javacord.api.DiscordApi; import org.javacord.api.DiscordApi;
import org.javacord.api.entity.user.User; import org.javacord.api.entity.user.User;
import org.javacord.api.entity.message.embed.EmbedBuilder;
public class Member { public class Member {
private DiscordApi api; private DiscordApi api;
@ -15,23 +14,10 @@ public class Member {
if(event.getMessageContent().equalsIgnoreCase("!trivia")) { if(event.getMessageContent().equalsIgnoreCase("!trivia")) {
if(event.getMessageAuthor().asUser().isPresent()) { if(event.getMessageAuthor().asUser().isPresent()) {
this.user = event.getMessageAuthor().asUser().get(); this.user = event.getMessageAuthor().asUser().get();
this.user.sendMessage("Hi! I'm Hacky! **Fuck you**! :D");
this.user.sendMessage("Welcome to hell");
} }
} }
}); });
} }
public void sendMessage(String question, String[] options) {
String desc = new String();
for(String option: options) {
desc += option + "\n";
}
EmbedBuilder embed = new EmbedBuilder()
.setTitle(question)
.setDescription(desc);
this.user.sendMessage(embed);
}
} }