Add getChannels

This commit is contained in:
Sebastien 2018-05-03 10:11:32 +02:00
parent d370cce0b3
commit eee4db201a

View File

@ -0,0 +1,36 @@
package net.Broken.Commands;
import net.Broken.Commande;
import net.Broken.Tools.EmbedMessageUtils;
import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.entities.TextChannel;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
import java.awt.*;
public class GetChannels implements Commande{
@Override
public void action(String[] args, MessageReceivedEvent event) {
event.getGuild().getTextChannels();
EmbedBuilder eb = new EmbedBuilder().setColor(Color.green);
for(TextChannel channel : event.getGuild().getTextChannels())
eb.addField(channel.getName(),"ID: " + channel.getId(), false);
event.getTextChannel().sendMessage(EmbedMessageUtils.buildStandar(eb)).complete();
}
@Override
public boolean isPrivateUsable() {
return false;
}
@Override
public boolean isAdminCmd() {
return true;
}
@Override
public boolean isNSFW() {
return false;
}
}