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
+38
View File
@@ -0,0 +1,38 @@
package commands;
import core.Command;
import dataStructures.*;
public class CommandGiveBeans extends Command
{
public CommandGiveBeans (KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String HelpText() { return "Gives beans to the mentioned users!"; }
@Override
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
int beans = 0;
try {
beans = Integer.parseInt(input.args.split(" ")[0]);
}
catch (NumberFormatException e)
{
res.Call("That's not a valid number!");
return;
}
if(input.mentions == null)
{
res.Call("You didn't mention anyone!");
return;
}
for(int i = 0; i < input.mentions.length; i++)
{
input.mentions[i].ChangeBeans(beans);
res.Call("Gave " + input.mentions[i].name + " " + beans + " beans!");
}
}
}