Translation and some change
This commit is contained in:
parent
196e61d6bb
commit
8dfd2324a6
@ -1,36 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -42,7 +42,7 @@ public class Help implements Commande {
|
|||||||
Commande cmdObj = MainBot.commandes.get(argsString);
|
Commande cmdObj = MainBot.commandes.get(argsString);
|
||||||
if(!cmdObj.isAdminCmd() || isAdmin(event))
|
if(!cmdObj.isAdminCmd() || isAdmin(event))
|
||||||
{
|
{
|
||||||
logger.info("Aide demmander pour la cmd "+argsString+" par "+event.getAuthor().getName());
|
logger.debug("Help for "+argsString+" by "+event.getAuthor().getName());
|
||||||
MessageEmbed messageEmbed;
|
MessageEmbed messageEmbed;
|
||||||
try {
|
try {
|
||||||
messageEmbed = EmbedMessageUtils.getHelp(argsString);
|
messageEmbed = EmbedMessageUtils.getHelp(argsString);
|
||||||
@ -55,24 +55,7 @@ public class Help implements Commande {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!event.isFromType(ChannelType.PRIVATE)) {
|
if(!event.isFromType(ChannelType.PRIVATE)) {
|
||||||
Message rest = event.getTextChannel().sendMessage(messageEmbed).complete();
|
event.getTextChannel().sendMessage(messageEmbed).queue();
|
||||||
if(args.length<=1)
|
|
||||||
{
|
|
||||||
Message finalRest = rest;
|
|
||||||
List<Message> messages = new ArrayList<Message>(){{
|
|
||||||
add(finalRest);
|
|
||||||
add(event.getMessage());
|
|
||||||
}};
|
|
||||||
new MessageTimeOut(messages,MainBot.messageTimeOut).start();
|
|
||||||
}
|
|
||||||
else if(!args[1].toLowerCase().equals("true")){
|
|
||||||
Message finalRest1 = rest;
|
|
||||||
List<Message> messages = new ArrayList<Message>(){{
|
|
||||||
add(finalRest1);
|
|
||||||
add(event.getMessage());
|
|
||||||
}};
|
|
||||||
new MessageTimeOut(messages,MainBot.messageTimeOut).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else{
|
} else{
|
||||||
PrivateMessage.send(event.getAuthor(), messageEmbed,logger);
|
PrivateMessage.send(event.getAuthor(), messageEmbed,logger);
|
||||||
@ -109,7 +92,7 @@ public class Help implements Commande {
|
|||||||
} else{
|
} else{
|
||||||
PrivateMessage.send(event.getAuthor(),EmbedMessageUtils.getUnknowCommand(),logger);
|
PrivateMessage.send(event.getAuthor(),EmbedMessageUtils.getUnknowCommand(),logger);
|
||||||
}
|
}
|
||||||
logger.info("Commande Inconnue!");
|
logger.debug("Unknown command!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -142,7 +125,7 @@ public class Help implements Commande {
|
|||||||
txt += nsfwTable.build();
|
txt += nsfwTable.build();
|
||||||
|
|
||||||
if(!event.isFromType(ChannelType.PRIVATE)){
|
if(!event.isFromType(ChannelType.PRIVATE)){
|
||||||
Message rest = event.getTextChannel().sendMessage(new EmbedBuilder().setTitle("Command envoyées par message privé").setColor(Color.green).build()).complete();
|
Message rest = event.getTextChannel().sendMessage(new EmbedBuilder().setTitle("Commands send by private message").setColor(Color.green).build()).complete();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, rest, event.getMessage()).start();
|
new MessageTimeOut(MainBot.messageTimeOut, rest, event.getMessage()).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,6 @@ public class MainBot {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//On verifie que la commande existe
|
|
||||||
if (commandes.containsKey(cmd.commande))
|
if (commandes.containsKey(cmd.commande))
|
||||||
{
|
{
|
||||||
Commande cmdObj = commandes.get(cmd.commande);
|
Commande cmdObj = commandes.get(cmd.commande);
|
||||||
@ -113,8 +112,7 @@ public class MainBot {
|
|||||||
commandes.get(cmd.commande).action(cmd.args, cmd.event);
|
commandes.get(cmd.commande).action(cmd.args, cmd.event);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
Message msg = cmd.event.getTextChannel().sendMessage(cmd.event.getAuthor().getAsMention() + "\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").complete();
|
cmd.event.getMessage().delete().queue();
|
||||||
new MessageTimeOut(messageTimeOut, msg, cmd.event.getMessage()).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -130,36 +128,10 @@ public class MainBot {
|
|||||||
new MessageTimeOut(gifMessageTimeOut, msg, cmd.event.getMessage()).start();
|
new MessageTimeOut(gifMessageTimeOut, msg, cmd.event.getMessage()).start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageReceivedEvent event = cmd.event;
|
|
||||||
if(commandes.size() == 0){
|
|
||||||
if(event.isFromType(ChannelType.PRIVATE))
|
|
||||||
event.getPrivateChannel().sendMessage("Loading please wait...").queue();
|
|
||||||
else {
|
|
||||||
Message message = event.getTextChannel().sendMessage("Loading please wait...").complete();
|
|
||||||
new MessageTimeOut(messageTimeOut, message, event.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
logger.debug("Unknown command : " + cmd.commande);
|
||||||
if(event.isFromType(ChannelType.PRIVATE))
|
|
||||||
event.getPrivateChannel().sendMessage(EmbedMessageUtils.getUnknowCommand()).queue();
|
|
||||||
else {
|
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getUnknowCommand()).complete();
|
|
||||||
new MessageTimeOut(messageTimeOut, message, event.getMessage());
|
|
||||||
}
|
}
|
||||||
logger.warn("Commande inconnue");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import java.time.format.DateTimeFormatter;
|
|||||||
*/
|
*/
|
||||||
public class EmbedMessageUtils {
|
public class EmbedMessageUtils {
|
||||||
public static MessageEmbed getUnknowCommand() {
|
public static MessageEmbed getUnknowCommand() {
|
||||||
return new EmbedBuilder().setTitle(":warning: Commande inconnue! :warning:").setDescription(":arrow_right: Utilisez `//help` pour voirs les commandes disponible.").setColor(Color.orange).setFooter(MainBot.url, MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
|
return new EmbedBuilder().setTitle(":warning: Unknown command! :warning:").setDescription(":arrow_right: Use `//help` to see the available commands.").setColor(Color.orange).setFooter(MainBot.url, MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,12 +31,12 @@ public class EmbedMessageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getNoPrivate(){
|
public static MessageEmbed getNoPrivate(){
|
||||||
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);
|
EmbedBuilder temp = new EmbedBuilder().setTitle(":warning: Command not available in private :warning:").setDescription(":arrow_right: Use `//help` to see the available commands.").setColor(Color.red);
|
||||||
return buildStandar(temp);
|
return buildStandar(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getMusicError(String message){
|
public static MessageEmbed getMusicError(String message){
|
||||||
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(MainBot.url, MainBot.jda.getSelfUser().getAvatarUrl()).build();
|
return new EmbedBuilder().setTitle(":warning: Musique Error :warning:").setDescription(":arrow_right: "+message).setFooter("'//help music' for more info.",MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setColor(Color.red).setFooter(MainBot.url, MainBot.jda.getSelfUser().getAvatarUrl()).build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,22 +46,22 @@ public class EmbedMessageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getSpamExtermine(Member autor, int multi) {
|
public static MessageEmbed getSpamExtermine(Member autor, int multi) {
|
||||||
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();
|
return new EmbedBuilder().setTitle(":mute: Spam Hunter :mute:").setDescription(autor.getAsMention() + " detected as spam !\n\nSee you in __**" + multi + "**__ minutes!").setImage("https://media.giphy.com/media/WVudyGEaizNeg/giphy.gif").setFooter("Spam info available with '//spaminfo' in private.", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setTimestamp(Instant.now()).setColor(Color.orange).setColor(Color.orange).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getSpamPardon(Member autor) {
|
public static MessageEmbed getSpamPardon(Member autor) {
|
||||||
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();
|
return new EmbedBuilder().setTitle(":mute: Spam Hunter :mute:").setDescription(autor.getAsMention() + " is back retour, watch out!\nI'm watching you!").setImage("https://media.giphy.com/media/3o7TKwBctlv08kY08M/giphy.gif").setFooter("Spam info available with '//spaminfo' in private.", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setColor(Color.orange).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getHelp(String command) throws FileNotFoundException {
|
public static MessageEmbed getHelp(String command) throws FileNotFoundException {
|
||||||
String name = command.substring(0, 1).toUpperCase() + command.substring(1).toLowerCase();
|
String name = command.substring(0, 1).toUpperCase() + command.substring(1).toLowerCase();
|
||||||
String message = new ResourceLoader().getFile("Help/"+name+"/fr/main.md");
|
String message = new ResourceLoader().getFile("Help/"+name+"/en/main.md");
|
||||||
EmbedBuilder temp = new EmbedBuilder().setTitle(":question: " + command.substring(0, 1).toUpperCase() + command.substring(1).toLowerCase() + " :question: ").setDescription(message).setColor(Color.green);
|
EmbedBuilder temp = new EmbedBuilder().setTitle(":question: " + command.substring(0, 1).toUpperCase() + command.substring(1).toLowerCase() + " :question: ").setDescription(message).setColor(Color.green);
|
||||||
return buildStandar(temp);
|
return buildStandar(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getMoveError(String message) {
|
public static MessageEmbed getMoveError(String message) {
|
||||||
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();
|
return new EmbedBuilder().setTitle(":warning: Move Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help move' for more info.", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getMoveOk(String message) {
|
public static MessageEmbed getMoveOk(String message) {
|
||||||
@ -70,11 +70,11 @@ public class EmbedMessageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getSpamError(String message) {
|
public static MessageEmbed getSpamError(String message) {
|
||||||
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();
|
return new EmbedBuilder().setTitle(":warning: Spam Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help spam' for more info.", MainBot.jda.getSelfUser().getAvatarUrl()).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getSpamError(String message, String sub) {
|
public static MessageEmbed getSpamError(String message, String sub) {
|
||||||
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();
|
return new EmbedBuilder().setTitle(":warning: Spam Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help spam "+sub+"' for more info.", MainBot.jda.getSelfUser().getAvatarUrl()).setThumbnail(MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getSpamInfo(String message) {
|
public static MessageEmbed getSpamInfo(String message) {
|
||||||
@ -83,7 +83,7 @@ public class EmbedMessageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getFlushError(String message) {
|
public static MessageEmbed getFlushError(String message) {
|
||||||
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();
|
return new EmbedBuilder().setTitle(":warning: Flush Error :warning: ").setDescription(message).setColor(Color.red).setFooter("'//help flush' for more info. ", MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getRegister(String message) {
|
public static MessageEmbed getRegister(String message) {
|
||||||
@ -91,7 +91,7 @@ public class EmbedMessageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getInternalError(){
|
public static MessageEmbed getInternalError(){
|
||||||
return buildStandar(getError("Je... Je... je ne me sens pas bien... :thermometer_face: \nContactez vite mon developeur!").setImage("https://i.imgur.com/anKv8U5.gif"));
|
return buildStandar(getError("I... I... I don't feel so good ~~mr stark~~... :thermometer_face: \nPlease contact my developer!").setImage("https://i.imgur.com/anKv8U5.gif"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed buildStandar(EmbedBuilder embedBuilder){
|
public static MessageEmbed buildStandar(EmbedBuilder embedBuilder){
|
||||||
@ -99,30 +99,13 @@ public class EmbedMessageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getUnautorized(){
|
public static MessageEmbed getUnautorized(){
|
||||||
return buildStandar(getError("Vous n'avez pas l'autorisation de faire ça!").setImage("https://i.imgur.com/0OSsdvW.gif"));
|
return buildStandar(getError("You're not powerful enough to do that slave !").setImage("https://i.imgur.com/0OSsdvW.gif"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed getHelpList(String role, String list) throws FileNotFoundException {
|
public static MessageEmbed getHelpList(String role, String list) throws FileNotFoundException {
|
||||||
String message = new ResourceLoader().getFile("Help/main.md");
|
String message = new ResourceLoader().getFile("Help/main.md");
|
||||||
message = message.replace("@list", list);
|
message = message.replace("@list", list);
|
||||||
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();
|
return new EmbedBuilder().setTitle("Bot Command ("+role+")").setDescription(message).setFooter("Use '//help <command>' for more info",MainBot.jda.getSelfUser().getAvatarUrl()).setTimestamp(Instant.now()).setColor(Color.green).setThumbnail(MainBot.jda.getSelfUser().getAvatarUrl()).build();
|
||||||
}
|
|
||||||
|
|
||||||
public static MessageEmbed getPref(GuildPreferenceEntity guildPref){
|
|
||||||
EmbedBuilder messageB = new EmbedBuilder()
|
|
||||||
.setColor(Color.green)
|
|
||||||
.setTitle("**Guild config**")
|
|
||||||
.setDescription("_This is the current config of bot for this Guild_")
|
|
||||||
.addField("> Guild ID", "This is the curent guild ID\n```java\n" + guildPref.getGuildId() + "```Edit: :lock:", false)
|
|
||||||
.addField("> Anti Spam", "Activate Spam hunter\n```java\n" + String.valueOf(guildPref.isAntiSpam()) + "```Edit: :unlock:\nKey: anti_spam", false)
|
|
||||||
.addField("> Default Role", "Activate auto move to default role\n```java\n" + String.valueOf(guildPref.isDefaultRole()) + "```Edit: :unlock:\nKey: default_role", false)
|
|
||||||
.addField("> Default Role ID", "Role id for auto move\n```java\n" + guildPref.getDefaultRoleId() + "```Edit: :unlock:\nKey: default_role_id", false)
|
|
||||||
.addField("> Welcome", "Activate welcome message\n```java\n" + String.valueOf(guildPref.isWelcome()) + "```Edit: :unlock:\nKey: welcome", false)
|
|
||||||
.addField("> Welcome chanel ID", "Chane id for welcome message\n```" + guildPref.getWelcomeChanelID() + "```Edit: :unlock:\nKey: welcome_chanel_id", false)
|
|
||||||
.addField("> Welcome message", "Welcome message (@name for mention)\n```markdown\n" + guildPref.getWelcomeMessage() + "```Edit: :unlock:\nKey: welcome_message", false)
|
|
||||||
.addField("> Daily Madame", "Activate daily madame message\n```java\n" + String.valueOf(guildPref.isDailyMadame()) + "```Edit: :unlock:\nKey: daily_madame", false);
|
|
||||||
|
|
||||||
return buildStandar(messageB);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MessageEmbed searchResult(SearchResult result){
|
public static MessageEmbed searchResult(SearchResult result){
|
||||||
|
@ -89,8 +89,7 @@ public class AudioM {
|
|||||||
public void trackLoaded(AudioTrack track) {
|
public void trackLoaded(AudioTrack track) {
|
||||||
logger.info("Single Track detected!");
|
logger.info("Single Track detected!");
|
||||||
UserAudioTrack uat = new UserAudioTrack(event.getAuthor(), track);
|
UserAudioTrack uat = new UserAudioTrack(event.getAuthor(), track);
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Ajout de "+track.getInfo().title+" à la file d'attente!")).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Add "+track.getInfo().title+" to playlist")).queue();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, message, event.getMessage()).start();
|
|
||||||
|
|
||||||
play(guild, voiceChannel, musicManager, uat, onHead);
|
play(guild, voiceChannel, musicManager, uat, onHead);
|
||||||
}
|
}
|
||||||
@ -100,8 +99,8 @@ public class AudioM {
|
|||||||
logger.info("Playlist detected! Limit: "+playlistLimit);
|
logger.info("Playlist detected! Limit: "+playlistLimit);
|
||||||
AudioTrack firstTrack = playlist.getSelectedTrack();
|
AudioTrack firstTrack = playlist.getSelectedTrack();
|
||||||
|
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Ajout de "+firstTrack.getInfo().title+" et les 30 premiers titres à la file d'attente!")).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Add "+firstTrack.getInfo().title+" and 30 first videos to playlist !")).queue();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, message, event.getMessage()).start();
|
|
||||||
|
|
||||||
playListLoader(playlist, playlistLimit ,event.getAuthor() , onHead);
|
playListLoader(playlist, playlistLimit ,event.getAuthor() , onHead);
|
||||||
|
|
||||||
@ -112,24 +111,15 @@ public class AudioM {
|
|||||||
@Override
|
@Override
|
||||||
public void noMatches() {
|
public void noMatches() {
|
||||||
logger.warn("Cant find media!");
|
logger.warn("Cant find media!");
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicError("Musique introuvable!")).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicError("Video not found !")).queue();
|
||||||
List<Message> messages = new ArrayList<Message>(){{
|
|
||||||
add(message);
|
|
||||||
add(event.getMessage());
|
|
||||||
}};
|
|
||||||
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadFailed(FriendlyException exception) {
|
public void loadFailed(FriendlyException exception) {
|
||||||
logger.error("Cant load media!");
|
logger.error("Cant load media!");
|
||||||
logger.error(exception.getMessage());
|
logger.error(exception.getMessage());
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicError("Erreur de lecture!")).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicError("Playback error !")).queue();
|
||||||
List<Message> messages = new ArrayList<Message>(){{
|
|
||||||
add(message);
|
|
||||||
add(event.getMessage());
|
|
||||||
}};
|
|
||||||
new MessageTimeOut(messages, MainBot.messageTimeOut).start();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -222,8 +212,7 @@ public class AudioM {
|
|||||||
public void skipTrack(MessageReceivedEvent event) {
|
public void skipTrack(MessageReceivedEvent event) {
|
||||||
GuildMusicManager musicManager = getGuildAudioPlayer();
|
GuildMusicManager musicManager = getGuildAudioPlayer();
|
||||||
musicManager.scheduler.nextTrack();
|
musicManager.scheduler.nextTrack();
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Musique suivante!")).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Next music!")).queue();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, message, event.getMessage()).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -234,8 +223,8 @@ public class AudioM {
|
|||||||
GuildMusicManager musicManager = getGuildAudioPlayer();
|
GuildMusicManager musicManager = getGuildAudioPlayer();
|
||||||
musicManager.scheduler.pause();
|
musicManager.scheduler.pause();
|
||||||
|
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Musique en pause !")).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Music paused")).queue();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, event.getMessage(), message).start();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,8 +236,7 @@ public class AudioM {
|
|||||||
GuildMusicManager musicManager = getGuildAudioPlayer();
|
GuildMusicManager musicManager = getGuildAudioPlayer();
|
||||||
musicManager.scheduler.resume();
|
musicManager.scheduler.resume();
|
||||||
|
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Reprise de la piste en cour !")).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Music resumed")).queue();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, event.getMessage(), message).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -260,15 +248,13 @@ public class AudioM {
|
|||||||
AudioTrackInfo info = musicManager.scheduler.getInfo();
|
AudioTrackInfo info = musicManager.scheduler.getInfo();
|
||||||
UserAudioTrack userAudioTrack = musicManager.scheduler.getCurrentPlayingTrack();
|
UserAudioTrack userAudioTrack = musicManager.scheduler.getCurrentPlayingTrack();
|
||||||
|
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk(info.title + "\n" + info.uri + "\nSubmitted by: " + userAudioTrack.getSubmittedUser().getName())).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk(info.title + "\n" + info.uri + "\nSubmitted by: " + userAudioTrack.getSubmittedUser().getName())).queue();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, event.getMessage(), message).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void flush(MessageReceivedEvent event){
|
public void flush(MessageReceivedEvent event){
|
||||||
GuildMusicManager musicManager = getGuildAudioPlayer();
|
GuildMusicManager musicManager = getGuildAudioPlayer();
|
||||||
musicManager.scheduler.flush();
|
musicManager.scheduler.flush();
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("RAZ de la playlist!")).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Flush playlist!")).queue();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, event.getMessage(), message).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -280,7 +266,7 @@ public class AudioM {
|
|||||||
List<UserAudioTrackData> list = musicManager.scheduler.getList();
|
List<UserAudioTrackData> list = musicManager.scheduler.getList();
|
||||||
StringBuilder resp = new StringBuilder();
|
StringBuilder resp = new StringBuilder();
|
||||||
if(list.size() == 0){
|
if(list.size() == 0){
|
||||||
resp.append("Oh mon dieux!\nElle est vide! \n:astonished: ");
|
resp.append("Oh my god!\nThe playlist is empty ! \n:astonished: ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -290,8 +276,7 @@ public class AudioM {
|
|||||||
resp.append("\n");
|
resp.append("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Playlist:\n\n"+resp.toString())).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Playlist:\n\n"+resp.toString())).queue();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, event.getMessage(), message).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -307,8 +292,7 @@ public class AudioM {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicError("Aucune lecture en cour!")).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicError("Not connected to vocal chanel !")).queue();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, event.getMessage(), message).start();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,8 +305,7 @@ public class AudioM {
|
|||||||
musicManager.scheduler.flush();
|
musicManager.scheduler.flush();
|
||||||
|
|
||||||
if (event != null) {
|
if (event != null) {
|
||||||
Message message = event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Arret de la musique!")).complete();
|
event.getTextChannel().sendMessage(EmbedMessageUtils.getMusicOk("Music stopped")).queue();
|
||||||
new MessageTimeOut(MainBot.messageTimeOut, event.getMessage(), message).start();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
```
|
```
|
||||||
@list
|
@list
|
||||||
```
|
```
|
||||||
_PU = Private Usable (Utilisable en Message Privée)_
|
_PU = Private Usable
|
||||||
|
|
||||||
**>** __**[Web UI](https://claptrapbot.com )**__ :arrow_right: Music control, General server info (Coming soon)
|
**>** __**[Web UI](https://claptrapbot.com )**__ :arrow_right: Music control, Settings, News
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user