1
0
Fork 0

Removed a file that was not meant to be pushed (#166)

This commit is contained in:
toastie_t0ast 2023-08-21 23:27:45 +12:00 committed by GitHub
commit 7905317bdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,25 +0,0 @@
package net.elliebot.ellie.listeners;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.MessageChannel;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
public class EllieListener extends ListenerAdapter
{
@Override
public void onMessageReceived(MessageReceivedEvent event)
{
if (event.getAuthor().isBot()) return;
// We don't want to respond to other bot accounts, including ourself
Message message = event.getMessage();
String content = message.getContentRaw();
// getContentRaw() is an atomic getter
// getContentDisplay() is a lazy getter which modifies the content for e.g. console view (strip discord formatting)
if (content.equals("!ping"))
{
MessageChannel channel = event.getChannel();
channel.sendMessage("Pong!").queue(); // Important to call .queue() on the RestAction returned by sendMessage(...)
}
}
}