commit
bde2c05a58
2 changed files with 2 additions and 8 deletions
|
|
@ -47,7 +47,7 @@ public class Hadder {
|
||||||
new ShutdownCommand(),
|
new ShutdownCommand(),
|
||||||
new KickCommand(),
|
new KickCommand(),
|
||||||
new PingCommand(),
|
new PingCommand(),
|
||||||
new GifCommand(config),
|
new GifCommand(),
|
||||||
new ClearCommand(),
|
new ClearCommand(),
|
||||||
new GitHubCommand(),
|
new GitHubCommand(),
|
||||||
new ScreenshareCommand(),
|
new ScreenshareCommand(),
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,6 @@ import java.util.Random;
|
||||||
|
|
||||||
public class GifCommand implements Command {
|
public class GifCommand implements Command {
|
||||||
|
|
||||||
private Config config;
|
|
||||||
|
|
||||||
public GifCommand(Config config) {
|
|
||||||
this.config = config;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void executed(String[] args, CommandEvent event) {
|
public void executed(String[] args, CommandEvent event) {
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
|
|
@ -35,7 +29,7 @@ public class GifCommand implements Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
OkHttpClient caller = new OkHttpClient();
|
OkHttpClient caller = new OkHttpClient();
|
||||||
Request request = new Request.Builder().url("http://api.giphy.com/v1/gifs/search?q=" + query + "&api_key=" + config.getGiphyToken()).build();
|
Request request = new Request.Builder().url("http://api.giphy.com/v1/gifs/search?q=" + query + "&api_key=" + event.getConfig().getGiphyToken()).build();
|
||||||
try {
|
try {
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
Response response = caller.newCall(request).execute();
|
Response response = caller.newCall(request).execute();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue