Exemple #1
0
 public static User GetUrself(MessageReceivedEvent event) {
   if (bot != null) return bot;
   else {
     bot = event.getJDA().getUserById(event.getJDA().getSelfInfo().getId());
     return bot;
   }
 }
Exemple #2
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 #3
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 #4
0
 public static VoiceChannel GetUserVoiceChannel(MessageReceivedEvent event) {
   return event.getGuild().getVoiceStatusOfUser(event.getAuthor()).getChannel();
 }