use of com.sx4.bot.entities.image.ImageRequest in project Sx4 by sx4-discord-bot.
the class DriftCommand method onCommand.
public void onCommand(Sx4CommandEvent event, @Argument(value = "user", nullDefault = true) Member member, @Argument(value = "left text") @Limit(max = 30) String leftText, @Argument(value = "right text", endless = true, nullDefault = true) @Limit(max = 40) String rightText) {
ImageRequest request = new ImageRequest(event.getConfig().getImageWebserverUrl("drift")).addQuery("left_text", leftText).addQuery("image", (member == null ? event.getAuthor() : member.getUser()).getEffectiveAvatarUrl());
if (rightText != null) {
request.addQuery("right_text", rightText);
}
event.getHttpClient().newCall(request.build(event.getConfig().getImageWebserver())).enqueue((HttpCallback) response -> ImageUtility.getImageMessage(event, response).queue());
}
use of com.sx4.bot.entities.image.ImageRequest in project Sx4 by sx4-discord-bot.
the class FearCommand method onCommand.
public void onCommand(Sx4CommandEvent event, @Argument(value = "image url", endless = true, acceptEmpty = true) @ImageUrl String imageUrl) {
Request request = new ImageRequest(event.getConfig().getImageWebserverUrl("fear")).addQuery("image", imageUrl).build(event.getConfig().getImageWebserver());
event.getHttpClient().newCall(request).enqueue((HttpCallback) response -> ImageUtility.getImageMessage(event, response).queue());
}
use of com.sx4.bot.entities.image.ImageRequest in project Sx4 by sx4-discord-bot.
the class HalloweenCommand method onCommand.
public void onCommand(Sx4CommandEvent event, @Argument(value = "image url", endless = true, acceptEmpty = true) @ImageUrl String imageUrl) {
Request request = new ImageRequest(event.getConfig().getImageWebserverUrl("halloween")).addQuery("image", imageUrl).build(event.getConfig().getImageWebserver());
event.getHttpClient().newCall(request).enqueue((HttpCallback) response -> ImageUtility.getImageMessage(event, response).queue());
}
use of com.sx4.bot.entities.image.ImageRequest in project Sx4 by sx4-discord-bot.
the class HowToGoogleCommand method onCommand.
public void onCommand(Sx4CommandEvent event, @Argument(value = "query", endless = true) @Limit(max = 50) String query) {
Request request = new ImageRequest(event.getConfig().getImageWebserverUrl("google")).addQuery("q", query).build(event.getConfig().getImageWebserver());
event.getHttpClient().newCall(request).enqueue((HttpCallback) response -> ImageUtility.getImageMessage(event, response).queue());
}
use of com.sx4.bot.entities.image.ImageRequest in project Sx4 by sx4-discord-bot.
the class HueCommand method onCommand.
public void onCommand(Sx4CommandEvent event, @Argument(value = "image url", endless = true, acceptEmpty = true) @ImageUrl String imageUrl) {
Request request = new ImageRequest(event.getConfig().getImageWebserverUrl("hue")).addQuery("image", imageUrl).build(event.getConfig().getImageWebserver());
event.getHttpClient().newCall(request).enqueue((HttpCallback) response -> ImageUtility.getImageMessage(event, response).queue());
}
Aggregations