ClaptrapBot/src/net/borken/commandes/Over18/Ass.java

52 lines
1.4 KiB
Java
Raw Normal View History

2016-12-08 20:05:23 +01:00
package net.borken.commandes.Over18;
import net.borken.Commande;
import net.borken.Outils.Redirection;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
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 07/11/2016.
*/
public class Ass implements Commande{
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) {
if(event.getTextChannel().getName().equals("over18")) {
Redirection redirect= new Redirection();
try {
event.getTextChannel().sendMessage(redirect.get("http://les400culs.com/random")).queue();
logger.warn("Erreur de redirection.");
2016-12-08 20:05:23 +01:00
} catch (IOException e) {
e.printStackTrace();
}
}
else
{
event.getTextChannel().sendMessage(event.getAuthor().getAsMention()+"\n:warning: **__Channel règlementé! Go sur over18!__**:warning: ").queue();
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) {
}
}