= Updated plugins to each have their own global context

This commit is contained in:
Matthew Cech
2019-04-20 23:02:43 -07:00
parent 30ed670218
commit 25d8d51b1d
6 changed files with 71 additions and 71 deletions
+11 -7
View File
@@ -75,14 +75,18 @@ public class Main extends ListenerAdapter
// RP logging system
RPManager.instance.addLine(channel, user, input);
// Run plugins right before invoking the commands but after all other setup
String output = pluginManager.CallAll(input.message);
//
// Spin up the command if no plugins ran. Otherwise, send a response.
if(output == null)
commandManager.InvokeOnNewThread(guild, channel, user, input, response);
else
response.Call(output);
// 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)
{
String pluginOutput = pluginManager.RunAll(input.message);
if(pluginOutput != null)
response.Call(pluginOutput);
}
// Run any upkeep we need to
PerCommandUpkeep();