ConstelliaBot/src/main/java/tech/nevets/constelliabot/commands/pictures/PandaCmd.java
2021-09-11 23:04:06 -04:00

33 lines
1.0 KiB
Java

package tech.nevets.constelliabot.commands.pictures;
import net.dv8tion.jda.api.EmbedBuilder;
import tech.nevets.constelliabot.Bot;
import tech.nevets.constelliabot.commands.CommandContext;
import tech.nevets.constelliabot.commands.ICommand;
import tech.nevets.constelliabot.util.httpRequests.temp.PandaRequest;
import java.io.IOException;
public class PandaCmd implements ICommand {
@Override
public void handle(CommandContext ctx) {
try { PandaRequest.getHttpConnection(); } catch (IOException | InterruptedException e) { e.printStackTrace(); }
EmbedBuilder eb = new EmbedBuilder();
ctx.getChannel().sendTyping().queue();
eb.setImage(PandaRequest.url);
ctx.getChannel().sendMessageEmbeds(eb.build()).queue();
}
@Override
public String getName() {
return "panda";
}
@Override
public String getHelp() {
return "Sends a picture of a panda!\n" +
"Usage: `" + Bot.prefix + "panda`";
}
}