diff --git a/build.gradle b/build.gradle index 069aca0..d853c5c 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group 'fr.tyrolium.maxime.bot' -version '0.4.0-BETA' +version '0.6.1-BETA' repositories { mavenCentral() diff --git a/src/main/java/fr/tyrolium/maxime/bot/Main.java b/src/main/java/fr/tyrolium/maxime/bot/Main.java index afacff3..a56243d 100644 --- a/src/main/java/fr/tyrolium/maxime/bot/Main.java +++ b/src/main/java/fr/tyrolium/maxime/bot/Main.java @@ -8,7 +8,7 @@ public class Main { // PROD or DEV - public static String APP_ENV = "DEV"; + public static String APP_ENV = "PROD"; public static void main(String[] argv) throws LoginException { System.out.println("BOT = Initialization"); diff --git a/src/main/java/fr/tyrolium/maxime/bot/message.java b/src/main/java/fr/tyrolium/maxime/bot/message.java index a7388c7..86c5933 100644 --- a/src/main/java/fr/tyrolium/maxime/bot/message.java +++ b/src/main/java/fr/tyrolium/maxime/bot/message.java @@ -32,8 +32,7 @@ public void onMessageReceived(@Nonnull MessageReceivedEvent event) { Boolean isCmd = app.System(eventDate, eventGuild.getName(), eventChannel, eventUser.getAsTag(), eventMsg.getContentRaw(), event, prefix); if (isCmd) { command.init(eventMsg.getContentRaw().toLowerCase().substring(2), eventChannel, eventUser, eventGuild, eventMsg, event, eventDate); } - else { notprefix.init(eventMsg.getContentRaw().toLowerCase(), eventChannel, eventUser, eventGuild); } - + else { notprefix.init(eventMsg.getContentRaw().toLowerCase(), eventChannel, eventUser, eventGuild, event); } } } diff --git a/src/main/java/fr/tyrolium/maxime/bot/notprefix.java b/src/main/java/fr/tyrolium/maxime/bot/notprefix.java index 16cba37..b34f3d5 100644 --- a/src/main/java/fr/tyrolium/maxime/bot/notprefix.java +++ b/src/main/java/fr/tyrolium/maxime/bot/notprefix.java @@ -1,17 +1,18 @@ package fr.tyrolium.maxime.bot; -import net.dv8tion.jda.api.entities.Guild; -import net.dv8tion.jda.api.entities.MessageChannel; -import net.dv8tion.jda.api.entities.User; +import net.dv8tion.jda.api.entities.*; +import net.dv8tion.jda.api.events.message.MessageReceivedEvent; public class notprefix { - public static void init(String eventMsg, MessageChannel channel, User user, Guild guild){ + public static void init(String eventMsg, MessageChannel channel, User user, Guild guild, MessageReceivedEvent event){ /*vive tyrolium*/ if (eventMsg.equals("vive tyrolium") && guild.getId().equals(stock.guildTyro)){ vt(channel); } if (eventMsg.equals("je t'aime") && user.getId().equals(stock.userPapa)){ jtm(channel); } + if (eventMsg.equals("``serveur offline``") && user.getId().equals(stock.userFrere)){ online(event); } + } public static void vt(MessageChannel channel){ @@ -23,4 +24,11 @@ public static void jtm(MessageChannel channel){ String msg = ":heart:"; app.send(channel, msg); } + + public static void online(MessageReceivedEvent event){ + String msg = "<@!363366883652796416> verifie le serveur s'il te plait"; + TextChannel chanAlert = event.getJDA().getTextChannelById(stock.alertChannel); + + app.send(chanAlert, msg); + } } diff --git a/src/main/java/fr/tyrolium/maxime/bot/stock.java b/src/main/java/fr/tyrolium/maxime/bot/stock.java index c2dd406..feff3ca 100644 --- a/src/main/java/fr/tyrolium/maxime/bot/stock.java +++ b/src/main/java/fr/tyrolium/maxime/bot/stock.java @@ -1,8 +1,5 @@ package fr.tyrolium.maxime.bot; -import java.nio.channels.Channel; -import java.util.Scanner; - public class stock { //Guild public static String guildTyro = "772171741782343690"; @@ -10,6 +7,7 @@ public class stock { //User public static String userPapa = "363366883652796416"; + public static String userFrere = "849915439844687893"; public static String userRayqua = "384436295717617665"; public static String userChristophe = "781509903718023208"; public static String userJessica = "424805452115869697"; @@ -37,9 +35,9 @@ public class stock { public static String playing = "tyrolium.fr | Prefix = t! | En Developpement"; public static String playingDev = "Dev le bot"; - //Techno - public static Scanner scanner = new Scanner(System.in); - //Channel - public static String logChannel = "908460977379504208"; + public static String logChannel = "909566707658539096"; + public static String alertChannel = "909576821220196433"; + public static String sniffChannel = "909567130310152202"; + }