+ Highly experimental last message info now saved
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package commands.dew;
|
||||
|
||||
import commands.dew.core.impl.DewCore;
|
||||
import core.Command;
|
||||
import core.LocStrings;
|
||||
import core.SubCommandFramework;
|
||||
@@ -11,8 +12,10 @@ import dataStructures.KittyUser;
|
||||
import dataStructures.Response;
|
||||
import dataStructures.UserInput;
|
||||
|
||||
public class CommandDew extends Command {
|
||||
|
||||
public class CommandDew extends Command
|
||||
{
|
||||
@SuppressWarnings("unused")
|
||||
public static DewCore core;
|
||||
SubCommandFramework framework = new SubCommandFramework();
|
||||
|
||||
@Override
|
||||
@@ -28,11 +31,14 @@ public class CommandDew extends Command {
|
||||
{
|
||||
super(level, rating);
|
||||
|
||||
core = new DewCore(framework);
|
||||
|
||||
framework.addCommand("luatest", new CommandDewLuaTest(KittyRole.Dev, KittyRating.Safe));
|
||||
framework.addCommand("realm", new CommandDewRealm(KittyRole.Dev, KittyRating.Safe));
|
||||
framework.addCommand("w", new CommandDewInput("w", KittyRole.Dev, KittyRating.Safe));
|
||||
framework.addCommand("a", new CommandDewInput("a", KittyRole.Dev, KittyRating.Safe));
|
||||
framework.addCommand("s", new CommandDewInput("s", KittyRole.Dev, KittyRating.Safe));
|
||||
framework.addCommand("d", new CommandDewInput("d", KittyRole.Dev, KittyRating.Safe));
|
||||
framework.addCommand("capture", new CommandDewCapture(KittyRole.Dev, KittyRating.Safe));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package commands.dew;
|
||||
|
||||
import commands.dew.adapter.KittyAdapterDewPlayer;
|
||||
import commands.dew.core.impl.DewCore;
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyRating;
|
||||
import dataStructures.KittyRole;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.UserInput;
|
||||
|
||||
public class CommandDewCapture extends SubCommand
|
||||
{
|
||||
public CommandDewCapture(KittyRole roleLevel, KittyRating contentRating)
|
||||
{
|
||||
super(roleLevel, contentRating);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
|
||||
{
|
||||
KittyAdapterDewPlayer player = DewCore.getOrCreate(user);
|
||||
DewCore.playersCaptured.add(player);
|
||||
return null;//new SubCommandFormattable("captured input for " + user.name);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package commands.dew;
|
||||
|
||||
import commands.dew.adapter.KittyAdapterDewPlayer;
|
||||
import commands.dew.core.impl.DewCore;
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
@@ -22,7 +23,7 @@ public class CommandDewInput extends SubCommand
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
|
||||
{
|
||||
KittyAdapterDewPlayer player = CommandDewRealm.getOrCreate(user);
|
||||
KittyAdapterDewPlayer player = DewCore.getOrCreate(user);
|
||||
|
||||
int x = player.getRealmX();
|
||||
int y = player.getRealmY();
|
||||
@@ -35,6 +36,6 @@ public class CommandDewInput extends SubCommand
|
||||
case "d": player.setRealmPos(x + 1, y); break;
|
||||
}
|
||||
|
||||
return new SubCommandFormattable(CommandDewRealm.drawWorld(player));
|
||||
return new SubCommandFormattable(DewCore.drawWorld(player));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package commands.dew;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import commands.dew.adapter.KittyAdapterDewPlayer;
|
||||
import commands.dew.core.data.DewMapTile;
|
||||
import commands.dew.core.data.DewRealm;
|
||||
import commands.dew.core.impl.DewCore;
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
@@ -17,100 +13,17 @@ import dataStructures.UserInput;
|
||||
|
||||
public class CommandDewRealm extends SubCommand
|
||||
{
|
||||
// TODO: CHANGE THIS! THIS IS TEMP STATIC, DO NOT CONTINUE TO DO THIS
|
||||
private static DewRealm realm;
|
||||
public static List<KittyAdapterDewPlayer> players;
|
||||
|
||||
public CommandDewRealm(KittyRole roleLevel, KittyRating contentRating)
|
||||
{
|
||||
super(roleLevel, contentRating);
|
||||
|
||||
realm = new DewRealm();
|
||||
players = new ArrayList<KittyAdapterDewPlayer>();
|
||||
|
||||
for(int y = 0; y < realm.map.length; ++y)
|
||||
{
|
||||
for(int x = 0; x < realm.map[y].length; ++x)
|
||||
{
|
||||
realm.map[y][x] = DewMapTile.Grass.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static KittyAdapterDewPlayer getOrCreate(KittyUser user)
|
||||
{
|
||||
for(KittyAdapterDewPlayer player : players)
|
||||
{
|
||||
if(player.getUniqueID() == user.uniqueID)
|
||||
{
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
||||
KittyAdapterDewPlayer player = new KittyAdapterDewPlayer(realm, user, 10, 10);
|
||||
players.add(player);
|
||||
return player;
|
||||
}
|
||||
|
||||
public static String drawWorld(KittyAdapterDewPlayer player)
|
||||
{
|
||||
// Build empty world buffer
|
||||
String[][] worldBuffer = new String[realm.map.length][realm.map[0].length];
|
||||
|
||||
// Build world
|
||||
for(int y = 0; y < realm.map.length; ++y)
|
||||
{
|
||||
for(int x = 0; x < realm.map[y].length; ++x)
|
||||
{
|
||||
switch(DewMapTile.values()[realm.map[y][x]])
|
||||
{
|
||||
case Grass:
|
||||
worldBuffer[y][x] = ",";
|
||||
break;
|
||||
|
||||
default:
|
||||
worldBuffer[y][x] = " ";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Build players
|
||||
for(KittyAdapterDewPlayer p : players)
|
||||
{
|
||||
worldBuffer[p.getRealmY()][p.getRealmX()] = p.getVisual();
|
||||
}
|
||||
|
||||
// Draw world
|
||||
String out = "";
|
||||
out += "**Realm ID - ** `" + realm.id + "`\n";
|
||||
|
||||
for(int y = 0; y < worldBuffer.length; ++y)
|
||||
{
|
||||
out += "`";
|
||||
|
||||
for(int x = 0; x < worldBuffer[y].length; ++x)
|
||||
{
|
||||
out += worldBuffer[y][x];
|
||||
}
|
||||
|
||||
out += "`";
|
||||
out += "\n";
|
||||
}
|
||||
|
||||
out += "**Stats**\n";
|
||||
out += "`Player Name` - `" + player.getName() + "`\n";
|
||||
out += "`Player Icon` - `" + player.getVisual() + "`\n";
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
|
||||
{
|
||||
KittyAdapterDewPlayer player = getOrCreate(user);
|
||||
KittyAdapterDewPlayer player = DewCore.getOrCreate(user);
|
||||
|
||||
String out = drawWorld(player);
|
||||
String out = DewCore.drawWorld(player);
|
||||
|
||||
return new SubCommandFormattable(out);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package commands.dew.core.data;
|
||||
|
||||
import commands.dew.core.api.IDewLuaSerializable;
|
||||
|
||||
public enum DewMapTile
|
||||
{
|
||||
// Assign multiples of 2 for flag purposes
|
||||
|
||||
@@ -1,11 +1,170 @@
|
||||
package commands.dew.core.impl;
|
||||
|
||||
import commands.dew.core.api.IDewPlayer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import commands.dew.adapter.KittyAdapterDewPlayer;
|
||||
import commands.dew.core.data.DewMapTile;
|
||||
import commands.dew.core.data.DewRealm;
|
||||
import core.SubCommandFormattable;
|
||||
import core.SubCommandFramework;
|
||||
import dataStructures.KittyChannel;
|
||||
import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.Response;
|
||||
import dataStructures.UserInput;
|
||||
import utils.GlobalLog;
|
||||
import utils.LogFilter;
|
||||
|
||||
public class DewCore
|
||||
{
|
||||
public DewCore(IDewPlayer player)
|
||||
// TODO: Make realm and players both per-realm
|
||||
public static DewRealm realm;
|
||||
public static List<KittyAdapterDewPlayer> players;
|
||||
public static List<KittyAdapterDewPlayer> playersCaptured;
|
||||
private static SubCommandFramework framework;
|
||||
|
||||
public DewCore(SubCommandFramework framework)
|
||||
{
|
||||
DewCore.framework = framework;
|
||||
DewCore.realm = new DewRealm();
|
||||
DewCore.players = new ArrayList<KittyAdapterDewPlayer>();
|
||||
DewCore.playersCaptured = new ArrayList<KittyAdapterDewPlayer>();
|
||||
|
||||
for(int y = 0; y < realm.map.length; ++y)
|
||||
{
|
||||
for(int x = 0; x < realm.map[y].length; ++x)
|
||||
{
|
||||
realm.map[y][x] = DewMapTile.Grass.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Returns false if not captured, true if captured.
|
||||
public static boolean ProcessIfCaptured(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput baseInput, Response res)
|
||||
{
|
||||
// Search for a captured player.
|
||||
KittyAdapterDewPlayer player = null;
|
||||
for(KittyAdapterDewPlayer p : playersCaptured)
|
||||
{
|
||||
if(p.getUniqueID() == user.uniqueID)
|
||||
{
|
||||
player = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If we didn't find that the person is captured, return false since we don't need to do anything.
|
||||
if(player == null)
|
||||
return false;
|
||||
|
||||
// See if we run anything - also, check to see if we need to exit.
|
||||
boolean didRun = false;
|
||||
try
|
||||
{
|
||||
UserInput toEdit = new UserInput(baseInput);
|
||||
String key = toEdit.message.toLowerCase().trim();
|
||||
toEdit.key = key;
|
||||
toEdit.args = key;
|
||||
switch(key)
|
||||
{
|
||||
case "cap":
|
||||
case "capture":
|
||||
case "uncapture":
|
||||
case "stop":
|
||||
case "quit":
|
||||
case "exit":
|
||||
playersCaptured.remove(player);
|
||||
return false;
|
||||
}
|
||||
|
||||
SubCommandFormattable f = framework.run(guild, channel, user, toEdit);
|
||||
|
||||
if(f != null)
|
||||
{
|
||||
Response.LastSendMessage.editMessage(f.resString).complete();
|
||||
//f.Call(res);
|
||||
didRun = true;
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
GlobalLog.error(LogFilter.Command, e);
|
||||
}
|
||||
|
||||
if(didRun)
|
||||
{
|
||||
baseInput.deleteOriginInput();
|
||||
}
|
||||
|
||||
return didRun;
|
||||
}
|
||||
|
||||
public static KittyAdapterDewPlayer getOrCreate(KittyUser user)
|
||||
{
|
||||
for(KittyAdapterDewPlayer player : players)
|
||||
{
|
||||
if(player.getUniqueID() == user.uniqueID)
|
||||
{
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
||||
KittyAdapterDewPlayer player = new KittyAdapterDewPlayer(realm, user, 10, 10);
|
||||
players.add(player);
|
||||
return player;
|
||||
}
|
||||
|
||||
public static String drawWorld(KittyAdapterDewPlayer player)
|
||||
{
|
||||
// Build empty world buffer
|
||||
String[][] worldBuffer = new String[realm.map.length][realm.map[0].length];
|
||||
|
||||
// Build world
|
||||
for(int y = 0; y < realm.map.length; ++y)
|
||||
{
|
||||
for(int x = 0; x < realm.map[y].length; ++x)
|
||||
{
|
||||
switch(DewMapTile.values()[realm.map[y][x]])
|
||||
{
|
||||
case Grass:
|
||||
worldBuffer[y][x] = ",";
|
||||
break;
|
||||
|
||||
default:
|
||||
worldBuffer[y][x] = " ";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Build players
|
||||
for(KittyAdapterDewPlayer p : players)
|
||||
{
|
||||
worldBuffer[p.getRealmY()][p.getRealmX()] = p.getVisual();
|
||||
}
|
||||
|
||||
// Draw world
|
||||
String out = "";
|
||||
out += "**Realm ID - ** `" + realm.id + "`\n";
|
||||
|
||||
for(int y = 0; y < worldBuffer.length; ++y)
|
||||
{
|
||||
out += "`";
|
||||
|
||||
for(int x = 0; x < worldBuffer[y].length; ++x)
|
||||
{
|
||||
out += worldBuffer[y][x];
|
||||
}
|
||||
|
||||
out += "`";
|
||||
out += "\n";
|
||||
}
|
||||
|
||||
out += "**Stats**\n";
|
||||
out += "`Player Name` - `" + player.getName() + "`\n";
|
||||
out += "`Player Icon` - `" + player.getVisual() + "`\n";
|
||||
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package commands.dew.core.impl;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import org.luaj.vm2.Globals;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package commands.music;
|
||||
|
||||
import com.google.api.services.youtube.YouTube;
|
||||
|
||||
import core.SubCommand;
|
||||
import core.SubCommandFormattable;
|
||||
import dataStructures.KittyChannel;
|
||||
@@ -13,13 +11,11 @@ import dataStructures.UserInput;
|
||||
|
||||
public class SubCommandAddTrack extends SubCommand
|
||||
{
|
||||
|
||||
public SubCommandAddTrack(KittyRole level, KittyRating rating) { super(level, rating); }
|
||||
|
||||
@Override
|
||||
public SubCommandFormattable OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import dataStructures.KittyGuild;
|
||||
import dataStructures.KittyUser;
|
||||
import dataStructures.UserInput;
|
||||
import utils.GlobalLog;
|
||||
import utils.LogFilter;
|
||||
|
||||
public class SubCommandFramework
|
||||
{
|
||||
@@ -41,10 +42,14 @@ public class SubCommandFramework
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
GlobalLog.error(LogFilter.Command, e);
|
||||
|
||||
String help = Stats.instance.getHelpText(input.key);
|
||||
|
||||
if(help != null)
|
||||
return new SubCommandFormattable(help);
|
||||
return new SubCommandFormattable("Something has gone very wrong.");
|
||||
|
||||
return new SubCommandFormattable("Whoops! Internal subcommand error!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import java.io.InputStream;
|
||||
|
||||
import net.dv8tion.jda.core.JDA;
|
||||
import net.dv8tion.jda.core.MessageBuilder;
|
||||
import net.dv8tion.jda.core.entities.Message;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.events.message.guild.*;
|
||||
import net.dv8tion.jda.core.EmbedBuilder;
|
||||
@@ -16,6 +17,9 @@ import utils.LogFilter;
|
||||
// commands aren't exposed to the GuildMessageReceivedEvent then we should be fine.
|
||||
public class Response
|
||||
{
|
||||
// Last message
|
||||
public static Message LastSendMessage = null;
|
||||
|
||||
// Variables
|
||||
private GuildMessageReceivedEvent event;
|
||||
private final int discordMessageMax = 2000;
|
||||
@@ -75,7 +79,7 @@ public class Response
|
||||
File thumbImage = new File(thumbName);
|
||||
if(thumbImage.exists())
|
||||
{
|
||||
event.getChannel().sendFile(thumbImage, thumbName, message.build()).queue();
|
||||
LastSendMessage = event.getChannel().sendFile(thumbImage, thumbName, message.build()).complete();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -83,7 +87,7 @@ public class Response
|
||||
if(embedInfo.thumbnailURL != null)
|
||||
embed.setThumbnail(embedInfo.thumbnailURL);
|
||||
|
||||
event.getChannel().sendMessage(embed.build()).queue();
|
||||
LastSendMessage = event.getChannel().sendMessage(embed.build()).complete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,11 +97,11 @@ public class Response
|
||||
GlobalLog.log(LogFilter.Response, "Sending response: " + toRespondWith);
|
||||
if(toRespondWith.length() > discordMessageMax)
|
||||
{
|
||||
event.getChannel().sendMessage(toRespondWith.substring(0, kittyMessageMax) + "\n\nI think that's enough!").queue();
|
||||
LastSendMessage = event.getChannel().sendMessage(toRespondWith.substring(0, kittyMessageMax) + "\n\nI think that's enough!").complete();
|
||||
}
|
||||
else
|
||||
{
|
||||
event.getChannel().sendMessage(toRespondWith).queue();
|
||||
LastSendMessage = event.getChannel().sendMessage(toRespondWith).complete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,11 +112,11 @@ public class Response
|
||||
channel = kitty.getTextChannelById(Long.parseLong(channelID));
|
||||
if(toRespondWith.length() > discordMessageMax)
|
||||
{
|
||||
channel.sendMessage(toRespondWith.substring(0, kittyMessageMax) + "\n\nI think that's enough!").queue();
|
||||
LastSendMessage = channel.sendMessage(toRespondWith.substring(0, kittyMessageMax) + "\n\nI think that's enough!").complete();
|
||||
}
|
||||
else
|
||||
{
|
||||
channel.sendMessage(toRespondWith).queue();
|
||||
LastSendMessage = channel.sendMessage(toRespondWith).complete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,11 +126,11 @@ public class Response
|
||||
GlobalLog.log(LogFilter.Response, "Sending immediate response: " + toRespondWith);
|
||||
if(toRespondWith.length() > discordMessageMax)
|
||||
{
|
||||
event.getChannel().sendMessage(toRespondWith.substring(0, kittyMessageMax) + "\n\nI think that's enough!");
|
||||
LastSendMessage = event.getChannel().sendMessage(toRespondWith.substring(0, kittyMessageMax) + "\n\nI think that's enough!").complete();
|
||||
}
|
||||
else
|
||||
{
|
||||
event.getChannel().sendMessage(toRespondWith).complete();
|
||||
LastSendMessage = event.getChannel().sendMessage(toRespondWith).complete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,13 +138,13 @@ public class Response
|
||||
public void sendFile(File toRespondWith, String extension)
|
||||
{
|
||||
GlobalLog.log(LogFilter.Response, "Sending file response");
|
||||
event.getChannel().sendFile(toRespondWith, "return." + extension).queue();
|
||||
LastSendMessage = event.getChannel().sendFile(toRespondWith, "return." + extension).complete();
|
||||
}
|
||||
|
||||
// Queues an input stream response to the channel that issued the command.
|
||||
public void sendFile(InputStream in, String extension)
|
||||
{
|
||||
GlobalLog.log(LogFilter.Response, "Sending input stream response");
|
||||
event.getChannel().sendFile(in, "return." + extension).queue();
|
||||
LastSendMessage = event.getChannel().sendFile(in, "return." + extension).complete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import core.ObjectBuilderFactory;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.Message;
|
||||
import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent;
|
||||
|
||||
public class UserInput
|
||||
@@ -14,6 +15,7 @@ public class UserInput
|
||||
public KittyUser [] mentions;
|
||||
private boolean isValid;
|
||||
public String message;
|
||||
private Message internalJDAMessage;
|
||||
|
||||
// NOTE(wisp): Designed to parse a string as it's constructed.
|
||||
// If a user enters the command "!ping some stuff here :D"
|
||||
@@ -25,6 +27,7 @@ public class UserInput
|
||||
// The CommandIndicator and spaces between the key and args are dropped.
|
||||
public UserInput(GuildMessageReceivedEvent event, KittyGuild guildContext)
|
||||
{
|
||||
this.internalJDAMessage = event.getMessage();
|
||||
String toParse = event.getMessage().getContentRaw();
|
||||
message = toParse;
|
||||
|
||||
@@ -61,6 +64,18 @@ public class UserInput
|
||||
}
|
||||
}
|
||||
|
||||
// Copy Constructor
|
||||
public UserInput(UserInput other)
|
||||
{
|
||||
this.key = other.key;
|
||||
this.args = other.args;
|
||||
this.mentions = other.mentions;
|
||||
this.isValid = other.isValid;
|
||||
this.message = other.message;
|
||||
this.internalJDAMessage = other.internalJDAMessage;
|
||||
}
|
||||
|
||||
|
||||
// Used for injecting direct commands from plugins
|
||||
public UserInput(String input, KittyGuild contextGuild)
|
||||
{
|
||||
@@ -75,6 +90,12 @@ public class UserInput
|
||||
return isValid;
|
||||
}
|
||||
|
||||
// This deletes the input that was originally sent
|
||||
public void deleteOriginInput()
|
||||
{
|
||||
internalJDAMessage.delete().queue();
|
||||
}
|
||||
|
||||
// Finds first whitespace in the string
|
||||
private int findFirstWhitespace(String str)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
||||
import commands.dew.core.impl.DewCore;
|
||||
import core.CharacterManager;
|
||||
import core.CommandEnabler;
|
||||
import core.CommandManager;
|
||||
@@ -89,6 +90,10 @@ public class Main extends ListenerAdapter
|
||||
if(!Superintendent.perCommandUpkeepPre(pluginManager))
|
||||
return;
|
||||
|
||||
// TODO: Condense outer if somehow...
|
||||
if(!DewCore.ProcessIfCaptured(guild, channel, user, input, response))
|
||||
{
|
||||
|
||||
// Attempt to spin up a command. If the command doesn't exist.
|
||||
// Run plugins right before invoking the commands but after all other setup.
|
||||
if(commandManager.invokeOnNewThread(guild, channel, user, input, response) == false)
|
||||
@@ -111,6 +116,8 @@ public class Main extends ListenerAdapter
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Run any upkeep in post we need to
|
||||
if(!Superintendent.perCommandUpkeepPost(kittyCore, databaseManager))
|
||||
return;
|
||||
|
||||
@@ -2,6 +2,7 @@ package main;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import commands.dew.core.impl.DewCore;
|
||||
import core.Config;
|
||||
import core.DatabaseManager;
|
||||
import core.RPManager;
|
||||
|
||||
Reference in New Issue
Block a user