2017-03-20 21:01:49 +01:00
|
|
|
package net.Broken.Commandes.Over18;
|
2016-12-08 20:05:23 +01:00
|
|
|
|
2017-03-20 18:44:53 +01:00
|
|
|
import net.Broken.Commande;
|
|
|
|
import net.Broken.Outils.Redirection;
|
2016-12-08 20:05:23 +01:00
|
|
|
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
|
2017-02-04 19:31:09 +01:00
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
2016-12-08 20:05:23 +01:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by seb65 on 10/11/2016.
|
|
|
|
*/
|
|
|
|
public class SM implements Commande {
|
2017-02-04 19:31:09 +01:00
|
|
|
Logger logger = LogManager.getLogger();
|
2016-12-08 20:05:23 +01:00
|
|
|
public String HELP="T'es sérieux la?";
|
|
|
|
@Override
|
|
|
|
public boolean called(String[] args, MessageReceivedEvent event) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void action(String[] args, MessageReceivedEvent event) {
|
|
|
|
Redirection redirect= new Redirection();
|
|
|
|
if(event.getTextChannel().getName().equals("over18"))
|
|
|
|
{
|
|
|
|
try {
|
2017-02-03 14:00:47 +01:00
|
|
|
event.getTextChannel().sendMessage(redirect.get("https://bonjourfetish.tumblr.com/random")).queue();
|
2016-12-08 20:05:23 +01:00
|
|
|
} catch (IOException e) {
|
2017-02-04 19:31:09 +01:00
|
|
|
logger.warn("Erreur de redirection.");
|
2017-02-08 23:53:50 +01:00
|
|
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur de redirection (5 essais), Réessayez__**:warning: ").queue();
|
2016-12-08 20:05:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").queue();
|
|
|
|
|
2017-02-04 19:31:09 +01:00
|
|
|
logger.warn("Erreur chanel.");
|
2016-12-08 20:05:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String help(String[] args) {
|
|
|
|
return HELP;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void executed(boolean success, MessageReceivedEvent event) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|