This commit is contained in:
GregTCLTK 2020-01-20 20:36:06 +01:00
parent e807f2c2ff
commit 2fb0b90b22
No known key found for this signature in database
GPG key ID: A91BADE5C070FF67

View file

@ -7,11 +7,7 @@ package com.bbn.hadder.commands.nsfw;
import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.Command;
import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.commands.CommandEvent;
import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.MessageEditor;
import okhttp3.OkHttpClient; import com.bbn.hadder.utils.Request;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
public class PussyCommand implements Command { public class PussyCommand implements Command {
@ -19,23 +15,13 @@ public class PussyCommand implements Command {
public void executed(String[] args, CommandEvent e) { public void executed(String[] args, CommandEvent e) {
if (e.getTextChannel().isNSFW()) { if (e.getTextChannel().isNSFW()) {
OkHttpClient caller = new OkHttpClient(); String url = Request.get("https://nekos.life/api/v2/img/pussy/");
Request request = new Request.Builder().url("https://nekos.life/api/v2/img/pussy").build();
try { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
.setAuthor(e.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url)
Response response = caller.newCall(request).execute(); .setImage(url)
String url = response.body().string().replace("{\"url\":\"", ""); .setFooter("Pussy")
.build()).queue();
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO)
.setAuthor(e.getMessageEditor().getTerm("commands.nsfw.gif.error.title"), url.replace("\"}", ""))
.setImage(url.replace("\"}", ""))
.setFooter("Pussy")
.build()).queue();
} catch (IOException ex) {
ex.printStackTrace();
}
} else { } else {
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue(); e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_NSFW).build()).queue();