Initial Commit

Initial commit of project.
This commit is contained in:
Alex Stewart
2019-03-09 01:21:44 -08:00
parent e54e9653ed
commit 13420951b1
124 changed files with 5883 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
package commands;
import java.io.File;
import java.io.IOException;
import core.Command;
import dataStructures.*;
import network.*;
import utils.ImageUtils;
public class CommandWolfram extends Command
{
NetworkWolfram searcher = new NetworkWolfram();
public CommandWolfram(KittyRole level, KittyRating rating) { super(level, rating);}
@Override
public String HelpText() { return "Will query wolframalpha with your question and give a full image output of the answer"; }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
if(input.args == null || input.args.trim().length() == 0)
res.Call("You need to provide some arguments!");
try
{
File pic = new File(searcher.getWolfram(input.args));
res.CallFile(pic, "png");
ImageUtils.BlockingFileDelete(pic);
}
catch (IOException e)
{
res.Call("Something went wrong!");
}
}
}