Exemple #1
0
 @Override
 public void onCommand(MessageReceivedEvent e, String[] args) {
   if (!e.isPrivate()) {
     e.getTextChannel()
         .sendMessage(
             new MessageBuilder()
                 .appendMention(e.getAuthor())
                 .appendString(": Help information was sent as a private message.")
                 .build());
   }
   sendPrivate(e.getAuthor().getPrivateChannel(), args);
 }
Exemple #2
0
 public static VoiceChannel GetVoiceChannel(MessageReceivedEvent event, String voiceChannelToGet) {
   VoiceChannel playTo = null;
   if (voiceChannelToGet.equals(""))
     playTo = event.getGuild().getVoiceStatusOfUser(event.getAuthor()).getChannel();
   else
     playTo =
         event
             .getGuild()
             .getVoiceChannels()
             .stream()
             .filter(x -> x.getName().equals(voiceChannelToGet))
             .findAny()
             .orElse(null);
   return playTo;
 }
Exemple #3
0
 public static VoiceChannel GetUserVoiceChannel(MessageReceivedEvent event) {
   return event.getGuild().getVoiceStatusOfUser(event.getAuthor()).getChannel();
 }