Detect Advertisement on madame #16
This commit is contained in:
parent
e0b5199e72
commit
8b9c9e9ed7
@ -31,8 +31,16 @@ public class Madame implements Commande{
|
||||
while(!success && !error)
|
||||
{
|
||||
try {
|
||||
|
||||
String url = redirect.get("http://dites.bonjourmadame.fr/random");
|
||||
if((url.contains("club") && (url.contains("rejoindre") || url.contains("rejoignez"))) || (url.contains("samedi") && url.contains("dimanche"))){
|
||||
logger.debug("Advertisement detected! Retry! ("+url+")");
|
||||
}
|
||||
else{
|
||||
event.getTextChannel().sendMessage(redirect.get("http://dites.bonjourmadame.fr/random")).queue();
|
||||
success=true;
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
errorCp++;
|
||||
logger.warn("Erreur de redirection. (Essais n°"+errorCp+")");
|
||||
|
Loading…
Reference in New Issue
Block a user