updated the initial message the QuizHandler sends and removed useless passing of the Discord API object

master
BodgeMaster 2022-02-22 18:27:10 +01:00
parent 113323da00
commit 0de1cf9a67
2 changed files with 3 additions and 6 deletions

View File

@ -35,7 +35,7 @@ public class Main {
event.getChannel().sendMessage("Pong!\nHacky the quiz bot has been running since "+startupTime);
}
if (event.getMessageContent().equalsIgnoreCase("!trivia")) {
QuizHandlers.add(new QuizHandler(api, event.getMessageAuthor().asUser().get()));
QuizHandlers.add(new QuizHandler(event.getMessageAuthor().asUser().get()));
}
});

View File

@ -1,18 +1,15 @@
package linux.general.hackyquizbot;
import org.javacord.api.DiscordApi;
import org.javacord.api.entity.user.User;
import org.javacord.api.entity.message.embed.EmbedBuilder;
//TODO: find a better name for this class
public class QuizHandler {
private DiscordApi api;
private User user;
public QuizHandler(DiscordApi api, User user) {
this.api = api;
public QuizHandler(User user) {
this.user = user;
user.sendMessage("Hi! Im Hacky.\nThis is a test.");
user.sendMessage("Hi! I'm Hacky.\nI will be sending you a bunch of multiple-choice questions. You can answer by selecting one or more of the reactions on the message and confirm your selection by selecting the :white_check_mark: reaction. Please contact @BodgeMaster#0344 if there are any issues.");
}
public void sendMessage(String question, String[] options) {