ClaptrapBot/src/main/java/net/Broken/Commands/GetChannels.java

37 lines
996 B
Java
Raw Normal View History

2018-05-03 10:11:32 +02:00
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;
}
}