sorted all errors and made first Jar file
version 1.0
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import net.dv8tion.jda.api.JDABuilder;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.*;
|
||||
|
||||
|
||||
public class disMCbot extends ListenerAdapter {
|
||||
@@ -17,13 +17,14 @@ public class disMCbot extends ListenerAdapter {
|
||||
|
||||
public static void main(String[] args) throws LoginException {
|
||||
logger.info("Starting Discord Comms...");
|
||||
JDABuilder builder = JDABuilder.createDefault("MTIyNjY1NTgxODU0NDMxNjQxNw.GALTlL.vPRJyKTEJNqN1Snfj5G-_2306lBKFdOYB1eDXE");
|
||||
JDABuilder builder = JDABuilder
|
||||
.createDefault("MTIyNjY1NTgxODU0NDMxNjQxNw.GALTlL.vPRJyKTEJNqN1Snfj5G-_2306lBKFdOYB1eDXE");
|
||||
builder.addEventListeners(new disMCbot());
|
||||
builder.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReceived(MessageReceivedEvent event) {
|
||||
public void onMessageReceived(@Nonnull MessageReceivedEvent event) {
|
||||
if (event.getAuthor().isBot()) return; // Ignore messages from bots
|
||||
|
||||
String message = event.getMessage().getContentRaw();
|
||||
@@ -54,11 +55,14 @@ public class disMCbot extends ListenerAdapter {
|
||||
updateChannel.sendMessage("Player1 has drowned - they got thirsty!").queue();
|
||||
// Log It
|
||||
logger.info("Message sent to Discord.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setUpdateChannel(TextChannel channel) {
|
||||
this.updateChannel = channel;
|
||||
public void setUpdateChannel(TextChannel channel) {
|
||||
this.updateChannel = channel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user