use of sx.blah.discord.api.events.EventSubscriber in project lavaplayer by sedmelluq.
the class Main method onMessageReceived.
@EventSubscriber
public void onMessageReceived(MessageReceivedEvent event) {
IMessage message = event.getMessage();
String[] command = message.getContent().split(" ", 2);
IGuild guild = message.getGuild();
if (guild != null) {
if ("~play".equals(command[0]) && command.length == 2) {
loadAndPlay(message.getChannel(), command[1]);
} else if ("~skip".equals(command[0])) {
skipTrack(message.getChannel());
}
}
}
use of sx.blah.discord.api.events.EventSubscriber in project DiscordSailv2 by Vaerys-Dawn.
the class AnnotationListener method onMessageDeleteEvent.
@EventSubscriber
public void onMessageDeleteEvent(MessageDeleteEvent event) {
if (event.getChannel().isPrivate())
return;
if (!Globals.isReady)
return;
if (event.getMessage() == null)
return;
if (event.getGuild().getUserByID(event.getAuthor().getLongID()) == null)
return;
CommandObject command = new CommandObject(event.getMessage());
if (!command.guild.config.moduleLogging)
return;
LoggingHandler.logDelete(command, event.getMessage());
}
use of sx.blah.discord.api.events.EventSubscriber in project DiscordSailv2 by Vaerys-Dawn.
the class AnnotationListener method onSystemMessageReceivedEvent.
@EventSubscriber
public void onSystemMessageReceivedEvent(MessageSendEvent event) {
IMessage message = event.getMessage();
if (message.getType() != IMessage.Type.CHANEL_PINNED_MESSAGE)
return;
if (!message.getAuthor().equals(event.getClient().getOurUser()))
return;
RequestHandler.deleteMessage(message);
}
Aggregations