diff --git a/.idea/artifacts/Bot_Mk1_1_jar.xml b/.idea/artifacts/Bot_Mk1_1_jar.xml
new file mode 100644
index 0000000..c82f030
--- /dev/null
+++ b/.idea/artifacts/Bot_Mk1_1_jar.xml
@@ -0,0 +1,10 @@
+
+
+ $PROJECT_DIR$/out/artifacts/Bot_Mk1_1_jar
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..96cc43e
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..e7bedf3
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/JDA_3_0_BETA_98_withDependencies.xml b/.idea/libraries/JDA_3_0_BETA_98_withDependencies.xml
new file mode 100644
index 0000000..82227c3
--- /dev/null
+++ b/.idea/libraries/JDA_3_0_BETA_98_withDependencies.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/enigma_console.xml b/.idea/libraries/enigma_console.xml
new file mode 100644
index 0000000..bc13e8a
--- /dev/null
+++ b/.idea/libraries/enigma_console.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..b197b43
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..a1f0078
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..45cf85c
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..e1d11ee
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,1467 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getN
+ e.printStackTrace();
+ breack
+ send
+ bloc
+ block
+ que
+
+
+ D:\Users\seb65\Documents\SVN\Bot\trunk\Bot_Mk1.1\src
+
+
+
+
+
+
+
+
+
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Android > Lint > Correctness
+
+
+ Android > Lint > Internationalization
+
+
+ Android > Lint > Performance
+
+
+ Android > Lint > Usability > Icons
+
+
+ Android Lint for Kotlin
+
+
+ Bean Validation issues
+
+
+ CSS
+
+
+ Class structureJava
+
+
+ Code style issuesJava
+
+
+ Control flow issuesJava
+
+
+ Cucumber
+
+
+ Declaration redundancyJava
+
+
+ FreeMarker inspections
+
+
+ General
+
+
+ GeneralJavaScript
+
+
+ Groovy
+
+
+ Initialization issuesJava
+
+
+ Internationalization issues
+
+
+ Internationalization issuesJava
+
+
+ Java
+
+
+ Java language level migration aidsJava
+
+
+ JavaFX
+
+
+ JavaScript
+
+
+ Javadoc issuesJava
+
+
+ Pattern Validation
+
+
+ Performance issuesJava
+
+
+ Plugin DevKit
+
+
+ Probable bugsGroovy
+
+
+ RELAX NG
+
+
+ Spring
+
+
+ Spring AOPSpring
+
+
+ Threading issuesJava
+
+
+ UI Form Problems
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ project
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ C:\Users\seb65\AppData\Roaming\Subversion
+ 125
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1480777537565
+
+
+ 1480777537565
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JAVA
+
+
+ com
+ netscape
+ oracle
+ enigma
+ org
+ mozilla
+ sun
+ META-INF
+ jdk
+ java
+ javax
+ javafx
+ net
+
+
+
+
+
+
+ All
+ private
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JAVA
+ net.borken
+
+ net.borken.commandes.Over18.SM
+ net.borken.Outils.CommandParser.CommandContainer
+ net.borken.BotListener
+ net.borken.commandes.Over18.Madame
+ net.borken.Outils.AntiSpam
+ net.borken.Outils.Redirection
+ net.borken.Outils.AntiSpam.Minuteur
+ net.borken.Outils.CommandParser
+ net.borken.Outils.DayListener
+ net.borken.Outils.Moderateur
+ net.borken.commandes.Move
+ net.borken.commandes.Over18.Ass
+ net.borken.commandes.Spam
+ net.borken.Commande
+ net.borken.commandes.Help
+ net.borken.commandes.PingCommande
+ net.borken.commandes.Over18.Pipe
+ net.borken.MainBot
+ net.borken.Outils.Heure
+ net.borken.Outils.Entete
+ net.borken.commandes.Over18.Boobs
+
+
+
+
+
+
+ Inner Classes
+ Constructors
+ Methods
+
+ All
+ private
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Bot_Mk1.1:jar
+
+
+
+
+
+
+
+
+
+
+
+
+ No facets are configured
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+ Bot_Mk1.1
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+ JDA-3.0.BETA_98-withDependencies
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Bot_Mk1.1.iml b/Bot_Mk1.1.iml
new file mode 100644
index 0000000..84fb63e
--- /dev/null
+++ b/Bot_Mk1.1.iml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..f861795
--- /dev/null
+++ b/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: net.borken.MainBot
+
diff --git a/borken.uml b/borken.uml
new file mode 100644
index 0000000..692f906
--- /dev/null
+++ b/borken.uml
@@ -0,0 +1,381 @@
+
+
+ JAVA
+ net.borken
+
+ net.borken.commandes.Over18.SM
+ net.borken.Outils.CommandParser.CommandContainer
+ net.borken.commandes.Over18.Madame
+ net.borken.BotListener
+ net.borken.Outils.AntiSpam
+ net.borken.Outils.Redirection
+ net.borken.Outils.AntiSpam.Minuteur
+ net.borken.Outils.CommandParser
+ net.borken.Outils.DayListener
+ net.borken.Outils.Moderateur
+ net.borken.commandes.Move
+ net.borken.commandes.Over18.Ass
+ net.borken.commandes.Spam
+ net.borken.Commande
+ net.borken.commandes.Help
+ net.borken.commandes.PingCommande
+ net.borken.commandes.Over18.Pipe
+ net.borken.Outils.Heure
+ net.borken.MainBot
+ net.borken.Outils.Entete
+ net.borken.commandes.Over18.Boobs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ net.borken.Outils.DayListener
+
+
+ Constructors
+ Methods
+ Properties
+ Inner Classes
+ Fields
+
+ All
+ private
+
+
diff --git a/out/artifacts/Bot_Mk1_1_jar/Start.cmd b/out/artifacts/Bot_Mk1_1_jar/Start.cmd
new file mode 100644
index 0000000..00558b4
--- /dev/null
+++ b/out/artifacts/Bot_Mk1_1_jar/Start.cmd
@@ -0,0 +1,2 @@
+java -jar Bot_Mk1.1.jar "MjQwODA2MDk1NzcyMTg4Njc0.CvIrrg.p3lOx7oXabPWcT1oZiPKcu0uSs4"
+pause
\ No newline at end of file
diff --git a/out/production/Bot_Mk1.1/META-INF/MANIFEST.MF b/out/production/Bot_Mk1.1/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..f861795
--- /dev/null
+++ b/out/production/Bot_Mk1.1/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: net.borken.MainBot
+
diff --git a/out/production/Bot_Mk1.1/META-INF/desktop.ini b/out/production/Bot_Mk1.1/META-INF/desktop.ini
new file mode 100644
index 0000000..2e164ce
--- /dev/null
+++ b/out/production/Bot_Mk1.1/META-INF/desktop.ini
@@ -0,0 +1,5 @@
+[.ShellClassInfo]
+InfoTip=Ce dossier est partagé en ligne.
+IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe
+IconIndex=16
+
\ No newline at end of file
diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..f861795
--- /dev/null
+++ b/src/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: net.borken.MainBot
+
diff --git a/src/META-INF/desktop.ini b/src/META-INF/desktop.ini
new file mode 100644
index 0000000..2e164ce
--- /dev/null
+++ b/src/META-INF/desktop.ini
@@ -0,0 +1,5 @@
+[.ShellClassInfo]
+InfoTip=Ce dossier est partagé en ligne.
+IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe
+IconIndex=16
+
\ No newline at end of file
diff --git a/src/net/borken/BotListener.java b/src/net/borken/BotListener.java
new file mode 100644
index 0000000..71292d4
--- /dev/null
+++ b/src/net/borken/BotListener.java
@@ -0,0 +1,62 @@
+package net.borken;
+
+import net.borken.Outils.AntiSpam;
+import net.borken.Outils.Moderateur;
+import net.dv8tion.jda.core.entities.Guild;
+import net.dv8tion.jda.core.entities.Member;
+import net.dv8tion.jda.core.entities.User;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+import net.dv8tion.jda.core.hooks.ListenerAdapter;
+import net.dv8tion.jda.core.managers.GuildManager;
+
+
+/**
+ * Created by seb65 on 19/10/2016.
+ */
+
+public class BotListener extends ListenerAdapter {
+ AntiSpam antispam=new AntiSpam();
+ Moderateur modo = new Moderateur();
+ @Override
+ public void onMessageReceived(MessageReceivedEvent event) {
+ // ----------------------Test pour eviter eco de commande-------------------------
+ try
+ {
+ if (event.getMessage().getContent().startsWith("//") && event.getMessage().getAuthor().getId() != event.getJDA().getSelfUser().getId()) {
+ //On a detecter que c'etait une commande
+ //System.out.println(event.getMessage().getContent());
+
+
+ MainBot.handleCommand(MainBot.parser.parse(event.getMessage().getContent(), event));
+
+
+
+ }
+ else if (event.getMessage().getAuthor().getId() != event.getJDA().getSelfUser().getId() && !event.getTextChannel().getName().equals("le_dongeon"))
+ {
+ //N'est pas une commande
+
+ Guild serveur=event.getGuild();
+ GuildManager guildManager = serveur.getManager();
+ Member user = event.getMember();
+
+ // appel de la methode d'analyse de message de "Moderateur"
+ if(!event.getAuthor().getName().equals("Aethex")) {
+ if (modo.analyse(user, serveur, guildManager, event) == 1) {
+ antispam.extermine(user, serveur, guildManager,true, event);
+ }
+ }
+
+
+ }
+ }catch (Exception e)
+ {
+ if (e.getMessage()==null) {
+ System.out.println(MainBot.entete.get("ERREUR", "BotListener") +"NullPointerException");
+ } else {
+ System.out.println(MainBot.entete.get("ERREUR", "BotListener") + e.getMessage());
+ }
+ }
+
+ }
+}
diff --git a/src/net/borken/Commande.java b/src/net/borken/Commande.java
new file mode 100644
index 0000000..3483164
--- /dev/null
+++ b/src/net/borken/Commande.java
@@ -0,0 +1,16 @@
+package net.borken;
+
+import net.dv8tion.jda.*;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+
+/**
+ * Created by seb65 on 19/10/2016.
+ */
+public interface Commande {
+ boolean called(String[] args, MessageReceivedEvent event);
+ void action(String[] args, MessageReceivedEvent event);
+ String help(String[] args);
+ void executed(boolean success, MessageReceivedEvent event);
+
+
+}
diff --git a/src/net/borken/MainBot.java b/src/net/borken/MainBot.java
new file mode 100644
index 0000000..d9ff6be
--- /dev/null
+++ b/src/net/borken/MainBot.java
@@ -0,0 +1,247 @@
+package net.borken;
+
+import enigma.console.Console;
+import enigma.console.TextAttributes;
+import enigma.core.Enigma;
+import net.borken.Outils.CommandParser;
+import net.borken.Outils.DayListener;
+import net.borken.Outils.Entete;
+import net.borken.Outils.Redirection;
+import net.borken.commandes.*;
+import net.borken.commandes.Over18.*;
+
+
+import net.dv8tion.jda.core.*;
+import net.dv8tion.jda.core.entities.Guild;
+import net.dv8tion.jda.core.entities.Member;
+import net.dv8tion.jda.core.entities.User;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+import net.dv8tion.jda.core.exceptions.RateLimitedException;
+import net.dv8tion.jda.core.managers.GuildManager;
+
+import javax.security.auth.login.LoginException;
+import java.awt.*;
+import java.io.*;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Created by seb65 on 19/10/2016.
+ */
+public class MainBot {
+
+ private static JDA jda;
+ public static final CommandParser parser =new CommandParser();
+ public static HashMap commandes = new HashMap<>();
+ public static boolean okInit=false;
+ public static Entete entete=new Entete();
+ public static HashMap historique =new HashMap<>();
+ public static HashMap message_compteur =new HashMap<>();
+
+ public static Hashtable userMulti = new Hashtable();
+ public static Hashtable minuteurStatut = new Hashtable<>();
+
+ public static TextAttributes txtColor;
+
+ public static void main(String[] args) throws IOException {
+
+ Stop stopTh=new Stop();
+ stopTh.start();
+ txtColor = new TextAttributes(Color.green, Color.black);
+ s_console.setTextAttributes(txtColor);
+ System.out.println();
+ System.out.println();
+ System.out.println();
+ System.out.println();
+ System.out.println();
+ /****************************
+ * Initialisation *
+ ****************************/
+ System.out.println("-------------------INITIALISATION-------------------");
+ txtColor = new TextAttributes(Color.blue, Color.black);
+ s_console.setTextAttributes(txtColor);
+ //Bot démarrer sans token
+ if (args.length < 1) {
+ System.out.println();
+ System.err.println(entete.get("ERREUR","INIT")+"Veuilliez indiquer le token du bot en argument...");
+ okInit=false;
+ }
+ else
+ {
+ //Token présent
+ try
+ {
+ System.out.println();
+ System.out.println(entete.get("Info","INIT")+"Connection au serveur...");
+ //connection au bot
+ jda = new JDABuilder(AccountType.BOT).addListener(new BotListener()).setToken(args[0]).setBulkDeleteSplittingEnabled(false).buildBlocking();
+ jda.setAutoReconnect(true);
+ okInit=true;
+
+ }
+ catch (LoginException | InterruptedException | RateLimitedException e)
+ {
+ System.out.println();
+ System.err.println(entete.get("ERREUR","INIT")+e.getMessage());
+ okInit=false;
+ }
+ }
+
+ //Connection reussi
+ if(okInit)
+ {
+ /*************************************
+ * Definition des commande *
+ *************************************/
+ commandes.put("ping", new PingCommande());
+ commandes.put("help",new Help());
+ commandes.put("move", new Move());
+ commandes.put("spam", new Spam());
+ commandes.put("ass",new Ass());
+ commandes.put("boobs",new Boobs());
+ commandes.put("pipe",new Pipe());
+ commandes.put("sm",new SM());
+ commandes.put("madame",new Madame());
+
+ //On recupere le l'id serveur
+ Guild serveur = jda.getGuilds().get(0);
+
+ //On recupere le serveur manageur
+ GuildManager guildManager = serveur.getManager();
+
+ //on recupere les utilisateur conecter
+ List utilisateurCo = serveur.getMembers();
+ System.out.println();
+ System.out.println(entete.get("Info","INIT")+"Utilisatieur connecté: ");
+ for (Member anUtilisateurCo : utilisateurCo) //= for(int i=0; i userAction = serveur.getUsersByName("Broken_Fire");
+ new Move().exc(userAction.get(0),"Big Daddy",true,serveur,serveur.getManager());*/
+ Redirection urlRedirect=new Redirection();
+
+ }
+
+ }
+
+ /***************************************
+ * Traitement de la commande *
+ ***************************************/
+ public static void handleCommand(CommandParser.CommandContainer cmd)
+ {
+ //On verifie que la commande existe
+ if (commandes.containsKey(cmd.commande))
+ {
+ commandes.get(cmd.commande).action(cmd.args, cmd.event);
+ commandes.get(cmd.commande).executed(true, cmd.event);
+
+ }
+ else
+ {
+ 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();
+
+ }
+
+ }
+ /*******************************
+ * RAZ Compteur Spam *
+ *******************************/
+ public static class ModoTimer extends Thread{
+
+
+ public ModoTimer()
+ {
+
+ }
+
+
+ @Override
+ public void run()
+ {
+ while (true)
+ {
+ try {
+ sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ //System.out.println("\n5sec Ecoulées !");
+ for (Member unUser: message_compteur.keySet() ) //=for(int i=0; i spm = serveur.getRolesByName("Spammer", false);
+ move.exc(user, spm.get(0), true, serveur, serveurManger);
+ Thread minuteur =new Minuteur(MainBot.userMulti.get(user), move.user, move.saveRoleUser, move.serveur, move.serveurManager,event);
+ minuteur.start();
+ }
+ }
+
+
+
+
+ }
+
+ public class Minuteur extends Thread{
+ public TextChannel chanel;
+ public List saveRoleUser;
+ public Member user;
+ public Guild serveur;
+ public GuildManager serveurManager;
+ public int multip;
+ public MessageReceivedEvent event;
+
+
+ public Minuteur(int multip, Member user, List saveRoleUser, Guild serveur, GuildManager serveurManager, MessageReceivedEvent event )
+ {
+ this.multip=multip;
+ this.user=user;
+ this.saveRoleUser=saveRoleUser;
+ this.serveur=serveur;
+ this.serveurManager=serveurManager;
+ this.event=event;
+ this.chanel=event.getTextChannel();
+ }
+
+
+ @Override
+ public void run() {
+ int cSeg=0;
+ System.out.println();
+ System.out.println(entete.get("Info","MINUTEUR")+"["+user.getEffectiveName()+"] DĂ©marage pour "+multip+"min");
+ while (MainBot.minuteurStatut.get(user))
+ {
+ try {
+ sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ if(cSeg>60*multip)
+ {
+ MainBot.minuteurStatut.replace(user,false);
+ }
+ cSeg++;
+ }
+ System.out.println();
+ System.out.println(entete.get("Info","MINUTEUR")+ "["+user.getEffectiveName()+"] Fin de spam pour "+user.getEffectiveName()+" apres "+multip+"min.");
+ move.exc(user, saveRoleUser.get(0), true, serveur, serveurManager); //aSaveroleUser=saveRoleUser.get(i)
+ System.out.println();
+ System.out.println(entete.get("Info","MINUTEUR")+"["+user.getEffectiveName()+"] Fin des "+multip+"min");
+ chanel.sendMessage(user.getAsMention()+"\n```markdown\n#-----------------SPAM DETECTEUR----------------#\n# #\n# Un spammeur est de retour, fais gaffe! #\n# Je te surveille! #\n# #\n#-----------------------------------------------#```\n http://67.media.tumblr.com/tumblr_lvrf58vBkL1qibz0jo1_r1_500.png").queue();
+
+
+ // #-----------------------------------------------#
+
+
+ }
+ }
+
+
+
+}
diff --git a/src/net/borken/Outils/CommandParser.java b/src/net/borken/Outils/CommandParser.java
new file mode 100644
index 0000000..5c73c3c
--- /dev/null
+++ b/src/net/borken/Outils/CommandParser.java
@@ -0,0 +1,55 @@
+package net.borken.Outils;
+
+import net.dv8tion.jda.*;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+/**
+ * Created by seb65 on 19/10/2016.
+ */
+
+public class CommandParser {
+ public static Entete entete=new Entete();
+ public CommandContainer parse(String brt, MessageReceivedEvent e)
+ {
+ ArrayList split =new ArrayList();
+ String brut =brt;
+ String sansTete = brut.replaceFirst("//",""); // on retire l'entete
+ String[] splitSansTete = sansTete.split(" "); // on prend l'espace comme separateur cmd/arg
+ for(String s : splitSansTete){ //= pourchaque
+ split.add(s); // on fait un truc que je comprend pas trop x)
+ }
+ String commande = split.get(0); // on recuperre la 1er partie qui correspond a la cmd
+ String[] args = new String[split.size()-1];
+ split.subList(1,split.size()).toArray(args);
+ for(int i=0;ij;j++)
+ {
+ System.out.println(entete.get("Info","MODERATEUR")+"\t"+j+". "+MainBot.historique.get(user)[j]);
+ }
+ toi[0] = "";
+ toi[1] = "";
+ toi[2] = "";
+ toi[3] = "";
+ MainBot.historique.put(user, toi);
+ }
+
+ } else {
+ /********************************************
+ * SI c'est le 1er message de l'USER *
+ ********************************************/
+ // si le user n'a pas encore posté de message
+ // on ajoute le dernier message dans "historique"
+ toi[0] = event.getMessage().getContent();
+ toi[1] = "";
+ toi[2] = "";
+ toi[3] = "";
+ MainBot.historique.put(user, toi);
+ }
+ /**********************************
+ * AFFICHAGE DE HISTORIQUE *
+ **********************************/
+
+
+
+
+ /********************************************
+ * Comptage du nombre de message *
+ ********************************************/
+ if(MainBot.message_compteur.containsKey(user))// Si le user a deja posté un message
+ {
+ int cpt = MainBot.message_compteur.get(user);
+ cpt++;
+ //System.out.println("compteur : "+cpt);
+ MainBot.message_compteur.put(user, cpt);
+ if(cpt > 5){
+ MainBot.message_compteur.put(user,0);
+ spam = 1;
+ System.out.println(entete.get("Info","MODERATEUR")+"Detection de spam pour "+user.getEffectiveName()+"avec 5 message en 5seg: ");
+ String[] histo = MainBot.historique.get(user);
+ for (String unMessage:histo ) //=for(int i=0; i=1)
+ {
+ String argsString = args[0];
+ //System.out.println(argsString);
+ if (MainBot.commandes.containsKey(argsString))
+ {
+ System.out.println(entete.get("Info","HELP")+"Aide demmander pour la cmd "+argsString+" par "+event.getMember().getEffectiveName());
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n\n"+MainBot.commandes.get(argsString).help(args)).queue();
+
+
+ }
+ else
+ {
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Commande Inconue!__** :warning:").queue();
+ System.out.println(entete.get("Info","HELP")+"Commande Inconnue!");
+ }
+ }
+ else
+ {
+ String txt="";
+ for (Map.Entry e : MainBot.commandes.entrySet()) {
+ txt=txt+"\n//"+e.getKey();
+
+ }
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:arrow_right:\t**__commandes envoyées par message privé__**").queue();
+ event.getAuthor().getPrivateChannel().sendMessage("Commandes du bot:\n\n```"+txt+"```\n\nUtilise `//help ` pour plus de détails.").queue();
+
+
+
+
+ }
+
+
+ }
+
+ @Override
+ public String help(String[] args) {
+ return null;
+ }
+
+ @Override
+ public void executed(boolean success, MessageReceivedEvent event) {
+
+ }
+}
diff --git a/src/net/borken/commandes/Move.java b/src/net/borken/commandes/Move.java
new file mode 100644
index 0000000..5432b14
--- /dev/null
+++ b/src/net/borken/commandes/Move.java
@@ -0,0 +1,173 @@
+package net.borken.commandes;
+
+import com.sun.org.apache.bcel.internal.generic.GOTO;
+import com.sun.org.apache.xpath.internal.operations.Bool;
+import net.borken.Commande;
+import net.borken.Outils.Entete;
+import net.dv8tion.jda.core.entities.Guild;
+import net.dv8tion.jda.core.entities.Member;
+import net.dv8tion.jda.core.entities.Role;
+import net.dv8tion.jda.core.entities.User;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+import net.dv8tion.jda.core.exceptions.RateLimitedException;
+import net.dv8tion.jda.core.managers.GuildController;
+import net.dv8tion.jda.core.managers.GuildManager;
+import org.apache.commons.lang3.ObjectUtils;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Created by seb65 on 20/10/2016.
+ */
+
+/**
+ *
+ */
+public class Move implements Commande {
+
+
+ private String HELP="`//move <@utilisateur> <@rĂ´leCible>`\n:arrow_right:\t*Deplacement d'un utilisateur vers un rĂ´le cible, attention Ă bien faire des montions.*";
+ public List saveRoleUser;
+ public Member user;
+ public Guild serveur;
+ public GuildManager serveurManager;
+ public GuildController guildController;
+ public static Entete entete=new Entete();
+
+ /**
+ *
+ * @param user
+ * @param cible
+ * @param reset
+ * @param serveur
+ * @param serveurManager
+ * @return
+ */
+ public boolean exc(Member user, Role cible , boolean reset, Guild serveur, GuildManager serveurManager)
+ {
+ guildController = new GuildController(serveur);
+ boolean erreur = false;
+ List allRoll = serveur.getRoles();
+ System.out.println();
+
+
+ //On recupere les roles de l'utilisateur
+
+ List roleUserList = user.getRoles();
+ System.out.println();
+ System.out.println(entete.get("Info","MOVER")+"Roles de " + user.getEffectiveName() + ":");
+
+ //On les save
+ saveRoleUser = roleUserList;
+
+ //Ajout du role cible
+
+ //On transforme la le role a ajouter en une liste pour pouvoir l'utiliser dans modifyMemberRoles
+ Collection temp = new ArrayList<>();
+ temp.add(cible);
+
+ //on fait ensuite les modif
+ guildController.modifyMemberRoles(user,temp,saveRoleUser).queue();
+
+ System.out.println(entete.get("Info","MOVER")+"Role " + cible + " attribuer a " + user.getEffectiveName());
+
+ this.user=user;
+ this.serveur=serveur;
+ this.serveurManager=serveurManager;
+ return erreur;
+ }
+
+ @Override
+
+ public boolean called(String[] args, MessageReceivedEvent event) {
+ return false;
+ }
+
+ /**
+ *
+ * @param args
+ * @param event
+ */
+ public void action(String[] args, MessageReceivedEvent event)
+ {
+ if(args.length>=2)
+ {
+ serveur=event.getGuild();
+ List userL = event.getMessage().getMentionedUsers();
+ List roleL = event.getMessage().getMentionedRoles();
+
+ if(userL.size()<1 ||roleL.size()<1)
+ {
+ System.out.println(entete.get("ERREUR","MOVE")+"Mentionnement Incorect.");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Erreur de déplacement__** :warning:\n:arrow_right: Erreur, Utilisateur ou Role mal mentioner. `//help move` pour plus d'info ").queue();
+ }
+ else
+ {
+ System.out.println(userL.get(0));
+ user = serveur.getMember(userL.get(0));
+ Role roleCible = roleL.get(0);
+ serveur=event.getGuild();
+ System.out.println(entete.get("Info","CMD")+"Tentative de déplacement de "+user.getEffectiveName()+" vers "+roleCible.getName()+" par l'utilisateur "+event.getAuthor().getName());
+ if(event.getMember().getRoles().contains(serveur.getRolesByName("Big_Daddy",false).get(0)))
+ {
+
+ System.out.println(entete.get("Info","MOVE")+"Autorisation suffisante, deplacement autorisé");
+ System.out.println(entete.get("Info","MOVE")+"Utilisateur trouvée");
+ boolean erreur=this.exc(user,roleCible,true,serveur,serveur.getManager());
+ if(erreur)
+ {
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Erreur de déplacement.__** :warning:\n:arrow_right: Verifier le rôle cible. ").queue();
+ }
+ else
+ {
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:ok: **DĂ©placement de "+user.getEffectiveName()+" vers "+roleCible.getName()+" reussi.** :ok:").queue();
+ }
+ }
+ else
+ {
+ System.out.println(entete.get("Info","MOVE")+"Autorisation insuffisante, deplacement refusé");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Vous n'avez pas l'autorisation de faire ca!__**:warning: ").queue();
+
+ }
+ }
+
+ }
+ else
+ {
+ System.out.println(entete.get("ERREUR","MOVE")+"Arguments maquant.");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Erreur de déplacement__** :warning:\n:arrow_right: Arguments manquant. `//help move` pour plus d'info ").queue();
+
+ }
+
+
+
+
+
+
+
+ }
+
+ /**
+ *
+ * @param args
+ * @return
+ */
+ @Override
+ public String help(String[] args) {
+ return HELP;
+ }
+
+ /**
+ *
+ * @param success
+ * @param event
+ */
+ @Override
+ public void executed(boolean success, MessageReceivedEvent event) {
+
+ }
+
+}
diff --git a/src/net/borken/commandes/Over18/Ass.java b/src/net/borken/commandes/Over18/Ass.java
new file mode 100644
index 0000000..1d57a28
--- /dev/null
+++ b/src/net/borken/commandes/Over18/Ass.java
@@ -0,0 +1,52 @@
+package net.borken.commandes.Over18;
+
+import net.borken.Commande;
+import net.borken.Outils.Entete;
+import net.borken.Outils.Redirection;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+import net.dv8tion.jda.core.exceptions.RateLimitedException;
+
+import java.awt.*;
+import java.io.IOException;
+
+/**
+ * Created by seb65 on 07/11/2016.
+ */
+public class Ass implements Commande{
+ public String HELP="T'es sérieux la?";
+ Entete entete= new Entete();
+
+ @Override
+ public boolean called(String[] args, MessageReceivedEvent event) {
+ return false;
+ }
+
+ @Override
+ public void action(String[] args, MessageReceivedEvent event) {
+ if(event.getTextChannel().getName().equals("over18")) {
+ Redirection redirect= new Redirection();
+ try {
+ event.getTextChannel().sendMessage(redirect.get("http://les400culs.com/random")).queue();
+ System.out.println(entete.get("ERREUR","Ass")+"Erreur de redirection.");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ else
+ {
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").queue();
+
+ System.out.println(entete.get("ERREUR","Ass")+"Erreur chanel.");
+ }
+ }
+
+ @Override
+ public String help(String[] args) {
+ return HELP;
+ }
+
+ @Override
+ public void executed(boolean success, MessageReceivedEvent event) {
+
+ }
+}
diff --git a/src/net/borken/commandes/Over18/Boobs.java b/src/net/borken/commandes/Over18/Boobs.java
new file mode 100644
index 0000000..fb1184b
--- /dev/null
+++ b/src/net/borken/commandes/Over18/Boobs.java
@@ -0,0 +1,49 @@
+package net.borken.commandes.Over18;
+
+import net.borken.Commande;
+import net.borken.Outils.Entete;
+import net.borken.Outils.Redirection;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+import net.dv8tion.jda.core.exceptions.RateLimitedException;
+
+import java.io.IOException;
+
+/**
+ * Created by seb65 on 07/11/2016.
+ */
+public class Boobs implements Commande {
+ public String HELP="T'es sérieux la?";
+ Entete entete=new Entete();
+
+ @Override
+ public boolean called(String[] args, MessageReceivedEvent event) {
+ return false;
+ }
+
+ @Override
+ public void action(String[] args, MessageReceivedEvent event) {
+ if(event.getTextChannel().getName().equals("over18")) {
+ Redirection redirect = new Redirection();
+ try {
+ event.getTextChannel().sendMessage(redirect.get("http://lesaintdesseins.fr/random")).queue();
+ } catch (IOException e) {
+ System.out.println(entete.get("ERREUR", "Boobs") + "Erreur de redirection.");
+ }
+ }
+ else
+ {
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").queue();
+ System.out.println(entete.get("ERREUR","Boobs")+"Erreur chanel.");
+ }
+ }
+
+ @Override
+ public String help(String[] args) {
+ return HELP;
+ }
+
+ @Override
+ public void executed(boolean success, MessageReceivedEvent event) {
+
+ }
+}
diff --git a/src/net/borken/commandes/Over18/Madame.java b/src/net/borken/commandes/Over18/Madame.java
new file mode 100644
index 0000000..2bbf4ca
--- /dev/null
+++ b/src/net/borken/commandes/Over18/Madame.java
@@ -0,0 +1,51 @@
+package net.borken.commandes.Over18;
+
+import net.borken.Commande;
+import net.borken.Outils.Redirection;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+import net.dv8tion.jda.core.exceptions.RateLimitedException;
+
+import java.io.IOException;
+
+import static net.borken.MainBot.entete;
+
+/**
+ * Created by seb65 on 11/11/2016.
+ */
+public class Madame implements Commande{
+ public String HELP="T'es sérieux la?";
+ @Override
+ public boolean called(String[] args, MessageReceivedEvent event) {
+ return false;
+ }
+
+ @Override
+ public void action(String[] args, MessageReceivedEvent event) {
+ if(!event.getTextChannel().getName().equals("le_cours")) {
+ Redirection redirect = new Redirection();
+ try {
+ event.getTextChannel().sendMessage(redirect.get("http://dites.bonjourmadame.fr/random")).queue();
+ } catch (IOException e) {
+ System.out.println(entete.get("ERREUR", "Madame") + "Erreur de redirection.");
+
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur de redirection, RĂ©essayez__**:warning: ").queue();
+ }
+ }
+ else
+ {
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé!__**:warning: ").queue();
+
+ System.out.println(entete.get("ERREUR","Madame")+"Erreur chanel.");
+ }
+ }
+
+ @Override
+ public String help(String[] args) {
+ return HELP;
+ }
+
+ @Override
+ public void executed(boolean success, MessageReceivedEvent event) {
+
+ }
+}
diff --git a/src/net/borken/commandes/Over18/Pipe.java b/src/net/borken/commandes/Over18/Pipe.java
new file mode 100644
index 0000000..7f5f6d2
--- /dev/null
+++ b/src/net/borken/commandes/Over18/Pipe.java
@@ -0,0 +1,53 @@
+package net.borken.commandes.Over18;
+
+import net.borken.Commande;
+import net.borken.Outils.Entete;
+import net.borken.Outils.Redirection;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+import net.dv8tion.jda.core.exceptions.RateLimitedException;
+
+import java.io.IOException;
+
+/**
+ * Created by seb65 on 07/11/2016.
+ */
+public class Pipe implements Commande {
+ public String HELP="T'es sérieux la?";
+ Entete entete = new Entete();
+ @Override
+ public boolean called(String[] args, MessageReceivedEvent event) {
+ return false;
+ }
+
+ @Override
+ public void action(String[] args, MessageReceivedEvent event) {
+ Redirection redirect= new Redirection();
+ if(event.getTextChannel().getName().equals("over18"))
+ {
+
+ try {
+ event.getTextChannel().sendMessage(redirect.get("http://feelation.com/random")).queue();
+ } catch (IOException e) {
+ System.out.println(entete.get("ERREUR", "Pipe") + "Erreur de redirection.");
+ }
+ }
+ else
+ {
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").queue();
+
+ System.out.println(entete.get("ERREUR","Pipe")+"Erreur chanel.");
+ }
+
+
+ }
+
+ @Override
+ public String help(String[] args) {
+ return HELP;
+ }
+
+ @Override
+ public void executed(boolean success, MessageReceivedEvent event) {
+
+ }
+}
diff --git a/src/net/borken/commandes/Over18/SM.java b/src/net/borken/commandes/Over18/SM.java
new file mode 100644
index 0000000..8bc9b33
--- /dev/null
+++ b/src/net/borken/commandes/Over18/SM.java
@@ -0,0 +1,52 @@
+package net.borken.commandes.Over18;
+
+import net.borken.Commande;
+import net.borken.Outils.Entete;
+import net.borken.Outils.Redirection;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+import net.dv8tion.jda.core.exceptions.RateLimitedException;
+
+import java.io.IOException;
+
+/**
+ * Created by seb65 on 10/11/2016.
+ */
+public class SM implements Commande {
+ public String HELP="T'es sérieux la?";
+ Entete entete = new Entete();
+ @Override
+ public boolean called(String[] args, MessageReceivedEvent event) {
+ return false;
+ }
+
+ @Override
+ public void action(String[] args, MessageReceivedEvent event) {
+ Redirection redirect= new Redirection();
+ if(event.getTextChannel().getName().equals("over18"))
+ {
+ try {
+ event.getTextChannel().sendMessage(redirect.get("http://bonjourfetish.tumblr.com/random")).queue();
+ } catch (IOException e) {
+ System.out.println(entete.get("ERREUR","Pipe")+"Erreur de redirection.");
+ }
+ }
+ else
+ {
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").queue();
+
+ System.out.println(entete.get("ERREUR","SM")+"Erreur chanel.");
+ }
+
+
+ }
+
+ @Override
+ public String help(String[] args) {
+ return HELP;
+ }
+
+ @Override
+ public void executed(boolean success, MessageReceivedEvent event) {
+
+ }
+}
diff --git a/src/net/borken/commandes/PingCommande.java b/src/net/borken/commandes/PingCommande.java
new file mode 100644
index 0000000..f77bd3b
--- /dev/null
+++ b/src/net/borken/commandes/PingCommande.java
@@ -0,0 +1,39 @@
+package net.borken.commandes;
+
+import net.borken.Commande;
+import net.borken.Outils.Entete;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+import net.dv8tion.jda.core.exceptions.RateLimitedException;
+
+/**
+ * Created by seb65 on 19/10/2016.
+ */
+public class PingCommande implements Commande {
+
+
+ private String HELP = "`//ping` \n :arrow_right:\t*Le bot vous répondra Pong!*";
+ @Override
+ public boolean called(String[] args, MessageReceivedEvent event) {
+ return true;
+ }
+
+ @Override
+ public void action(String[] args, MessageReceivedEvent event) {
+
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+" Pong!").queue();
+ System.out.println("pong");
+ }
+
+ @Override
+ public String help(String[] args) {
+
+ return HELP;
+ }
+
+ @Override
+ public void executed(boolean success, MessageReceivedEvent event)
+ {
+ return;
+
+ }
+}
diff --git a/src/net/borken/commandes/Spam.java b/src/net/borken/commandes/Spam.java
new file mode 100644
index 0000000..b384cbf
--- /dev/null
+++ b/src/net/borken/commandes/Spam.java
@@ -0,0 +1,322 @@
+package net.borken.commandes;
+
+import net.borken.Commande;
+import net.borken.MainBot;
+import net.borken.Outils.AntiSpam;
+import net.borken.Outils.Entete;
+import net.dv8tion.jda.core.entities.Guild;
+import net.dv8tion.jda.core.entities.Member;
+import net.dv8tion.jda.core.entities.Role;
+import net.dv8tion.jda.core.entities.User;
+import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
+import net.dv8tion.jda.core.exceptions.RateLimitedException;
+
+
+import java.util.List;
+import java.util.Objects;
+
+
+/**
+ * Created by seb65 on 27/10/2016.
+ */
+public class Spam implements Commande {
+ Entete entete =new Entete();
+ @Override
+ public boolean called(String[] args, MessageReceivedEvent event) {
+ return false;
+ }
+
+ @Override
+ public void action(String[] args, MessageReceivedEvent event)
+ {
+ /****************************
+ * Verif argument *
+ ****************************/
+ if(args.length>=1)
+ {
+
+ String commande = args[0];
+ /****************************
+ * on traite la commande *
+ ****************************/
+ switch (commande) {
+
+ case "pardon":
+ this.pardon(event,args);
+ break;
+
+ case "extermine":
+ try {
+ this.extermine(event,args);
+ } catch (RateLimitedException e) {
+ e.printStackTrace();
+ }
+
+ break;
+
+ case "reset":
+ try {
+ this.reset(event,args);
+ } catch (RateLimitedException e) {
+ e.printStackTrace();
+ }
+ break;
+
+
+
+ }
+
+ }
+ }
+
+
+
+
+ @Override
+ public String help(String[] args)
+ {
+ return "`//spam extermine <@utilisateur> `\n:arrow_right:\t*Punir un spammeur.*\n\n`//spam pardon <@utilisateur>`\n:arrow_right:\t*Anuller la punition d'un utilisateur.*\n\n`//spam reset <@utilisateur>`\n:arrow_right:\t*RAZ du multiplicateur d'un utilisateur.*";
+ }
+
+ @Override
+ public void executed(boolean success, MessageReceivedEvent event)
+ {
+
+ }
+
+ public void pardon(MessageReceivedEvent event, String[] args){
+
+ Guild serveur = event.getGuild();
+ /****************************
+ * verif argument *
+ ****************************/
+ if (args.length >= 1)
+ {
+ /****************************
+ * On recupere l'utilisateur et le role cible
+ ****************************/
+ List userL = event.getMessage().getMentionedUsers();
+
+
+ /****************************
+ * verif utilisteur trouver *
+ ****************************/
+ if(userL.size()<1)
+ {
+ System.out.println(entete.get("ERREUR", "CMD") + "Utilisateur introuvable.");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur introuvable. ");
+ }
+ else {
+ Member user = serveur.getMember(userL.get(0));
+ System.out.println(entete.get("Info", "CMD") + "Tentative de pardon de " + user.getEffectiveName() + " par l'utilisateur " + event.getMember().getEffectiveName());
+ /****************************
+ * c'est un big dady *
+ ****************************/
+
+ if (event.getMember().getRoles().get(0)==serveur.getRolesByName("Big_Daddy",false).get(0)) {
+ System.out.println(entete.get("Info", "CMD") + "Autorisation suffisante, pardon autorisé");
+
+ /****************************
+ * virif si en spammer *
+ ****************************/
+ if (MainBot.minuteurStatut.containsKey(user)) {
+ if (MainBot.minuteurStatut.get(user)) {
+ MainBot.minuteurStatut.put(user, false);
+ } else {
+ System.out.println(entete.get("ERREUR", "CMD") + "Utilisateur pas en spam.");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur non spammeur. ");
+ }
+
+
+ } else {
+ System.out.println(entete.get("ERREUR", "CMD") + "Utilisateur pas en spam.");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur non spammeur. ");
+ }
+
+ } else {
+ System.out.println(entete.get("Info", "CMD") + "Autorisation insuffisante, pardon refusé");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:no_entry_sign: **__Vous n'avez pas l'autorisation de faire sa!__** :no_entry_sign: ");
+ }
+ }
+ }
+ else
+ {
+ System.out.println(entete.get("Info","ERREUR")+"Argument manquant.");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Argument manquant__**:warning: \n:arrow_right: Utilisation: `//spam pardon <@utilisateur>`.");
+ }
+
+
+ }
+
+ public void extermine(MessageReceivedEvent event, String[] args) throws RateLimitedException {
+ /****************************
+ * verif argument *
+ ****************************/
+ if (args.length >= 3)
+ {
+ /****************************
+ * On recupere l'utilisateur et le role cible
+ ****************************/
+ List userL = event.getMessage().getMentionedUsers();
+
+
+ /****************************
+ * verif utilisteur trouver *
+ ****************************/
+ if(userL.size()<1)
+ {
+ System.out.println(entete.get("ERREUR","CMD")+"Mentionnement Incorect (Spam).");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Erreur__** :warning:\n:arrow_right: Erreur, Utilisateur mal mentioner. `//help spam extermine` pour plus d'info ").queue();
+ }
+ else{
+
+
+ Guild serveur = event.getGuild();
+ Member user = serveur.getMember(userL.get(0));
+ System.out.println(entete.get("Info","CMD")+"Tentative d'extermination de "+user.getEffectiveName()+" par l'utilisateur "+event.getAuthor().getName());
+ /****************************
+ * c'est un big dady *
+ ****************************/
+
+ if(event.getMember().getRoles().get(0)==serveur.getRolesByName("Big_Daddy",false).get(0))
+ {
+ System.out.println(entete.get("Info","CMD")+"Autorisation suffisante, extermination autorisé");
+ String multiStr =args[2];
+
+
+ /****************************
+ * virif pas deja en spammer *
+ ****************************/
+ if(MainBot.minuteurStatut.containsKey(user))
+ {
+ if(!MainBot.minuteurStatut.get(user))
+ {
+ this.goSpam(user,multiStr,serveur,event);
+ }
+ else
+ {
+ System.out.println(entete.get("ERREUR","CMD")+"Utilisateur deja en spam.");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur déjà spammeur. ").queue();
+ }
+
+
+ }
+ else
+ {
+ this.goSpam(user,multiStr,serveur,event);
+ }
+
+ }
+ else
+ {
+ System.out.println(entete.get("Info","CMD")+"Autorisation insuffisante, extermination refusé");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:no_entry_sign: **__Vous n'avez pas l'autorisation de faire sa!__** :no_entry_sign: ").queue();
+ }
+
+ }
+
+
+ }
+ else
+ {
+ System.out.println(entete.get("Info","ERREUR")+"Argument manquant.");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Argument manquant__**:warning: \n:arrow_right: Utilisation: `//spam extermine `.").queue();
+ }
+ }
+
+ public void reset(MessageReceivedEvent event, String[] args) throws RateLimitedException {
+ if(event!=null)
+ {
+ if(args.length>=2)
+ {
+
+ Guild serveur = event.getGuild();
+ /****************************
+ * On recupere l'utilisateur et le role cible
+ ****************************/
+ List userL = event.getMessage().getMentionedUsers();
+
+
+ /****************************
+ * verif utilisteur trouver *
+ ****************************/
+ if(userL.size()<1)
+ {
+ System.out.println(entete.get("ERREUR", "CMD") + "Utilisateur introuvable.");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur introuvable. ").queue();
+
+ }
+ else {
+ Member user = serveur.getMember(userL.get(0));
+ System.out.println(entete.get("Info", "CMD") + "Tentative de reset de " + user.getEffectiveName() + " par l'utilisateur " + event.getMember().getEffectiveName());
+ /****************************
+ * c'est un big dady *
+ ****************************/
+
+ if ( event.getMember().getRoles().get(0) == serveur.getRolesByName("Big_Daddy", false).get(0)) {
+ System.out.println(entete.get("Info", "CMD") + "Autorisation suffisante, pardon autorisé");
+ /****************************
+ * verif utilisteur trouver *
+ ****************************/
+ if (MainBot.userMulti.containsKey(user)) {
+ System.out.println(entete.get("Info", "CMD") + "Reset du multiplicateur de " + user.getEffectiveName() + " réussi");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n *Le multiplcicateur de " + user.getEffectiveName() + " a été remit a zéro.*").queue();
+ MainBot.userMulti.remove(user);
+
+ }
+ } else {
+ System.out.println(entete.get("Info", "CMD") + "Autorisation insuffisante, reset refusé");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:no_entry_sign: **__Vous n'avez pas l'autorisation de faire ca!__** :no_entry_sign: ").queue();
+
+ }
+ }
+ }
+ else
+ {
+ System.out.println(entete.get("Info","ERREUR")+"Argument manquant.");
+ event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Argument manquant__**:warning: \n:arrow_right: Utilisation: `//spam reset `.").queue();
+ }
+ }
+ else
+ {
+ if (args[0].equals("all"))
+ {
+ System.out.println(entete.get("Info","AutoReset")+"Reset automatique des multiplicateur.");
+ for (Member unUser: MainBot.userMulti.keySet() ) //=for(int i=0; i