This commit is contained in:
BrokenFire 2017-03-20 20:22:17 +01:00
parent e92ce9f11f
commit afdd27e466
4 changed files with 10 additions and 7 deletions

View File

@ -38,7 +38,6 @@ public class BotListener extends ListenerAdapter {
//On a detecter que c'etait une commande //On a detecter que c'etait une commande
//System.out.println(event.getMessage().getContent()); //System.out.println(event.getMessage().getContent());
MainBot.handleCommand(MainBot.parser.parse(event.getMessage().getContent(), event)); MainBot.handleCommand(MainBot.parser.parse(event.getMessage().getContent(), event));

View File

@ -3,12 +3,13 @@ package net.Broken;
import net.Broken.Outils.CommandParser; import net.Broken.Outils.CommandParser;
import net.Broken.Outils.DayListener; import net.Broken.Outils.DayListener;
import net.Broken.Outils.Redirection; import net.Broken.Outils.Redirection;
import net.Broken.commandes.*; import net.Broken.Commandes.*;
import net.Broken.commandes.Over18.*; import net.Broken.Commandes.Over18.*;
import net.dv8tion.jda.core.AccountType; import net.dv8tion.jda.core.AccountType;
import net.dv8tion.jda.core.JDA; import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.JDABuilder; import net.dv8tion.jda.core.JDABuilder;
import net.dv8tion.jda.core.OnlineStatus; import net.dv8tion.jda.core.OnlineStatus;
import net.dv8tion.jda.core.entities.Game;
import net.dv8tion.jda.core.entities.Guild; import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Member; import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
@ -69,7 +70,6 @@ public class MainBot {
jda = new JDABuilder(AccountType.BOT).addListener(new BotListener()).setToken(args[0]).setBulkDeleteSplittingEnabled(false).buildBlocking(); jda = new JDABuilder(AccountType.BOT).addListener(new BotListener()).setToken(args[0]).setBulkDeleteSplittingEnabled(false).buildBlocking();
jda.setAutoReconnect(true); jda.setAutoReconnect(true);
jda.addEventListener(); jda.addEventListener();
jda.addEventListener();
okInit=true; okInit=true;
@ -84,6 +84,8 @@ public class MainBot {
//Connection reussi //Connection reussi
if(okInit) if(okInit)
{ {
jda.getPresence().setGame(Game.of("Statut: Loading..."));
jda.getTextChannels().forEach(textChannel -> textChannel.sendTyping().queue());
/************************************* /*************************************
* Definition des commande * * Definition des commande *
*************************************/ *************************************/
@ -133,6 +135,8 @@ public class MainBot {
/*List<User> userAction = serveur.getUsersByName("Broken_Fire"); /*List<User> userAction = serveur.getUsersByName("Broken_Fire");
new Move().exc(userAction.get(0),"Big Daddy",true,serveur,serveur.getManager());*/ new Move().exc(userAction.get(0),"Big Daddy",true,serveur,serveur.getManager());*/
Redirection urlRedirect=new Redirection(); Redirection urlRedirect=new Redirection();
jda.getPresence().setGame(Game.of("Statut: Ok"));
} }
@ -153,7 +157,7 @@ public class MainBot {
else else
{ {
MessageReceivedEvent event = cmd.event; MessageReceivedEvent event = cmd.event;
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Commande inconnue!__** :warning:\n:arrow_right: Utilisez `//help` pour voirs les commandes disponible. ").queue(); event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Commande inconnue!__** :warning:\n:arrow_right: Utilisez `//help` pour voirs les Commandes disponible. ").queue();
logger.info("Commande inconnue"); logger.info("Commande inconnue");
} }

View File

@ -1,7 +1,7 @@
package net.Broken.Outils; package net.Broken.Outils;
import net.Broken.MainBot; import net.Broken.MainBot;
import net.Broken.commandes.Move; import net.Broken.Commandes.Move;
import net.dv8tion.jda.core.entities.Guild; import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Member; import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.Role; import net.dv8tion.jda.core.entities.Role;

View File

@ -1,5 +1,5 @@
package net.Broken.Outils; package net.Broken.Outils;
import net.Broken.commandes.Spam; import net.Broken.Commandes.Spam;
import net.dv8tion.jda.core.exceptions.RateLimitedException; import net.dv8tion.jda.core.exceptions.RateLimitedException;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;