= Updated DB info
This commit is contained in:
@@ -13,7 +13,7 @@ import dataStructures.KittyUser;
|
||||
import dataStructures.Response;
|
||||
import dataStructures.UserInput;
|
||||
|
||||
public class CommandCrouton extends Command
|
||||
public class CommandCrouton extends Command
|
||||
{
|
||||
public CommandCrouton(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class CommandDBFlush extends Command
|
||||
|
||||
KittyEmbed embed = new KittyEmbed();
|
||||
embed.title = "Database queue flushed";
|
||||
embed.descriptionText = "flushed: " + numUpdated;
|
||||
embed.descriptionText = "**Dirty:** " + numUpdated;
|
||||
embed.color = new Color(7*16, 8*16, 9*16);
|
||||
|
||||
res.CallEmbed(embed);
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package commands;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import core.Command;
|
||||
import core.DatabaseManager;
|
||||
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 CommandDBStats extends Command
|
||||
{
|
||||
DateFormat dateFormat;
|
||||
public CommandDBStats(KittyRole level, KittyRating rating)
|
||||
{
|
||||
super(level, rating);
|
||||
dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String HelpText() { return LocStrings.Stub("DBStatsInfo"); }
|
||||
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
KittyEmbed embed = new KittyEmbed();
|
||||
embed.title = "Database Info";
|
||||
embed.descriptionText = "**Tracked Items:** " + DatabaseManager.instance.GetTrackedObjectsSize();
|
||||
embed.descriptionText += "\n";
|
||||
embed.descriptionText += "**Last Upkeep:** " + dateFormat.format(DatabaseManager.instance.GetLastUpkeep()) + " UTC-7";
|
||||
embed.color = new Color(7*16, 8*16, 9*16);
|
||||
|
||||
res.CallEmbed(embed);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user