+ Added Teey command
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 60 KiB |
@@ -59,6 +59,9 @@ You successfully voted for=
|
|||||||
[CommandShutdown]
|
[CommandShutdown]
|
||||||
Stops kitty. `-s` or `safe` as an argument attempts to sync off the database before shutdown.=
|
Stops kitty. `-s` or `safe` as an argument attempts to sync off the database before shutdown.=
|
||||||
|
|
||||||
|
[CommandTeey]
|
||||||
|
Teey yourself back into existance, or teey a friend with @!=
|
||||||
|
|
||||||
[CommandBetBeans]
|
[CommandBetBeans]
|
||||||
That's not a valid bet!=
|
That's not a valid bet!=
|
||||||
Please bet with at least 50 beans!=
|
Please bet with at least 50 beans!=
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package commands;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import core.Command;
|
||||||
|
import core.Localizer;
|
||||||
|
import dataStructures.KittyChannel;
|
||||||
|
import dataStructures.KittyGuild;
|
||||||
|
import dataStructures.KittyRating;
|
||||||
|
import dataStructures.KittyRole;
|
||||||
|
import dataStructures.KittyUser;
|
||||||
|
import dataStructures.Response;
|
||||||
|
import dataStructures.UserInput;
|
||||||
|
import utils.ImageOverlayBuilder;
|
||||||
|
import utils.ImageUtils;
|
||||||
|
|
||||||
|
public class CommandTeey extends Command
|
||||||
|
{
|
||||||
|
// Required constructor
|
||||||
|
public CommandTeey(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||||
|
|
||||||
|
private static Long num = 0l;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String HelpText() { return Localizer.Stub("Teey yourself back into existance, or teey a friend with @!"); }
|
||||||
|
|
||||||
|
// Called when the command is run!
|
||||||
|
@Override
|
||||||
|
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||||
|
{
|
||||||
|
String name = null;
|
||||||
|
File teeyFile = null;
|
||||||
|
File teeyeeFile = null;
|
||||||
|
|
||||||
|
synchronized(num)
|
||||||
|
{
|
||||||
|
name = "teey_" + num + ".gif";
|
||||||
|
++num;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
KittyUser person = null;
|
||||||
|
|
||||||
|
if(input.mentions == null)
|
||||||
|
person = user;
|
||||||
|
else
|
||||||
|
person = input.mentions[0];
|
||||||
|
|
||||||
|
String yeeteeFilename = ImageUtils.DownloadFromURL(person.avatarID, ".png");
|
||||||
|
if(yeeteeFilename == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
teeyeeFile = new File(yeeteeFilename);
|
||||||
|
ImageOverlayBuilder builder = new ImageOverlayBuilder("assets/teey/frames/", "teey ", 24, 18);
|
||||||
|
builder.Overlay(ImageIO.read(teeyeeFile), name);
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
teeyFile = new File (name);
|
||||||
|
res.CallFile(teeyFile, "gif");
|
||||||
|
|
||||||
|
// Thread cleanup...
|
||||||
|
ImageUtils.BlockingFileDelete(teeyFile);
|
||||||
|
ImageUtils.BlockingFileDelete(teeyeeFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,6 @@ import utils.ImageUtils;
|
|||||||
|
|
||||||
public class CommandYeet extends Command
|
public class CommandYeet extends Command
|
||||||
{
|
{
|
||||||
|
|
||||||
// Required constructor
|
// Required constructor
|
||||||
public CommandYeet(KittyRole level, KittyRating rating) { super(level, rating); }
|
public CommandYeet(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||||
|
|
||||||
@@ -45,13 +44,9 @@ public class CommandYeet extends Command
|
|||||||
KittyUser person = null;
|
KittyUser person = null;
|
||||||
|
|
||||||
if(input.mentions == null)
|
if(input.mentions == null)
|
||||||
{
|
|
||||||
person = user;
|
person = user;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
person = input.mentions[0];
|
person = input.mentions[0];
|
||||||
}
|
|
||||||
|
|
||||||
String yeeteeFilename = ImageUtils.DownloadFromURL(person.avatarID, ".png");
|
String yeeteeFilename = ImageUtils.DownloadFromURL(person.avatarID, ".png");
|
||||||
if(yeeteeFilename == null)
|
if(yeeteeFilename == null)
|
||||||
|
|||||||
@@ -300,6 +300,7 @@ public class ObjectBuilderFactory
|
|||||||
manager.Register("givebeans", new CommandGiveBeans(KittyRole.Mod, KittyRating.Safe));
|
manager.Register("givebeans", new CommandGiveBeans(KittyRole.Mod, KittyRating.Safe));
|
||||||
manager.Register("rpg", new CommandRPG(KittyRole.Mod, KittyRating.Safe));
|
manager.Register("rpg", new CommandRPG(KittyRole.Mod, KittyRating.Safe));
|
||||||
|
|
||||||
|
manager.Register("teey", new CommandTeey(KittyRole.General, KittyRating.Safe));
|
||||||
manager.Register(new String[]{"perish", "thenperish"}, new CommandPerish(KittyRole.General, KittyRating.Safe));
|
manager.Register(new String[]{"perish", "thenperish"}, new CommandPerish(KittyRole.General, KittyRating.Safe));
|
||||||
manager.Register("yeet", new CommandYeet(KittyRole.General, KittyRating.Safe));
|
manager.Register("yeet", new CommandYeet(KittyRole.General, KittyRating.Safe));
|
||||||
manager.Register("ping", new CommandPing(KittyRole.General, KittyRating.Safe));
|
manager.Register("ping", new CommandPing(KittyRole.General, KittyRating.Safe));
|
||||||
|
|||||||