Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public final class BroadcastMessageExecutor implements CommandExecutor {
- @Override
- public void execute(Guild guild, User user, TextChannel channel, Message message, ICommand command, String[] args) {
- if (user.getIdLong() != 281356874048339979L && user.getIdLong() != 259758018525134848L) {
- channel.sendMessage("Нет прав.").queue();
- return;
- }
- final List<TextChannel> mentionedChannels = message.getMentionedChannels();
- if (mentionedChannels.isEmpty()) {
- channel.sendMessage("Mention at least one channel").queue();
- return;
- }
- if ((args.length - 1) >= 1) {
- String msg = Arrays.stream(args)
- .skip(1)
- .collect(Collectors.joining(" "));
- mentionedChannels.get(0).sendMessage(msg).queue();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement