Reorganization of packages

This commit is contained in:
BrokenFire 2018-01-18 10:28:54 +01:00
parent c8a13835b6
commit 5bb78e232e
32 changed files with 78 additions and 63 deletions

View File

@ -2,8 +2,8 @@ package net.Broken;
import net.Broken.Commands.Move; import net.Broken.Commands.Move;
import net.Broken.Commands.Music; import net.Broken.Commands.Music;
import net.Broken.Outils.AntiSpam; import net.Broken.Tools.AntiSpam;
import net.Broken.Outils.Moderateur; import net.Broken.Tools.Moderateur;
import net.dv8tion.jda.core.entities.ChannelType; import net.dv8tion.jda.core.entities.ChannelType;
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;

View File

@ -2,7 +2,7 @@ package net.Broken.Commands;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.Outils.Redirection; import net.Broken.Tools.Redirection;
import net.dv8tion.jda.core.entities.ChannelType; import net.dv8tion.jda.core.entities.ChannelType;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent;

View File

@ -1,7 +1,7 @@
package net.Broken.Commands; package net.Broken.Commands;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.Outils.EmbedMessageUtils; import net.Broken.Tools.EmbedMessageUtils;
import net.dv8tion.jda.core.Permission; import net.dv8tion.jda.core.Permission;
import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.MessageChannel; import net.dv8tion.jda.core.entities.MessageChannel;

View File

@ -2,9 +2,9 @@ package net.Broken.Commands;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.MainBot; import net.Broken.MainBot;
import net.Broken.Outils.EmbedMessageUtils; import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Outils.MessageTimeOut; import net.Broken.Tools.MessageTimeOut;
import net.Broken.Outils.PrivateMessage; import net.Broken.Tools.PrivateMessage;
import net.dv8tion.jda.core.EmbedBuilder; import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.entities.ChannelType; import net.dv8tion.jda.core.entities.ChannelType;
import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.Message;

View File

@ -2,8 +2,8 @@ package net.Broken.Commands;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.MainBot; import net.Broken.MainBot;
import net.Broken.Outils.EmbedMessageUtils; import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Outils.MessageTimeOut; import net.Broken.Tools.MessageTimeOut;
import net.dv8tion.jda.core.Permission; import net.dv8tion.jda.core.Permission;
import net.dv8tion.jda.core.entities.*; import net.dv8tion.jda.core.entities.*;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent;

View File

@ -2,10 +2,9 @@ package net.Broken.Commands;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.MainBot; import net.Broken.MainBot;
import net.Broken.Outils.EmbedMessageUtils; import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Outils.MessageTimeOut; import net.Broken.Tools.MessageTimeOut;
import net.Broken.audio.AudioM; import net.Broken.audio.AudioM;
import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.VoiceChannel; import net.dv8tion.jda.core.entities.VoiceChannel;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent;

View File

@ -1,6 +1,6 @@
package net.Broken.Commands.Over18; package net.Broken.Commands.Over18;
import net.Broken.Outils.Command.NumberedCommande; import net.Broken.Tools.Command.NumberedCommande;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
/** /**

View File

@ -1,6 +1,6 @@
package net.Broken.Commands.Over18; package net.Broken.Commands.Over18;
import net.Broken.Outils.Command.NumberedCommande; import net.Broken.Tools.Command.NumberedCommande;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
/** /**

View File

@ -1,7 +1,7 @@
package net.Broken.Commands.Over18; package net.Broken.Commands.Over18;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.Outils.Redirection; import net.Broken.Tools.Redirection;
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.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;

View File

@ -1,6 +1,6 @@
package net.Broken.Commands.Over18; package net.Broken.Commands.Over18;
import net.Broken.Outils.Command.NumberedCommande; import net.Broken.Tools.Command.NumberedCommande;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
/** /**

View File

@ -1,7 +1,7 @@
package net.Broken.Commands.Over18; package net.Broken.Commands.Over18;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.Outils.Redirection; import net.Broken.Tools.Redirection;
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.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;

View File

@ -2,7 +2,7 @@ package net.Broken.Commands;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.MainBot; import net.Broken.MainBot;
import net.Broken.Outils.MessageTimeOut; import net.Broken.Tools.MessageTimeOut;
import net.dv8tion.jda.core.entities.ChannelType; import net.dv8tion.jda.core.entities.ChannelType;
import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent;

View File

@ -2,10 +2,10 @@ package net.Broken.Commands;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.MainBot; import net.Broken.MainBot;
import net.Broken.Outils.AntiSpam; import net.Broken.Tools.AntiSpam;
import net.Broken.Outils.EmbedMessageUtils; import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Outils.MessageTimeOut; import net.Broken.Tools.MessageTimeOut;
import net.Broken.Outils.UserSpamUtils; import net.Broken.Tools.UserSpamUtils;
import net.dv8tion.jda.core.Permission; import net.dv8tion.jda.core.Permission;
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;

View File

@ -2,10 +2,10 @@ package net.Broken.Commands;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.MainBot; import net.Broken.MainBot;
import net.Broken.Outils.EmbedMessageUtils; import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Outils.MessageTimeOut; import net.Broken.Tools.MessageTimeOut;
import net.Broken.Outils.PrivateMessage; import net.Broken.Tools.PrivateMessage;
import net.Broken.Outils.UserSpamUtils; import net.Broken.Tools.UserSpamUtils;
import net.dv8tion.jda.core.EmbedBuilder; import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.entities.ChannelType; import net.dv8tion.jda.core.entities.ChannelType;
import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.Message;

View File

@ -1,7 +1,7 @@
package net.Broken; package net.Broken;
import net.Broken.Outils.Command.CommandLoader; import net.Broken.Tools.Command.CommandLoader;
import net.Broken.Outils.DayListener; import net.Broken.Tools.DayListener;
import net.dv8tion.jda.core.AccountType; import net.dv8tion.jda.core.AccountType;
import net.dv8tion.jda.core.JDA; import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.JDABuilder; import net.dv8tion.jda.core.JDABuilder;

View File

@ -1,8 +1,8 @@
package net.Broken; package net.Broken;
import net.Broken.Outils.Command.CommandParser; import net.Broken.Tools.Command.CommandParser;
import net.Broken.Outils.EmbedMessageUtils; import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Outils.UserSpamUtils; import net.Broken.Tools.UserSpamUtils;
import net.Broken.RestApi.ApiCommandLoader; import net.Broken.RestApi.ApiCommandLoader;
import net.dv8tion.jda.core.JDA; import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.entities.ChannelType; import net.dv8tion.jda.core.entities.ChannelType;
@ -17,6 +17,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import java.security.SecureRandom;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
@ -74,6 +75,7 @@ public class MainBot {
})); }));
} }
ApiCommandLoader.load(); ApiCommandLoader.load();

View File

@ -1,10 +1,7 @@
package net.Broken.Outils; package net.Broken.Tools;
import net.Broken.MainBot; import net.Broken.MainBot;
import net.Broken.Commands.Move; import net.Broken.Commands.Move;
import net.Broken.Outils.EmbedMessageUtils;
import net.Broken.Outils.MessageTimeOut;
import net.Broken.Outils.UserSpamUtils;
import net.dv8tion.jda.core.entities.*; import net.dv8tion.jda.core.entities.*;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
import net.dv8tion.jda.core.exceptions.HierarchyException; import net.dv8tion.jda.core.exceptions.HierarchyException;

View File

@ -1,4 +1,4 @@
package net.Broken.Outils.Command; package net.Broken.Tools.Command;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.MainBot; import net.Broken.MainBot;

View File

@ -1,4 +1,4 @@
package net.Broken.Outils.Command; package net.Broken.Tools.Command;
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.LogManager;

View File

@ -1,8 +1,8 @@
package net.Broken.Outils.Command; package net.Broken.Tools.Command;
import net.Broken.Commande; import net.Broken.Commande;
import net.Broken.Outils.FindContentOnWebPage; import net.Broken.Tools.FindContentOnWebPage;
import net.Broken.Outils.LimitChecker; import net.Broken.Tools.LimitChecker;
import net.Broken.Outils.Redirection; import net.Broken.Tools.Redirection;
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.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;

View File

@ -1,4 +1,4 @@
package net.Broken.Outils; package net.Broken.Tools;
import net.Broken.Commands.Spam; import net.Broken.Commands.Spam;
import net.dv8tion.jda.core.exceptions.RateLimitedException; import net.dv8tion.jda.core.exceptions.RateLimitedException;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;

View File

@ -1,10 +1,8 @@
package net.Broken.Outils; package net.Broken.Tools;
import net.dv8tion.jda.core.EmbedBuilder; import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.entities.Member; import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.MessageEmbed; import net.dv8tion.jda.core.entities.MessageEmbed;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
import java.awt.*; import java.awt.*;

View File

@ -1,9 +1,8 @@
package net.Broken.Outils; package net.Broken.Tools;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;

View File

@ -1,4 +1,4 @@
package net.Broken.Outils; package net.Broken.Tools;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;

View File

@ -1,4 +1,4 @@
package net.Broken.Outils; package net.Broken.Tools;
import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.exceptions.ErrorResponseException; import net.dv8tion.jda.core.exceptions.ErrorResponseException;

View File

@ -1,5 +1,5 @@
package net.Broken.Outils; package net.Broken.Tools;
import net.Broken.MainBot; import net.Broken.MainBot;

View File

@ -1,10 +1,8 @@
package net.Broken.Outils; package net.Broken.Tools;
import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.MessageEmbed; import net.dv8tion.jda.core.entities.MessageEmbed;
import net.dv8tion.jda.core.entities.PrivateChannel;
import net.dv8tion.jda.core.entities.User; import net.dv8tion.jda.core.entities.User;
import net.dv8tion.jda.core.exceptions.RateLimitedException;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
/** /**

View File

@ -1,4 +1,4 @@
package net.Broken.Outils; package net.Broken.Tools;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;

View File

@ -0,0 +1,14 @@
package net.Broken.Tools.UserManager;
import java.security.SecureRandom;
public class UserRegister {
public String generateToken(){
SecureRandom random = new SecureRandom();
long longToken = Math.abs( random.nextLong() );
String randomStr = Long.toString( longToken, 16 );
return randomStr;
}
}

View File

@ -1,4 +1,4 @@
package net.Broken.Outils; package net.Broken.Tools;
import net.dv8tion.jda.core.entities.Member; import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.Message;

View File

@ -9,15 +9,13 @@ import com.sedmelluq.discord.lavaplayer.track.AudioPlaylist;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack; import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo; import com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo;
import net.Broken.MainBot; import net.Broken.MainBot;
import net.Broken.Outils.EmbedMessageUtils; import net.Broken.Tools.EmbedMessageUtils;
import net.Broken.Outils.MessageTimeOut; import net.Broken.Tools.MessageTimeOut;
import net.dv8tion.jda.core.entities.Guild; import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Message; import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.TextChannel;
import net.dv8tion.jda.core.entities.VoiceChannel; import net.dv8tion.jda.core.entities.VoiceChannel;
import net.dv8tion.jda.core.events.guild.voice.GuildVoiceLeaveEvent; import net.dv8tion.jda.core.events.guild.voice.GuildVoiceLeaveEvent;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent; import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
import net.dv8tion.jda.core.managers.AudioManager;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;

View File

@ -2,24 +2,34 @@
<Configuration status="error" packages="com.coralogix.sdk.appenders"> <Configuration status="error" packages="com.coralogix.sdk.appenders">
<Appenders> <Appenders>
<Console name="Console" target="SYSTEM_OUT"> <Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{HH:mm:ss.SSS}][%-5level][%-30.30c{1.}]: %msg%n" /> <!--<PatternLayout pattern="[%d{HH:mm:ss.SSS}][%-5level][%-30.30c{1.}]: %msg%n" />-->
<PatternLayout>
<Pattern>[%d{HH:mm:ss.SSS}]%highlight{[%-5level]}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}[%-30.30c{1.}]: %highlight{%msg%n}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}</Pattern>
</PatternLayout>
</Console> </Console>
<RollingFile name="RollingFile" fileName="./logs/curent.log" <RollingFile name="RollingFile" fileName="./logs/current-day.log"
filePattern="./logs/$${date:yyyy-MM}/discordBot-%d{yyyy-MM-dd-HH}-%i.log.gz"> filePattern="./logs/$${date:yyyy-MM}/discordBot-%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout> <PatternLayout>
<Pattern>[%d{HH:mm:ss.SSS}]%highlight{[%-5level]}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}[%-30.30c{1.}]: %highlight{%msg%n}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}</Pattern> <Pattern>[%d{HH:mm:ss.SSS}]%highlight{[%-5level]}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}[%-30.30c{1.}]: %highlight{%msg%n}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}</Pattern>
</PatternLayout> </PatternLayout>
<Policies> <Policies>
<TimeBasedTriggeringPolicy/> <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
<SizeBasedTriggeringPolicy size="250 MB"/> <SizeBasedTriggeringPolicy size="250 MB"/>
</Policies> </Policies>
<DefaultRolloverStrategy max="60" />
</RollingFile> </RollingFile>
<File name="current" fileName="logs/current.log" append="false">
<PatternLayout>
<Pattern>[%d{HH:mm:ss.SSS}]%highlight{[%-5level]}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}[%-30.30c{1.}]: %highlight{%msg%n}{FATAL=red blink, ERROR=red, WARN=bright yellow , INFO=blue, DEBUG=bright black, TRACE=cyan}</Pattern>
</PatternLayout>
</File>
</Appenders> </Appenders>
<Loggers> <Loggers>
<Root level="debug"> <Root level="debug">
<AppenderRef ref="RollingFile" level="info" /> <AppenderRef ref="RollingFile" level="info" />
<AppenderRef ref="Console" level="info"/> <AppenderRef ref="Console" level="info"/>
<AppenderRef ref="RollingFile" level="info"/> <AppenderRef ref="RollingFile" level="info"/>
<AppenderRef ref="current" level="info"/>
</Root> </Root>
</Loggers> </Loggers>
</Configuration> </Configuration>