@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); }
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; }
public static VoiceChannel GetUserVoiceChannel(MessageReceivedEvent event) { return event.getGuild().getVoiceStatusOfUser(event.getAuthor()).getChannel(); }