Correct redirection Bug
Correct redirection bug on SM commande and implement multi rediction attempt
This commit is contained in:
parent
69355fb123
commit
475c968a94
@ -23,13 +23,28 @@ public class Madame implements Commande{
|
|||||||
public void action(String[] args, MessageReceivedEvent event) {
|
public void action(String[] args, MessageReceivedEvent event) {
|
||||||
if(!event.getTextChannel().getName().equals("le_cours")) {
|
if(!event.getTextChannel().getName().equals("le_cours")) {
|
||||||
Redirection redirect = new Redirection();
|
Redirection redirect = new Redirection();
|
||||||
try {
|
boolean success=false;
|
||||||
event.getTextChannel().sendMessage(redirect.get("http://dites.bonjourmadame.fr/random")).queue();
|
boolean error=false;
|
||||||
} catch (IOException e) {
|
int errorCp=0;
|
||||||
System.out.println(entete.get("ERREUR", "Madame") + "Erreur de redirection.");
|
while(!success&&!error)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
event.getTextChannel().sendMessage(redirect.get("http://dites.bonjourmadame.fr/random")).queue();
|
||||||
|
success=true;
|
||||||
|
} catch (IOException e) {
|
||||||
|
errorCp++;
|
||||||
|
System.out.println(entete.get("WARN", "Madame") + "Erreur de redirection. (Essais n°"+errorCp+")");
|
||||||
|
if(errorCp>5)
|
||||||
|
{
|
||||||
|
System.out.println(entete.get("WARN", "Madame") + "5 Erreur de redirection.");
|
||||||
|
error=true;
|
||||||
|
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur de redirection (5 essais), Réessayez__**:warning: ").queue();
|
||||||
|
|
||||||
event.getTextChannel().sendMessage(event.getAuthor().getAsMention() + "\n:warning: **__Erreur de redirection, Réessayez__**:warning: ").queue();
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -25,9 +25,9 @@ public class SM implements Commande {
|
|||||||
if(event.getTextChannel().getName().equals("over18"))
|
if(event.getTextChannel().getName().equals("over18"))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
event.getTextChannel().sendMessage(redirect.get("http://bonjourfetish.tumblr.com/random")).queue();
|
event.getTextChannel().sendMessage(redirect.get("https://bonjourfetish.tumblr.com/random")).queue();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println(entete.get("ERREUR","Pipe")+"Erreur de redirection.");
|
System.out.println(entete.get("ERREUR","SM")+"Erreur de redirection.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user