Change some logs

This commit is contained in:
Sebastien 2018-12-03 15:43:39 +02:00
parent 19b5438634
commit 3cd9c0064e
2 changed files with 7 additions and 30 deletions

View File

@ -194,7 +194,7 @@ public class BotListener extends ListenerAdapter {
@Override @Override
public void onGuildJoin(GuildJoinEvent event) { public void onGuildJoin(GuildJoinEvent event) {
logger.info("Join new guild! (" + event.getGuild().getName() + ")"); logger.info("Join new guild! (" + event.getGuild().getName() + " " +event.getGuild().getMembers().size() + " Members)");
super.onGuildJoin(event); super.onGuildJoin(event);
getPreference(event.getGuild()); getPreference(event.getGuild());
EmbedBuilder eb = new EmbedBuilder().setColor(Color.GREEN) EmbedBuilder eb = new EmbedBuilder().setColor(Color.GREEN)

View File

@ -31,12 +31,11 @@ public class Init {
/** /**
* Initialize all bot functionality * Initialize all bot functionality
* @param token bot user token * @param token bot user token
* @param dev dev Mode or not
* @return JDA object * @return JDA object
*/ */
static JDA initJda(String token){ static JDA initJda(String token){
JDA jda = null; JDA jda = null;
logger.debug("-------------------INITIALISATION-------------------"); logger.info("-----------------------INIT-----------------------");
//Bot démarrer sans token //Bot démarrer sans token
if (token == null) { if (token == null) {
@ -63,37 +62,14 @@ public class Init {
//On recupere le l'id serveur //On recupere le l'id serveur
logger.info("Connected on " + jda.getGuilds().size() + " Guilds:");
for( Guild server : jda.getGuilds()){ for( Guild server : jda.getGuilds()){
//on recupere les utilisateur //on recupere les utilisateur
List<Member> utilisateurCo = server.getMembers(); logger.info("... " + server.getName() + " " + server.getMembers().size() + " Members");
logger.info("Online users: "+utilisateurCo.size());
for (Member anUtilisateurCo : utilisateurCo)
{
if (anUtilisateurCo.getOnlineStatus().equals(OnlineStatus.ONLINE))
logger.debug("\t*" + anUtilisateurCo.getEffectiveName());
} }
logger.debug("Do not disturb users: ");
for (Member anUtilisateurCo : utilisateurCo)
{
if (anUtilisateurCo.getOnlineStatus().equals(OnlineStatus.DO_NOT_DISTURB))
logger.debug("\t*" + anUtilisateurCo.getEffectiveName());
}
logger.debug("Offline users: ");
for (Member anUtilisateurCo : utilisateurCo)
{
if (anUtilisateurCo.getOnlineStatus().equals(OnlineStatus.OFFLINE))
logger.debug("\t*" + anUtilisateurCo.getEffectiveName());
}
}
logger.debug("-----------------FIN INITIALISATION-----------------");
} }
catch (LoginException | InterruptedException e) catch (LoginException | InterruptedException e)
@ -115,6 +91,7 @@ public class Init {
dayListener.start(); dayListener.start();
jda.addEventListener(new BotListener()); jda.addEventListener(new BotListener());
jda.getPresence().setPresence(OnlineStatus.ONLINE, Game.playing("bot.seb6596.ovh")); jda.getPresence().setPresence(OnlineStatus.ONLINE, Game.playing("bot.seb6596.ovh"));
logger.info("-----------------------END INIT-----------------------");
} }