use of discord4j.core.object.entity.MessageChannel in project lavaplayer by sedmelluq.
the class Main method onMessageReceived.
private void onMessageReceived(MessageCreateEvent event) {
Message message = event.getMessage();
message.getContent().ifPresent(it -> {
MessageChannel channel = message.getChannel().block();
if (channel instanceof TextChannel) {
String[] command = it.split(" ", 2);
if ("~play".equals(command[0]) && command.length == 2) {
loadAndPlay((TextChannel) channel, command[1]);
} else if ("~skip".equals(command[0])) {
skipTrack((TextChannel) channel);
}
}
});
}
Aggregations