Changing Log System
Switching to Log4J2 system
This commit is contained in:
parent
475c968a94
commit
1615bea3ae
BIN
Libraries/JDA-3.0/JDA-3.0.BETA_98-sources.jar
Normal file
BIN
Libraries/JDA-3.0/JDA-3.0.BETA_98-sources.jar
Normal file
Binary file not shown.
BIN
Libraries/Log4j-2.7/log4j-api-2.7-javadoc.jar
Normal file
BIN
Libraries/Log4j-2.7/log4j-api-2.7-javadoc.jar
Normal file
Binary file not shown.
BIN
Libraries/Log4j-2.7/log4j-api-2.7-sources.jar
Normal file
BIN
Libraries/Log4j-2.7/log4j-api-2.7-sources.jar
Normal file
Binary file not shown.
BIN
Libraries/Log4j-2.7/log4j-api-2.7.jar
Normal file
BIN
Libraries/Log4j-2.7/log4j-api-2.7.jar
Normal file
Binary file not shown.
BIN
Libraries/Log4j-2.7/log4j-core-2.7-javadoc.jar
Normal file
BIN
Libraries/Log4j-2.7/log4j-core-2.7-javadoc.jar
Normal file
Binary file not shown.
BIN
Libraries/Log4j-2.7/log4j-core-2.7-sources.jar
Normal file
BIN
Libraries/Log4j-2.7/log4j-core-2.7-sources.jar
Normal file
Binary file not shown.
BIN
Libraries/Log4j-2.7/log4j-core-2.7.jar
Normal file
BIN
Libraries/Log4j-2.7/log4j-core-2.7.jar
Normal file
Binary file not shown.
29
log4j2.xml
Normal file
29
log4j2.xml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Configuration status="error">
|
||||||
|
<Appenders>
|
||||||
|
<Console name="Console" target="SYSTEM_OUT">
|
||||||
|
<PatternLayout pattern="%highlight{[%d{HH:mm:ss.SSS}][%-5level]%logger{36}: %msg%n}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}" />
|
||||||
|
<!--{FATAL=red blink, ERROR=red, WARN=orange, INFO=yellow, DEBUG=green bold, TRACE=blue}-->
|
||||||
|
</Console>
|
||||||
|
<!--
|
||||||
|
<RollingFile name="RollingFile" fileName="/home/pi/Interface/logs/domo.log"
|
||||||
|
filePattern="/home/pi/Interface/logs/$${date:yyyy-MM}/domo-%d{yyyy-MM-dd-HH}-%i.log.gz">
|
||||||
|
<PatternLayout>
|
||||||
|
<Pattern>[%d{yyy-MM-dd ~ HH:mm:ss.SSS}][%-5level]%logger{36}: %msg%n</Pattern>
|
||||||
|
</PatternLayout>
|
||||||
|
<Policies>
|
||||||
|
<OnStartupTriggeringPolicy minSize="1B"/>
|
||||||
|
<TimeBasedTriggeringPolicy/>
|
||||||
|
<SizeBasedTriggeringPolicy size="250 MB"/>
|
||||||
|
</Policies>
|
||||||
|
</RollingFile>
|
||||||
|
-->
|
||||||
|
</Appenders>
|
||||||
|
<Loggers>
|
||||||
|
<Root level="debug">
|
||||||
|
<AppenderRef ref="Console" level="trace"/>
|
||||||
|
<!-- <AppenderRef ref="RollingFile" level="info"/>-->
|
||||||
|
</Root>
|
||||||
|
|
||||||
|
</Loggers>
|
||||||
|
</Configuration>
|
@ -1,5 +0,0 @@
|
|||||||
[.ShellClassInfo]
|
|
||||||
InfoTip=Ce dossier est partagé en ligne.
|
|
||||||
IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe
|
|
||||||
IconIndex=16
|
|
||||||
|
|
@ -5,9 +5,15 @@ import net.borken.Outils.Moderateur;
|
|||||||
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.User;
|
import net.dv8tion.jda.core.entities.User;
|
||||||
|
import net.dv8tion.jda.core.events.DisconnectEvent;
|
||||||
|
import net.dv8tion.jda.core.events.ReadyEvent;
|
||||||
|
import net.dv8tion.jda.core.events.ReconnectedEvent;
|
||||||
|
import net.dv8tion.jda.core.events.StatusChangeEvent;
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.core.hooks.ListenerAdapter;
|
import net.dv8tion.jda.core.hooks.ListenerAdapter;
|
||||||
import net.dv8tion.jda.core.managers.GuildManager;
|
import net.dv8tion.jda.core.managers.GuildManager;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -17,6 +23,16 @@ import net.dv8tion.jda.core.managers.GuildManager;
|
|||||||
public class BotListener extends ListenerAdapter {
|
public class BotListener extends ListenerAdapter {
|
||||||
AntiSpam antispam=new AntiSpam();
|
AntiSpam antispam=new AntiSpam();
|
||||||
Moderateur modo = new Moderateur();
|
Moderateur modo = new Moderateur();
|
||||||
|
Logger logger = LogManager.getLogger();
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReady(ReadyEvent event) {
|
||||||
|
logger.info("Connection succees");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessageReceived(MessageReceivedEvent event) {
|
public void onMessageReceived(MessageReceivedEvent event) {
|
||||||
// ----------------------Test pour eviter eco de commande-------------------------
|
// ----------------------Test pour eviter eco de commande-------------------------
|
||||||
@ -52,9 +68,9 @@ public class BotListener extends ListenerAdapter {
|
|||||||
}catch (Exception e)
|
}catch (Exception e)
|
||||||
{
|
{
|
||||||
if (e.getMessage()==null) {
|
if (e.getMessage()==null) {
|
||||||
System.out.println(MainBot.entete.get("ERREUR", "BotListener") +"NullPointerException");
|
logger.error("NullPointerException");
|
||||||
} else {
|
} else {
|
||||||
System.out.println(MainBot.entete.get("ERREUR", "BotListener") + e.getMessage());
|
logger.error(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,30 +1,31 @@
|
|||||||
package net.borken;
|
package net.borken;
|
||||||
|
|
||||||
import enigma.console.Console;
|
|
||||||
import enigma.console.TextAttributes;
|
|
||||||
import enigma.core.Enigma;
|
|
||||||
import net.borken.Outils.CommandParser;
|
import net.borken.Outils.CommandParser;
|
||||||
import net.borken.Outils.DayListener;
|
import net.borken.Outils.DayListener;
|
||||||
import net.borken.Outils.Entete;
|
|
||||||
import net.borken.Outils.Redirection;
|
import net.borken.Outils.Redirection;
|
||||||
import net.borken.commandes.*;
|
import net.borken.commandes.Help;
|
||||||
|
import net.borken.commandes.Move;
|
||||||
import net.borken.commandes.Over18.*;
|
import net.borken.commandes.Over18.*;
|
||||||
|
import net.borken.commandes.PingCommande;
|
||||||
|
import net.borken.commandes.Spam;
|
||||||
import net.dv8tion.jda.core.*;
|
import net.dv8tion.jda.core.AccountType;
|
||||||
|
import net.dv8tion.jda.core.JDA;
|
||||||
|
import net.dv8tion.jda.core.JDABuilder;
|
||||||
|
import net.dv8tion.jda.core.OnlineStatus;
|
||||||
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.User;
|
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
||||||
import net.dv8tion.jda.core.managers.GuildManager;
|
import net.dv8tion.jda.core.managers.GuildManager;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import javax.security.auth.login.LoginException;
|
import javax.security.auth.login.LoginException;
|
||||||
import java.awt.*;
|
import java.io.IOException;
|
||||||
import java.io.*;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by seb65 on 19/10/2016.
|
* Created by seb65 on 19/10/2016.
|
||||||
@ -35,36 +36,29 @@ public class MainBot {
|
|||||||
public static final CommandParser parser =new CommandParser();
|
public static final CommandParser parser =new CommandParser();
|
||||||
public static HashMap<String, Commande> commandes = new HashMap<>();
|
public static HashMap<String, Commande> commandes = new HashMap<>();
|
||||||
public static boolean okInit=false;
|
public static boolean okInit=false;
|
||||||
public static Entete entete=new Entete();
|
|
||||||
public static HashMap<Member, String[]> historique =new HashMap<>();
|
public static HashMap<Member, String[]> historique =new HashMap<>();
|
||||||
public static HashMap<Member, Integer> message_compteur =new HashMap<>();
|
public static HashMap<Member, Integer> message_compteur =new HashMap<>();
|
||||||
|
|
||||||
public static Hashtable<Member,Integer> userMulti = new Hashtable();
|
public static Hashtable<Member,Integer> userMulti = new Hashtable();
|
||||||
public static Hashtable<Member,Boolean> minuteurStatut = new Hashtable<>();
|
public static Hashtable<Member,Boolean> minuteurStatut = new Hashtable<>();
|
||||||
|
|
||||||
public static TextAttributes txtColor;
|
static Logger logger = LogManager.getLogger();
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
|
logger.trace("trace");
|
||||||
|
logger.debug("debug");
|
||||||
|
logger.info("info");
|
||||||
|
logger.warn("warn");
|
||||||
|
logger.error("error");
|
||||||
Stop stopTh=new Stop();
|
Stop stopTh=new Stop();
|
||||||
stopTh.start();
|
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 *
|
* Initialisation *
|
||||||
****************************/
|
****************************/
|
||||||
System.out.println("-------------------INITIALISATION-------------------");
|
logger.info("-------------------INITIALISATION-------------------");
|
||||||
txtColor = new TextAttributes(Color.blue, Color.black);
|
|
||||||
s_console.setTextAttributes(txtColor);
|
|
||||||
//Bot démarrer sans token
|
//Bot démarrer sans token
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
System.out.println();
|
logger.fatal("Veuilliez indiquer le token du bot en argument...");
|
||||||
System.err.println(entete.get("ERREUR","INIT")+"Veuilliez indiquer le token du bot en argument...");
|
|
||||||
okInit=false;
|
okInit=false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -72,18 +66,20 @@ public class MainBot {
|
|||||||
//Token présent
|
//Token présent
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
System.out.println();
|
|
||||||
System.out.println(entete.get("Info","INIT")+"Connection au serveur...");
|
logger.info("Connection au serveur...");
|
||||||
//connection au bot
|
//connection au bot
|
||||||
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();
|
||||||
|
|
||||||
okInit=true;
|
okInit=true;
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (LoginException | InterruptedException | RateLimitedException e)
|
catch (LoginException | InterruptedException | RateLimitedException e)
|
||||||
{
|
{
|
||||||
System.out.println();
|
logger.catching(e);
|
||||||
System.err.println(entete.get("ERREUR","INIT")+e.getMessage());
|
|
||||||
okInit=false;
|
okInit=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -112,36 +108,30 @@ public class MainBot {
|
|||||||
|
|
||||||
//on recupere les utilisateur conecter
|
//on recupere les utilisateur conecter
|
||||||
List<Member> utilisateurCo = serveur.getMembers();
|
List<Member> utilisateurCo = serveur.getMembers();
|
||||||
System.out.println();
|
|
||||||
System.out.println(entete.get("Info","INIT")+"Utilisatieur connecté: ");
|
logger.info("Utilisatieur connecté: ");
|
||||||
for (Member anUtilisateurCo : utilisateurCo) //= for(int i=0; i<utilisateurCo.size(); i++)
|
for (Member anUtilisateurCo : utilisateurCo) //= for(int i=0; i<utilisateurCo.size(); i++)
|
||||||
{
|
{
|
||||||
if(anUtilisateurCo.getOnlineStatus().equals(OnlineStatus.ONLINE))
|
if(anUtilisateurCo.getOnlineStatus().equals(OnlineStatus.ONLINE))
|
||||||
System.out.println(entete.get("Info", "INIT") + " *" + anUtilisateurCo.getEffectiveName()); //anUtilisateurCo = utilisateurCo.get(i)
|
logger.info("\t*" + anUtilisateurCo.getEffectiveName()); //anUtilisateurCo = utilisateurCo.get(i)
|
||||||
}
|
}
|
||||||
System.out.println();
|
logger.info("Utilisatieur absent: ");
|
||||||
System.out.println(entete.get("Info","INIT")+"Utilisatieur absent: ");
|
|
||||||
for (Member anUtilisateurCo : utilisateurCo) //= for(int i=0; i<utilisateurCo.size(); i++)
|
for (Member anUtilisateurCo : utilisateurCo) //= for(int i=0; i<utilisateurCo.size(); i++)
|
||||||
{
|
{
|
||||||
if(anUtilisateurCo.getOnlineStatus().equals(OnlineStatus.DO_NOT_DISTURB))
|
if(anUtilisateurCo.getOnlineStatus().equals(OnlineStatus.DO_NOT_DISTURB))
|
||||||
System.out.println(entete.get("Info", "INIT") + " *" + anUtilisateurCo.getEffectiveName()); //anUtilisateurCo = utilisateurCo.get(i)
|
logger.info("\t*" + anUtilisateurCo.getEffectiveName()); //anUtilisateurCo = utilisateurCo.get(i)
|
||||||
}
|
}
|
||||||
System.out.println();
|
logger.info("Utilisatieur hors ligne: ");
|
||||||
System.out.println(entete.get("Info","INIT")+"Utilisatieur hors ligne: ");
|
|
||||||
for (Member anUtilisateurCo : utilisateurCo) //= for(int i=0; i<utilisateurCo.size(); i++)
|
for (Member anUtilisateurCo : utilisateurCo) //= for(int i=0; i<utilisateurCo.size(); i++)
|
||||||
{
|
{
|
||||||
if(anUtilisateurCo.getOnlineStatus().equals(OnlineStatus.OFFLINE))
|
if(anUtilisateurCo.getOnlineStatus().equals(OnlineStatus.OFFLINE))
|
||||||
System.out.println(entete.get("Info", "INIT") + " *" + anUtilisateurCo.getEffectiveName()); //anUtilisateurCo = utilisateurCo.get(i)
|
logger.info("\t*" + anUtilisateurCo.getEffectiveName()); //anUtilisateurCo = utilisateurCo.get(i)
|
||||||
}
|
}
|
||||||
txtColor = new TextAttributes(Color.green, Color.black);
|
|
||||||
s_console.setTextAttributes(txtColor);
|
|
||||||
ModoTimer modotimer = new ModoTimer();
|
ModoTimer modotimer = new ModoTimer();
|
||||||
modotimer.start();
|
modotimer.start();
|
||||||
DayListener dayListener =new DayListener();
|
DayListener dayListener =new DayListener();
|
||||||
dayListener.start();
|
dayListener.start();
|
||||||
System.out.println("-----------------FIN INITIALISATION-----------------");
|
logger.info("-----------------FIN INITIALISATION-----------------");
|
||||||
txtColor = new TextAttributes(Color.blue, Color.black);
|
|
||||||
s_console.setTextAttributes(txtColor);
|
|
||||||
|
|
||||||
/*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());*/
|
||||||
@ -167,7 +157,7 @@ public class MainBot {
|
|||||||
{
|
{
|
||||||
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -203,40 +193,28 @@ public class MainBot {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Console s_console;
|
|
||||||
static
|
|
||||||
{
|
|
||||||
s_console = Enigma.getConsole("Bot Discord");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static class Stop extends Thread
|
public static class Stop extends Thread
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
Scanner scanner = new Scanner(System.in);
|
||||||
String txtEntré = "";
|
String txtEntré = "";
|
||||||
while(!txtEntré.equals("o")&&!txtEntré.equals("O"))
|
while(!txtEntré.equals("o")&&!txtEntré.equals("O"))
|
||||||
{
|
{
|
||||||
|
|
||||||
while (!txtEntré.equals("stop"))
|
while (!txtEntré.equals("stop"))
|
||||||
{
|
{
|
||||||
txtEntré = s_console.readLine();
|
txtEntré = scanner.nextLine();
|
||||||
}
|
}
|
||||||
txtColor = new TextAttributes(Color.orange, Color.black);
|
|
||||||
s_console.setTextAttributes(txtColor);
|
logger.warn("Etes-vous sur de vouloir arréter le Bot? (o/n)");
|
||||||
System.out.println("Etes-vous sur de vouloir arréter le Bot? (o/n)");
|
txtEntré = scanner.nextLine();
|
||||||
txtColor = new TextAttributes(Color.blue, Color.black);
|
|
||||||
s_console.setTextAttributes(txtColor);
|
|
||||||
txtEntré = s_console.readLine();
|
|
||||||
|
|
||||||
if(txtEntré.equals("n")||txtEntré.equals("N"))
|
if(txtEntré.equals("n")||txtEntré.equals("N"))
|
||||||
{
|
{
|
||||||
txtColor = new TextAttributes(Color.green, Color.black);
|
logger.info("Arret du Bot annulé.");
|
||||||
s_console.setTextAttributes(txtColor);
|
|
||||||
System.out.println("Arret du Bot annulé.");
|
|
||||||
txtColor = new TextAttributes(Color.blue, Color.black);
|
|
||||||
s_console.setTextAttributes(txtColor);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Runtime.getRuntime().exit(0);
|
Runtime.getRuntime().exit(0);
|
||||||
|
@ -9,6 +9,8 @@ import net.dv8tion.jda.core.entities.TextChannel;
|
|||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
||||||
import net.dv8tion.jda.core.managers.GuildManager;
|
import net.dv8tion.jda.core.managers.GuildManager;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -21,8 +23,7 @@ import static java.lang.Thread.sleep;
|
|||||||
*/
|
*/
|
||||||
public class AntiSpam {
|
public class AntiSpam {
|
||||||
public Move move = new Move();
|
public Move move = new Move();
|
||||||
|
Logger logger = LogManager.getLogger();
|
||||||
public Entete entete=new Entete();
|
|
||||||
|
|
||||||
public AntiSpam() {
|
public AntiSpam() {
|
||||||
|
|
||||||
@ -59,8 +60,7 @@ public class AntiSpam {
|
|||||||
else
|
else
|
||||||
MainBot.userMulti.put(user,1);
|
MainBot.userMulti.put(user,1);
|
||||||
|
|
||||||
System.out.println();
|
logger.info("Punition de "+user.getEffectiveName()+" avec un multiplicateur de "+MainBot.userMulti.get(user));
|
||||||
System.out.println(entete.get("Info","ANTISPAM")+"Punition de "+user.getEffectiveName()+" avec un multiplicateur de "+MainBot.userMulti.get(user));
|
|
||||||
|
|
||||||
event.getTextChannel().sendMessage(user.getAsMention()+"\n```markdown\n#-----------------SPAM DETECTEUR----------------#\n# #\n# La prochaine fois tu fermeras ta gueule! #\n# #\n# On te revoit dans "+MainBot.userMulti.get(user)+"min connard ! #\n# #\n#-----------------------------------------------#```\n https://cdn.meme.am/instances/64726692.jpg ").queue();
|
event.getTextChannel().sendMessage(user.getAsMention()+"\n```markdown\n#-----------------SPAM DETECTEUR----------------#\n# #\n# La prochaine fois tu fermeras ta gueule! #\n# #\n# On te revoit dans "+MainBot.userMulti.get(user)+"min connard ! #\n# #\n#-----------------------------------------------#```\n https://cdn.meme.am/instances/64726692.jpg ").queue();
|
||||||
|
|
||||||
@ -104,8 +104,7 @@ public class AntiSpam {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
int cSeg=0;
|
int cSeg=0;
|
||||||
System.out.println();
|
logger.info("["+user.getEffectiveName()+"] Démarage pour "+multip+"min");
|
||||||
System.out.println(entete.get("Info","MINUTEUR")+"["+user.getEffectiveName()+"] Démarage pour "+multip+"min");
|
|
||||||
while (MainBot.minuteurStatut.get(user))
|
while (MainBot.minuteurStatut.get(user))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -119,11 +118,9 @@ public class AntiSpam {
|
|||||||
}
|
}
|
||||||
cSeg++;
|
cSeg++;
|
||||||
}
|
}
|
||||||
System.out.println();
|
logger.info("["+user.getEffectiveName()+"] Fin de spam pour "+user.getEffectiveName()+" apres "+multip+"min.");
|
||||||
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)
|
move.exc(user, saveRoleUser.get(0), true, serveur, serveurManager); //aSaveroleUser=saveRoleUser.get(i)
|
||||||
System.out.println();
|
logger.info("["+user.getEffectiveName()+"] Fin des "+multip+"min");
|
||||||
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();
|
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();
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@ package net.borken.Outils;
|
|||||||
|
|
||||||
import net.dv8tion.jda.*;
|
import net.dv8tion.jda.*;
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -11,7 +13,7 @@ import java.util.Arrays;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class CommandParser {
|
public class CommandParser {
|
||||||
public static Entete entete=new Entete();
|
Logger logger = LogManager.getLogger();
|
||||||
public CommandContainer parse(String brt, MessageReceivedEvent e)
|
public CommandContainer parse(String brt, MessageReceivedEvent e)
|
||||||
{
|
{
|
||||||
ArrayList<String> split =new ArrayList<String>();
|
ArrayList<String> split =new ArrayList<String>();
|
||||||
@ -30,7 +32,7 @@ public class CommandParser {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
System.out.println(entete.get("Info","CMD")+"Auteur: "+e.getMember().getEffectiveName()+", Commande: "+commande+", args: "+ Arrays.toString(args));
|
logger.info("Auteur: "+e.getMember().getEffectiveName()+", Commande: "+commande+", args: "+ Arrays.toString(args));
|
||||||
return new CommandContainer(brut, sansTete, splitSansTete, commande, args, e); //On Save toute les info dans le container
|
return new CommandContainer(brut, sansTete, splitSansTete, commande, args, e); //On Save toute les info dans le container
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.borken.Outils;
|
package net.borken.Outils;
|
||||||
import net.borken.commandes.Spam;
|
import net.borken.commandes.Spam;
|
||||||
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
|
|
||||||
@ -34,7 +35,7 @@ public class DayListener extends Thread {
|
|||||||
try {
|
try {
|
||||||
sleep(7200000);
|
sleep(7200000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
System.err.println(new Entete().get("ERREUR","AutoReset")+e.getCause());
|
LogManager.getLogger().catching(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
package net.borken.Outils;
|
|
||||||
|
|
||||||
import enigma.console.TextAttributes;
|
|
||||||
import net.borken.MainBot;
|
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by seb65 on 24/10/2016.
|
|
||||||
*/
|
|
||||||
public class Entete {
|
|
||||||
public String get(String type,String fonction){
|
|
||||||
if (type.equals("ERREUR"))
|
|
||||||
{
|
|
||||||
MainBot.txtColor = new TextAttributes(Color.red, Color.black);
|
|
||||||
MainBot.s_console.setTextAttributes(MainBot.txtColor);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MainBot.txtColor = new TextAttributes(Color.blue, Color.black);
|
|
||||||
MainBot.s_console.setTextAttributes(MainBot.txtColor);
|
|
||||||
}
|
|
||||||
return "["+new Heure().getString()+"] ["+type+"] ["+fonction+"]: ";
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
package net.borken.Outils;
|
|
||||||
|
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by seb65 on 21/10/2016.
|
|
||||||
*/
|
|
||||||
public class Heure {
|
|
||||||
|
|
||||||
|
|
||||||
public int getHeure()
|
|
||||||
{
|
|
||||||
GregorianCalendar calendrier = new GregorianCalendar();
|
|
||||||
return calendrier.get(GregorianCalendar.HOUR_OF_DAY);
|
|
||||||
}
|
|
||||||
public int getMin(){
|
|
||||||
GregorianCalendar calendrier = new GregorianCalendar();
|
|
||||||
return calendrier.get(GregorianCalendar.MINUTE);
|
|
||||||
}
|
|
||||||
public int getSeg(){
|
|
||||||
GregorianCalendar calendrier = new GregorianCalendar();
|
|
||||||
return calendrier.get(GregorianCalendar.SECOND);
|
|
||||||
|
|
||||||
}
|
|
||||||
public String getString(){
|
|
||||||
String str=String.format("%02d",this.getHeure())+":"+String.format("%02d",this.getMin())+":"+String.format("%02d",this.getSeg());
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -9,6 +9,8 @@ import net.dv8tion.jda.core.entities.Member;
|
|||||||
import net.dv8tion.jda.core.entities.User;
|
import net.dv8tion.jda.core.entities.User;
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.core.managers.GuildManager;
|
import net.dv8tion.jda.core.managers.GuildManager;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import static net.borken.MainBot.historique;
|
import static net.borken.MainBot.historique;
|
||||||
|
|
||||||
@ -17,9 +19,8 @@ import static net.borken.MainBot.historique;
|
|||||||
*/
|
*/
|
||||||
public class Moderateur {
|
public class Moderateur {
|
||||||
|
|
||||||
|
Logger logger = LogManager.getLogger();
|
||||||
private String[] tabMessages;
|
private String[] tabMessages;
|
||||||
private Entete entete=new Entete();
|
|
||||||
|
|
||||||
public Moderateur() {}
|
public Moderateur() {}
|
||||||
|
|
||||||
@ -58,10 +59,10 @@ public class Moderateur {
|
|||||||
if(toi[3].equals(toi[2])&&toi[2].equals(toi[1]) && toi[1].equals(toi[0]) ){
|
if(toi[3].equals(toi[2])&&toi[2].equals(toi[1]) && toi[1].equals(toi[0]) ){
|
||||||
|
|
||||||
spam = 1;
|
spam = 1;
|
||||||
System.out.println(entete.get("Info","MODERATEUR")+"Detection de spam pour "+user.getEffectiveName()+"avec 3 messages identique: ");
|
logger.info("Detection de spam pour "+user.getEffectiveName()+"avec 3 messages identique: ");
|
||||||
for(int j=0;MainBot.historique.get(user).length-1>j;j++)
|
for(int j=0;MainBot.historique.get(user).length-1>j;j++)
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("Info","MODERATEUR")+"\t"+j+". "+MainBot.historique.get(user)[j]);
|
logger.info("\t"+j+". "+MainBot.historique.get(user)[j]);
|
||||||
}
|
}
|
||||||
toi[0] = "";
|
toi[0] = "";
|
||||||
toi[1] = "";
|
toi[1] = "";
|
||||||
@ -101,11 +102,11 @@ public class Moderateur {
|
|||||||
if(cpt > 5){
|
if(cpt > 5){
|
||||||
MainBot.message_compteur.put(user,0);
|
MainBot.message_compteur.put(user,0);
|
||||||
spam = 1;
|
spam = 1;
|
||||||
System.out.println(entete.get("Info","MODERATEUR")+"Detection de spam pour "+user.getEffectiveName()+"avec 5 message en 5seg: ");
|
logger.info("Detection de spam pour "+user.getEffectiveName()+"avec 5 message en 5seg: ");
|
||||||
String[] histo = MainBot.historique.get(user);
|
String[] histo = MainBot.historique.get(user);
|
||||||
for (String unMessage:histo ) //=for(int i=0; i<saveRoleUser.size(); i++)
|
for (String unMessage:histo ) //=for(int i=0; i<saveRoleUser.size(); i++)
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("Info","MODERATEUR")+"\t*"+unMessage);
|
logger.debug("\t*"+unMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
@ -10,7 +10,6 @@ import java.net.URLConnection;
|
|||||||
* Created by seb65 on 07/11/2016.
|
* Created by seb65 on 07/11/2016.
|
||||||
*/
|
*/
|
||||||
public class Redirection {
|
public class Redirection {
|
||||||
Entete entete=new Entete();
|
|
||||||
|
|
||||||
public Redirection(){
|
public Redirection(){
|
||||||
|
|
||||||
|
@ -2,8 +2,9 @@ package net.borken.commandes;
|
|||||||
|
|
||||||
import net.borken.Commande;
|
import net.borken.Commande;
|
||||||
import net.borken.MainBot;
|
import net.borken.MainBot;
|
||||||
import net.borken.Outils.Entete;
|
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -11,7 +12,7 @@ import java.util.Map;
|
|||||||
* Created by seb65 on 23/10/2016.
|
* Created by seb65 on 23/10/2016.
|
||||||
*/
|
*/
|
||||||
public class Help implements Commande {
|
public class Help implements Commande {
|
||||||
public static Entete entete=new Entete();
|
Logger logger = LogManager.getLogger();
|
||||||
@Override
|
@Override
|
||||||
public boolean called(String[] args, MessageReceivedEvent event) {
|
public boolean called(String[] args, MessageReceivedEvent event) {
|
||||||
return true;
|
return true;
|
||||||
@ -25,7 +26,7 @@ public class Help implements Commande {
|
|||||||
//System.out.println(argsString);
|
//System.out.println(argsString);
|
||||||
if (MainBot.commandes.containsKey(argsString))
|
if (MainBot.commandes.containsKey(argsString))
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("Info","HELP")+"Aide demmander pour la cmd "+argsString+" par "+event.getMember().getEffectiveName());
|
logger.info("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();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n\n"+MainBot.commandes.get(argsString).help(args)).queue();
|
||||||
|
|
||||||
|
|
||||||
@ -33,7 +34,7 @@ public class Help implements Commande {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Commande Inconue!__** :warning:").queue();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Commande Inconue!__** :warning:").queue();
|
||||||
System.out.println(entete.get("Info","HELP")+"Commande Inconnue!");
|
logger.info("Commande Inconnue!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1,18 +1,15 @@
|
|||||||
package net.borken.commandes;
|
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.Commande;
|
||||||
import net.borken.Outils.Entete;
|
|
||||||
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;
|
||||||
import net.dv8tion.jda.core.entities.User;
|
import net.dv8tion.jda.core.entities.User;
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
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.GuildController;
|
||||||
import net.dv8tion.jda.core.managers.GuildManager;
|
import net.dv8tion.jda.core.managers.GuildManager;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -28,14 +25,13 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class Move implements Commande {
|
public class Move implements Commande {
|
||||||
|
|
||||||
|
Logger logger = LogManager.getLogger();
|
||||||
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.*";
|
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<Role> saveRoleUser;
|
public List<Role> saveRoleUser;
|
||||||
public Member user;
|
public Member user;
|
||||||
public Guild serveur;
|
public Guild serveur;
|
||||||
public GuildManager serveurManager;
|
public GuildManager serveurManager;
|
||||||
public GuildController guildController;
|
public GuildController guildController;
|
||||||
public static Entete entete=new Entete();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -51,14 +47,14 @@ public class Move implements Commande {
|
|||||||
guildController = new GuildController(serveur);
|
guildController = new GuildController(serveur);
|
||||||
boolean erreur = false;
|
boolean erreur = false;
|
||||||
List<Role> allRoll = serveur.getRoles();
|
List<Role> allRoll = serveur.getRoles();
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
|
|
||||||
//On recupere les roles de l'utilisateur
|
//On recupere les roles de l'utilisateur
|
||||||
|
|
||||||
List<Role> roleUserList = user.getRoles();
|
List<Role> roleUserList = user.getRoles();
|
||||||
System.out.println();
|
|
||||||
System.out.println(entete.get("Info","MOVER")+"Roles de " + user.getEffectiveName() + ":");
|
logger.info("Roles de " + user.getEffectiveName() + ":");
|
||||||
|
|
||||||
//On les save
|
//On les save
|
||||||
saveRoleUser = roleUserList;
|
saveRoleUser = roleUserList;
|
||||||
@ -72,7 +68,7 @@ public class Move implements Commande {
|
|||||||
//on fait ensuite les modif
|
//on fait ensuite les modif
|
||||||
guildController.modifyMemberRoles(user,temp,saveRoleUser).queue();
|
guildController.modifyMemberRoles(user,temp,saveRoleUser).queue();
|
||||||
|
|
||||||
System.out.println(entete.get("Info","MOVER")+"Role " + cible + " attribuer a " + user.getEffectiveName());
|
logger.info("Role " + cible + " attribuer a " + user.getEffectiveName());
|
||||||
|
|
||||||
this.user=user;
|
this.user=user;
|
||||||
this.serveur=serveur;
|
this.serveur=serveur;
|
||||||
@ -101,21 +97,20 @@ public class Move implements Commande {
|
|||||||
|
|
||||||
if(userL.size()<1 ||roleL.size()<1)
|
if(userL.size()<1 ||roleL.size()<1)
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("ERREUR","MOVE")+"Mentionnement Incorect.");
|
logger.info("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();
|
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
|
else
|
||||||
{
|
{
|
||||||
System.out.println(userL.get(0));
|
|
||||||
user = serveur.getMember(userL.get(0));
|
user = serveur.getMember(userL.get(0));
|
||||||
Role roleCible = roleL.get(0);
|
Role roleCible = roleL.get(0);
|
||||||
serveur=event.getGuild();
|
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());
|
logger.info("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)))
|
if(event.getMember().getRoles().contains(serveur.getRolesByName("Big_Daddy",false).get(0)))
|
||||||
{
|
{
|
||||||
|
|
||||||
System.out.println(entete.get("Info","MOVE")+"Autorisation suffisante, deplacement autorisé");
|
logger.info("Autorisation suffisante, deplacement autorisé");
|
||||||
System.out.println(entete.get("Info","MOVE")+"Utilisateur trouvée");
|
logger.info("Utilisateur trouvée");
|
||||||
boolean erreur=this.exc(user,roleCible,true,serveur,serveur.getManager());
|
boolean erreur=this.exc(user,roleCible,true,serveur,serveur.getManager());
|
||||||
if(erreur)
|
if(erreur)
|
||||||
{
|
{
|
||||||
@ -128,7 +123,7 @@ public class Move implements Commande {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("Info","MOVE")+"Autorisation insuffisante, deplacement refusé");
|
logger.info("Autorisation insuffisante, deplacement refusé");
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Vous n'avez pas l'autorisation de faire ca!__**:warning: ").queue();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Vous n'avez pas l'autorisation de faire ca!__**:warning: ").queue();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -137,7 +132,7 @@ public class Move implements Commande {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("ERREUR","MOVE")+"Arguments maquant.");
|
logger.warn("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();
|
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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
package net.borken.commandes.Over18;
|
package net.borken.commandes.Over18;
|
||||||
|
|
||||||
import net.borken.Commande;
|
import net.borken.Commande;
|
||||||
import net.borken.Outils.Entete;
|
|
||||||
import net.borken.Outils.Redirection;
|
import net.borken.Outils.Redirection;
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by seb65 on 07/11/2016.
|
* Created by seb65 on 07/11/2016.
|
||||||
*/
|
*/
|
||||||
public class Ass implements Commande{
|
public class Ass implements Commande{
|
||||||
|
Logger logger = LogManager.getLogger();
|
||||||
public String HELP="T'es sérieux la?";
|
public String HELP="T'es sérieux la?";
|
||||||
Entete entete= new Entete();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean called(String[] args, MessageReceivedEvent event) {
|
public boolean called(String[] args, MessageReceivedEvent event) {
|
||||||
@ -27,7 +26,7 @@ public class Ass implements Commande{
|
|||||||
Redirection redirect= new Redirection();
|
Redirection redirect= new Redirection();
|
||||||
try {
|
try {
|
||||||
event.getTextChannel().sendMessage(redirect.get("http://les400culs.com/random")).queue();
|
event.getTextChannel().sendMessage(redirect.get("http://les400culs.com/random")).queue();
|
||||||
System.out.println(entete.get("ERREUR","Ass")+"Erreur de redirection.");
|
logger.warn("Erreur de redirection.");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -36,7 +35,7 @@ public class Ass implements Commande{
|
|||||||
{
|
{
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").queue();
|
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.");
|
logger.warn("Erreur chanel.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.borken.commandes.Over18;
|
package net.borken.commandes.Over18;
|
||||||
|
|
||||||
import net.borken.Commande;
|
import net.borken.Commande;
|
||||||
import net.borken.Outils.Entete;
|
|
||||||
import net.borken.Outils.Redirection;
|
import net.borken.Outils.Redirection;
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@ -12,8 +12,8 @@ import java.io.IOException;
|
|||||||
* Created by seb65 on 07/11/2016.
|
* Created by seb65 on 07/11/2016.
|
||||||
*/
|
*/
|
||||||
public class Boobs implements Commande {
|
public class Boobs implements Commande {
|
||||||
|
Logger logger = LogManager.getLogger();
|
||||||
public String HELP="T'es sérieux la?";
|
public String HELP="T'es sérieux la?";
|
||||||
Entete entete=new Entete();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean called(String[] args, MessageReceivedEvent event) {
|
public boolean called(String[] args, MessageReceivedEvent event) {
|
||||||
@ -27,13 +27,13 @@ public class Boobs implements Commande {
|
|||||||
try {
|
try {
|
||||||
event.getTextChannel().sendMessage(redirect.get("http://lesaintdesseins.fr/random")).queue();
|
event.getTextChannel().sendMessage(redirect.get("http://lesaintdesseins.fr/random")).queue();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println(entete.get("ERREUR", "Boobs") + "Erreur de redirection.");
|
logger.warn("Erreur de redirection.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").queue();
|
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.");
|
logger.warn("Erreur chanel.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@ import net.borken.Commande;
|
|||||||
import net.borken.Outils.Redirection;
|
import net.borken.Outils.Redirection;
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
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.Logger;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@ -13,6 +15,7 @@ import static net.borken.MainBot.entete;
|
|||||||
* Created by seb65 on 11/11/2016.
|
* Created by seb65 on 11/11/2016.
|
||||||
*/
|
*/
|
||||||
public class Madame implements Commande{
|
public class Madame implements Commande{
|
||||||
|
Logger logger = LogManager.getLogger();
|
||||||
public String HELP="T'es sérieux la?";
|
public String HELP="T'es sérieux la?";
|
||||||
@Override
|
@Override
|
||||||
public boolean called(String[] args, MessageReceivedEvent event) {
|
public boolean called(String[] args, MessageReceivedEvent event) {
|
||||||
@ -33,10 +36,10 @@ public class Madame implements Commande{
|
|||||||
success=true;
|
success=true;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
errorCp++;
|
errorCp++;
|
||||||
System.out.println(entete.get("WARN", "Madame") + "Erreur de redirection. (Essais n°"+errorCp+")");
|
logger.warn("Erreur de redirection. (Essais n°"+errorCp+")");
|
||||||
if(errorCp>5)
|
if(errorCp>5)
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("WARN", "Madame") + "5 Erreur de redirection.");
|
logger.error("5 Erreur de redirection.");
|
||||||
error=true;
|
error=true;
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur de redirection (5 essais), Réessayez__**:warning: ").queue();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur de redirection (5 essais), Réessayez__**:warning: ").queue();
|
||||||
|
|
||||||
@ -50,7 +53,7 @@ public class Madame implements Commande{
|
|||||||
{
|
{
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé!__**:warning: ").queue();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé!__**:warning: ").queue();
|
||||||
|
|
||||||
System.out.println(entete.get("ERREUR","Madame")+"Erreur chanel.");
|
logger.warn("Erreur chanel.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.borken.commandes.Over18;
|
package net.borken.commandes.Over18;
|
||||||
|
|
||||||
import net.borken.Commande;
|
import net.borken.Commande;
|
||||||
import net.borken.Outils.Entete;
|
|
||||||
import net.borken.Outils.Redirection;
|
import net.borken.Outils.Redirection;
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@ -12,8 +12,8 @@ import java.io.IOException;
|
|||||||
* Created by seb65 on 07/11/2016.
|
* Created by seb65 on 07/11/2016.
|
||||||
*/
|
*/
|
||||||
public class Pipe implements Commande {
|
public class Pipe implements Commande {
|
||||||
|
Logger logger = LogManager.getLogger();
|
||||||
public String HELP="T'es sérieux la?";
|
public String HELP="T'es sérieux la?";
|
||||||
Entete entete = new Entete();
|
|
||||||
@Override
|
@Override
|
||||||
public boolean called(String[] args, MessageReceivedEvent event) {
|
public boolean called(String[] args, MessageReceivedEvent event) {
|
||||||
return false;
|
return false;
|
||||||
@ -28,14 +28,14 @@ public class Pipe implements Commande {
|
|||||||
try {
|
try {
|
||||||
event.getTextChannel().sendMessage(redirect.get("http://feelation.com/random")).queue();
|
event.getTextChannel().sendMessage(redirect.get("http://feelation.com/random")).queue();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println(entete.get("ERREUR", "Pipe") + "Erreur de redirection.");
|
logger.warn("Erreur de redirection.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").queue();
|
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.");
|
logger.warn("Erreur chanel.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package net.borken.commandes.Over18;
|
package net.borken.commandes.Over18;
|
||||||
|
|
||||||
import net.borken.Commande;
|
import net.borken.Commande;
|
||||||
import net.borken.Outils.Entete;
|
|
||||||
import net.borken.Outils.Redirection;
|
import net.borken.Outils.Redirection;
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@ -12,8 +12,8 @@ import java.io.IOException;
|
|||||||
* Created by seb65 on 10/11/2016.
|
* Created by seb65 on 10/11/2016.
|
||||||
*/
|
*/
|
||||||
public class SM implements Commande {
|
public class SM implements Commande {
|
||||||
|
Logger logger = LogManager.getLogger();
|
||||||
public String HELP="T'es sérieux la?";
|
public String HELP="T'es sérieux la?";
|
||||||
Entete entete = new Entete();
|
|
||||||
@Override
|
@Override
|
||||||
public boolean called(String[] args, MessageReceivedEvent event) {
|
public boolean called(String[] args, MessageReceivedEvent event) {
|
||||||
return false;
|
return false;
|
||||||
@ -27,14 +27,14 @@ public class SM implements Commande {
|
|||||||
try {
|
try {
|
||||||
event.getTextChannel().sendMessage(redirect.get("https://bonjourfetish.tumblr.com/random")).queue();
|
event.getTextChannel().sendMessage(redirect.get("https://bonjourfetish.tumblr.com/random")).queue();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println(entete.get("ERREUR","SM")+"Erreur de redirection.");
|
logger.warn("Erreur de redirection.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").queue();
|
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.");
|
logger.warn("Erreur chanel.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package net.borken.commandes;
|
package net.borken.commandes;
|
||||||
|
|
||||||
import net.borken.Commande;
|
import net.borken.Commande;
|
||||||
import net.borken.Outils.Entete;
|
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
import net.dv8tion.jda.core.exceptions.RateLimitedException;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by seb65 on 19/10/2016.
|
* Created by seb65 on 19/10/2016.
|
||||||
@ -21,7 +21,7 @@ public class PingCommande implements Commande {
|
|||||||
public void action(String[] args, MessageReceivedEvent event) {
|
public void action(String[] args, MessageReceivedEvent event) {
|
||||||
|
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+" Pong!").queue();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+" Pong!").queue();
|
||||||
System.out.println("pong");
|
LogManager.getLogger().info("pong");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,13 +3,13 @@ package net.borken.commandes;
|
|||||||
import net.borken.Commande;
|
import net.borken.Commande;
|
||||||
import net.borken.MainBot;
|
import net.borken.MainBot;
|
||||||
import net.borken.Outils.AntiSpam;
|
import net.borken.Outils.AntiSpam;
|
||||||
import net.borken.Outils.Entete;
|
|
||||||
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.User;
|
import net.dv8tion.jda.core.entities.User;
|
||||||
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
||||||
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.Logger;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -20,7 +20,7 @@ import java.util.Objects;
|
|||||||
* Created by seb65 on 27/10/2016.
|
* Created by seb65 on 27/10/2016.
|
||||||
*/
|
*/
|
||||||
public class Spam implements Commande {
|
public class Spam implements Commande {
|
||||||
Entete entete =new Entete();
|
Logger logger = LogManager.getLogger();
|
||||||
@Override
|
@Override
|
||||||
public boolean called(String[] args, MessageReceivedEvent event) {
|
public boolean called(String[] args, MessageReceivedEvent event) {
|
||||||
return false;
|
return false;
|
||||||
@ -103,18 +103,18 @@ public class Spam implements Commande {
|
|||||||
****************************/
|
****************************/
|
||||||
if(userL.size()<1)
|
if(userL.size()<1)
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("ERREUR", "CMD") + "Utilisateur introuvable.");
|
logger.error("Utilisateur introuvable.");
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur introuvable. ");
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur introuvable. ");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Member user = serveur.getMember(userL.get(0));
|
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());
|
logger.info("Tentative de pardon de " + user.getEffectiveName() + " par l'utilisateur " + event.getMember().getEffectiveName());
|
||||||
/****************************
|
/****************************
|
||||||
* c'est un big dady *
|
* c'est un big dady *
|
||||||
****************************/
|
****************************/
|
||||||
|
|
||||||
if (event.getMember().getRoles().get(0)==serveur.getRolesByName("Big_Daddy",false).get(0)) {
|
if (event.getMember().getRoles().get(0)==serveur.getRolesByName("Big_Daddy",false).get(0)) {
|
||||||
System.out.println(entete.get("Info", "CMD") + "Autorisation suffisante, pardon autorisé");
|
logger.info("Autorisation suffisante, pardon autorisé");
|
||||||
|
|
||||||
/****************************
|
/****************************
|
||||||
* virif si en spammer *
|
* virif si en spammer *
|
||||||
@ -123,25 +123,25 @@ public class Spam implements Commande {
|
|||||||
if (MainBot.minuteurStatut.get(user)) {
|
if (MainBot.minuteurStatut.get(user)) {
|
||||||
MainBot.minuteurStatut.put(user, false);
|
MainBot.minuteurStatut.put(user, false);
|
||||||
} else {
|
} else {
|
||||||
System.out.println(entete.get("ERREUR", "CMD") + "Utilisateur pas en spam.");
|
logger.warn("Utilisateur pas en spam.");
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur non spammeur. ");
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur non spammeur. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
System.out.println(entete.get("ERREUR", "CMD") + "Utilisateur pas en spam.");
|
logger.warn("Utilisateur pas en spam.");
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur non spammeur. ");
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur non spammeur. ");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
System.out.println(entete.get("Info", "CMD") + "Autorisation insuffisante, pardon refusé");
|
logger.warn("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: ");
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:no_entry_sign: **__Vous n'avez pas l'autorisation de faire sa!__** :no_entry_sign: ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("Info","ERREUR")+"Argument manquant.");
|
logger.warn("Argument manquant.");
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Argument manquant__**:warning: \n:arrow_right: Utilisation: `//spam pardon <@utilisateur>`.");
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Argument manquant__**:warning: \n:arrow_right: Utilisation: `//spam pardon <@utilisateur>`.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ public class Spam implements Commande {
|
|||||||
****************************/
|
****************************/
|
||||||
if(userL.size()<1)
|
if(userL.size()<1)
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("ERREUR","CMD")+"Mentionnement Incorect (Spam).");
|
logger.warn("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();
|
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{
|
else{
|
||||||
@ -173,14 +173,14 @@ public class Spam implements Commande {
|
|||||||
|
|
||||||
Guild serveur = event.getGuild();
|
Guild serveur = event.getGuild();
|
||||||
Member user = serveur.getMember(userL.get(0));
|
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());
|
logger.info("Tentative d'extermination de "+user.getEffectiveName()+" par l'utilisateur "+event.getAuthor().getName());
|
||||||
/****************************
|
/****************************
|
||||||
* c'est un big dady *
|
* c'est un big dady *
|
||||||
****************************/
|
****************************/
|
||||||
|
|
||||||
if(event.getMember().getRoles().get(0)==serveur.getRolesByName("Big_Daddy",false).get(0))
|
if(event.getMember().getRoles().get(0)==serveur.getRolesByName("Big_Daddy",false).get(0))
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("Info","CMD")+"Autorisation suffisante, extermination autorisé");
|
logger.info("Autorisation suffisante, extermination autorisé");
|
||||||
String multiStr =args[2];
|
String multiStr =args[2];
|
||||||
|
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ public class Spam implements Commande {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("ERREUR","CMD")+"Utilisateur deja en spam.");
|
logger.warn("Utilisateur deja en spam.");
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur déjà spammeur. ").queue();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur déjà spammeur. ").queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ public class Spam implements Commande {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("Info","CMD")+"Autorisation insuffisante, extermination refusé");
|
logger.warn("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();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:no_entry_sign: **__Vous n'avez pas l'autorisation de faire sa!__** :no_entry_sign: ").queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ public class Spam implements Commande {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("Info","ERREUR")+"Argument manquant.");
|
logger.warn("Argument manquant.");
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Argument manquant__**:warning: \n:arrow_right: Utilisation: `//spam extermine <utilisateur> <multiplicateur>`.").queue();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Argument manquant__**:warning: \n:arrow_right: Utilisation: `//spam extermine <utilisateur> <multiplicateur>`.").queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -242,30 +242,30 @@ public class Spam implements Commande {
|
|||||||
****************************/
|
****************************/
|
||||||
if(userL.size()<1)
|
if(userL.size()<1)
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("ERREUR", "CMD") + "Utilisateur introuvable.");
|
logger.warn("Utilisateur introuvable.");
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur introuvable. ").queue();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur__** :warning:\n:arrow_right: Utilisateur introuvable. ").queue();
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Member user = serveur.getMember(userL.get(0));
|
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());
|
logger.info("Tentative de reset de " + user.getEffectiveName() + " par l'utilisateur " + event.getMember().getEffectiveName());
|
||||||
/****************************
|
/****************************
|
||||||
* c'est un big dady *
|
* c'est un big dady *
|
||||||
****************************/
|
****************************/
|
||||||
|
|
||||||
if ( event.getMember().getRoles().get(0) == serveur.getRolesByName("Big_Daddy", false).get(0)) {
|
if ( event.getMember().getRoles().get(0) == serveur.getRolesByName("Big_Daddy", false).get(0)) {
|
||||||
System.out.println(entete.get("Info", "CMD") + "Autorisation suffisante, pardon autorisé");
|
logger.info("Autorisation suffisante, pardon autorisé");
|
||||||
/****************************
|
/****************************
|
||||||
* verif utilisteur trouver *
|
* verif utilisteur trouver *
|
||||||
****************************/
|
****************************/
|
||||||
if (MainBot.userMulti.containsKey(user)) {
|
if (MainBot.userMulti.containsKey(user)) {
|
||||||
System.out.println(entete.get("Info", "CMD") + "Reset du multiplicateur de " + user.getEffectiveName() + " réussi");
|
logger.info("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();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n *Le multiplcicateur de " + user.getEffectiveName() + " a été remit a zéro.*").queue();
|
||||||
MainBot.userMulti.remove(user);
|
MainBot.userMulti.remove(user);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println(entete.get("Info", "CMD") + "Autorisation insuffisante, reset refusé");
|
logger.warn("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();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:no_entry_sign: **__Vous n'avez pas l'autorisation de faire ca!__** :no_entry_sign: ").queue();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -273,7 +273,7 @@ public class Spam implements Commande {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("Info","ERREUR")+"Argument manquant.");
|
logger.warn("Argument manquant.");
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Argument manquant__**:warning: \n:arrow_right: Utilisation: `//spam reset <utilisateur>`.").queue();
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Argument manquant__**:warning: \n:arrow_right: Utilisation: `//spam reset <utilisateur>`.").queue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ public class Spam implements Commande {
|
|||||||
{
|
{
|
||||||
if (args[0].equals("all"))
|
if (args[0].equals("all"))
|
||||||
{
|
{
|
||||||
System.out.println(entete.get("Info","AutoReset")+"Reset automatique des multiplicateur.");
|
logger.info("Reset automatique des multiplicateur.");
|
||||||
for (Member unUser: MainBot.userMulti.keySet() ) //=for(int i=0; i<saveRoleUser.size(); i++)
|
for (Member unUser: MainBot.userMulti.keySet() ) //=for(int i=0; i<saveRoleUser.size(); i++)
|
||||||
{
|
{
|
||||||
MainBot.message_compteur.remove(unUser);
|
MainBot.message_compteur.remove(unUser);
|
||||||
|
Loading…
Reference in New Issue
Block a user