ClaptrapBot/src/main/java/net/Broken/Tools/EmbedMessageUtils.java

110 lines
6.6 KiB
Java
Raw Normal View History

package net.Broken.Tools;
import net.Broken.MainBot;
import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.MessageEmbed;
import java.awt.*;
2018-02-23 19:17:23 +01:00
import java.io.FileNotFoundException;
2018-02-28 11:29:12 +01:00
import java.time.Instant;
2018-02-23 19:17:23 +01:00
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
2018-02-28 17:59:09 +01:00
/**
* Pre build Message Embed
*/
public class EmbedMessageUtils {
public static MessageEmbed getUnknowCommand() {
2018-02-28 11:29:12 +01:00
return new EmbedBuilder().setTitle(":warning: Commande inconnue! :warning:").setDescription(":arrow_right: Utilisez `//help` pour voirs les commandes disponible.").setColor(Color.orange).setFooter("bot.seb6596.ovh", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
2017-12-01 15:02:35 +01:00
}
2018-02-27 15:17:00 +01:00
public static EmbedBuilder getError(String message) {
2018-02-23 19:17:23 +01:00
EmbedBuilder temp = new EmbedBuilder().setTitle(":warning: Error! :warning:").setColor(Color.red).setDescription(message);
return temp;
2018-02-23 19:17:23 +01:00
2017-12-01 15:02:35 +01:00
}
2017-09-27 12:08:57 +02:00
public static MessageEmbed getNoPrivate(){
2018-02-23 19:17:23 +01:00
EmbedBuilder temp = new EmbedBuilder().setTitle(":warning: Commande non disponible en privé! :warning:").setDescription(":arrow_right: Utilisez `//help` pour voirs les commandes disponible.").setColor(Color.red);
return buildStandar(temp);
2017-09-27 12:08:57 +02:00
}
2017-12-01 15:02:35 +01:00
public static MessageEmbed getMusicError(String message){
2018-02-28 11:29:12 +01:00
return new EmbedBuilder().setTitle(":warning: Musique Error :warning:").setDescription(":arrow_right: "+message).setFooter("'//help music' pour plus d'info",MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setColor(Color.red).setFooter("bot.seb6596.ovh", MainBot.jda.getSelfUser().getAvatarUrl()).build();
2017-10-22 23:48:13 +02:00
}
public static MessageEmbed getMusicOk(String message) {
2018-02-23 19:17:23 +01:00
EmbedBuilder temp = new EmbedBuilder().setTitle(":loud_sound: Music :loud_sound:").setDescription(message).setColor(Color.green);
return buildStandar(temp);
2017-10-22 23:48:13 +02:00
}
public static MessageEmbed getSpamExtermine(Member autor, int multi) {
2018-02-28 11:29:12 +01:00
return new EmbedBuilder().setTitle(":mute: Spam Hunter :mute:").setDescription(autor.getAsMention() + " détecté comme spammer !\n\nOn te revoit dans __**" + multi + "**__ min!").setImage("https://media.giphy.com/media/WVudyGEaizNeg/giphy.gif").setFooter("Spam info disponible via '//spaminfo' en privé", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setTimestamp(Instant.now()).setColor(Color.orange).setColor(Color.orange).build();
}
public static MessageEmbed getSpamPardon(Member autor) {
2018-02-28 11:29:12 +01:00
return new EmbedBuilder().setTitle(":mute: Spam Hunter :mute:").setDescription(autor.getAsMention() + " est de retour, fais gaffe!\nJe te surveille!").setImage("https://media.giphy.com/media/3o7TKwBctlv08kY08M/giphy.gif").setFooter("Spam info disponible via '//spaminfo' en privé", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setColor(Color.orange).build();
}
2018-02-23 19:17:23 +01:00
public static MessageEmbed getHelp(String command) throws FileNotFoundException {
String name = command.substring(0, 1).toUpperCase() + command.substring(1).toLowerCase();
String message = new ResourceLoader().getFile("Help/"+name+"/fr/main.md");
EmbedBuilder temp = new EmbedBuilder().setTitle(":question: " + command.substring(0, 1).toUpperCase() + command.substring(1).toLowerCase() + " :question: ").setDescription(message).setColor(Color.green);
return buildStandar(temp);
}
public static MessageEmbed getMoveError(String message) {
2018-02-28 11:29:12 +01:00
return new EmbedBuilder().setTitle(":warning: Move Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help move' pour plus d'info ", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
}
public static MessageEmbed getMoveOk(String message) {
2018-02-23 19:17:23 +01:00
EmbedBuilder temp = new EmbedBuilder().setTitle(":arrow_left: Move :arrow_right: ").setDescription(message).setColor(Color.green);
return buildStandar(temp);
}
public static MessageEmbed getSpamError(String message) {
2018-02-23 19:17:23 +01:00
return new EmbedBuilder().setTitle(":warning: Spam Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help spam' pour plus d'info ", MainBot.jda.getSelfUser().getAvatarUrl()).build();
}
public static MessageEmbed getSpamError(String message, String sub) {
2018-02-28 11:29:12 +01:00
return new EmbedBuilder().setTitle(":warning: Spam Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help spam "+sub+"' pour plus d'info ", MainBot.jda.getSelfUser().getAvatarUrl()).setThumbnail(MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
}
public static MessageEmbed getSpamInfo(String message) {
2018-02-23 19:17:23 +01:00
EmbedBuilder temp = new EmbedBuilder().setTitle(":hourglass: Spam Info :hourglass:").setDescription(message).setColor(Color.green);
return buildStandar(temp);
}
public static MessageEmbed getFlushError(String message) {
2018-02-28 11:29:12 +01:00
return new EmbedBuilder().setTitle(":warning: Flush Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help flush' pour plus d'info ", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
}
public static MessageEmbed getRegister(String message) {
2018-02-28 11:29:12 +01:00
return buildStandar(new EmbedBuilder().setTitle(":pencil: Web Registration :pencil:").setDescription(message).setColor(Color.green));
}
2018-02-23 19:17:23 +01:00
public static MessageEmbed getInternalError(){
2018-02-27 23:26:42 +01:00
return buildStandar(getError("Je... Je... je ne me sens pas bien... :thermometer_face: \nContactez vite mon developeur!").setImage("https://i.imgur.com/anKv8U5.gif"));
2018-02-23 19:17:23 +01:00
}
public static MessageEmbed buildStandar(EmbedBuilder embedBuilder){
2018-02-28 11:29:12 +01:00
return embedBuilder.setFooter("bot.seb6596.ovh", MainBot.jda.getSelfUser().getAvatarUrl()).setThumbnail(MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
2018-02-23 19:17:23 +01:00
}
public static MessageEmbed getUnautorized(){
2018-02-27 16:16:41 +01:00
return buildStandar(getError("Vous n'avez pas l'autorisation de faire ça!").setImage("https://i.imgur.com/0OSsdvW.gif"));
2018-02-23 19:17:23 +01:00
}
public static MessageEmbed getHelpList(String role, String list) throws FileNotFoundException {
String message = new ResourceLoader().getFile("Help/main.md");
message = message.replace("@list", list);
2018-02-28 11:29:12 +01:00
return new EmbedBuilder().setTitle("Command du bot ("+role+")").setDescription(message).setFooter("Utilise '//help <commande>' pour plus de détails.",MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setColor(Color.green).setThumbnail(MainBot.jda.getSelfUser().getAvatarUrl()).build();
2018-02-24 17:28:16 +01:00
}
2018-02-27 15:17:00 +01:00
}