Fix error message

This commit is contained in:
GregTCLTK 2020-01-21 16:54:13 +01:00
parent db81e6cce9
commit 511ae6e13b
No known key found for this signature in database
GPG key ID: A91BADE5C070FF67

View file

@ -24,6 +24,7 @@ import net.dv8tion.jda.api.entities.User;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
@ -87,11 +88,13 @@ public class AvatarCommand implements Command {
.setImage(url)
.setFooter(json.getString("username") + "#" + json.getString("discriminator"))
.build()).queue();
} catch (IOException ex) {
} catch (JSONException ex) {
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
"commands.fun.avatar.error.title",
"commands.fun.avatar.error.description"
).build()).queue();
} catch (Exception ex) {
ex.printStackTrace();
}
}
} else {