+Moved guildrole commands to subcommand routine

This commit is contained in:
Alex
2019-06-30 03:20:46 -04:00
parent df7973b3d7
commit 392ba0e19c
73 changed files with 353 additions and 447 deletions
+30
View File
@@ -0,0 +1,30 @@
package commands.general;
import core.*;
import dataStructures.*;
public class CommandPollShow extends Command
{
public CommandPollShow(KittyRole level, KittyRating rating) { super(level, rating); }
@Override
public String getHelpText() { return LocStrings.stub("PollShowInfo"); }
@Override
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
if(!guild.polling)
{
res.send(LocStrings.stub("PollShowNoPoll"));
return;
}
String poll = String.format(LocStrings.stub("PollShowPoll"), guild.poll);
poll += LocStrings.stub("PollShowChoices");
for(int i = 0; i < guild.choices.size(); i++)
{
poll += (i+1) + ": `" + guild.choices.get(i).choice + "`\n";
}
res.send(poll);
}
}