Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -19,7 +19,14 @@ public class CommandChoose extends Command
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args.trim().length() == 0)
|
||||
{
|
||||
res.Call(Stats.instance.GetHelpText(input.key));
|
||||
return;
|
||||
}
|
||||
|
||||
String [] choices = input.args.split(",");
|
||||
|
||||
if(choices.length == 1)
|
||||
{
|
||||
res.Call(LocStrings.Stub("ChooseOne"));
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package commands;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyEmbed;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.Response;
|
||||
import dataStructures.UserInput;
|
||||
|
||||
public class CommandColor extends Command
|
||||
{
|
||||
public CommandColor(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public String HelpText() { return LocStrings.Stub("ColorInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
int sideLength = 50;
|
||||
|
||||
float r = 0;
|
||||
float g = 0;
|
||||
float b = 0;
|
||||
float a = 1;
|
||||
Color parsed = new Color(r, g, b, a);
|
||||
|
||||
BufferedImage img = new BufferedImage(sideLength, sideLength, BufferedImage.TYPE_4BYTE_ABGR);
|
||||
Graphics2D graphics = img.createGraphics();
|
||||
graphics.setColor(parsed);
|
||||
graphics.fillRect(0, 0, sideLength, sideLength);
|
||||
graphics.dispose();
|
||||
|
||||
KittyEmbed response = new KittyEmbed();
|
||||
response.color = parsed;
|
||||
response.thumbnailURL = "attachment://test.png";
|
||||
|
||||
res.CallEmbed(response);
|
||||
//ImageIO.write(bufferedImage, "png", file);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -26,10 +26,6 @@ public class CommandHelp extends Command
|
||||
{
|
||||
help = LocStrings.Stub("HelpDisplay");
|
||||
}
|
||||
else
|
||||
{
|
||||
help = "`" + input.args + "`: " + help;
|
||||
}
|
||||
|
||||
res.Call(help);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user