Make a few minor changes to allow discord commands to execute

This commit is contained in:
Zontreck 2020-07-07 00:36:29 -07:00
parent 6531716382
commit 43146d733d
4 changed files with 23 additions and 9 deletions

View file

@ -124,7 +124,7 @@ namespace Bot.CommandSystem
}
[CommandGroup("terminate_bot", 5, 0, "", Destinations.DEST_LOCAL | Destinations.DEST_AGENT | Destinations.DEST_DISCORD)]
[CommandGroup("terminate_bot", 5, 0, "", Destinations.DEST_LOCAL | Destinations.DEST_AGENT | Destinations.DEST_DISCORD | Destinations.DEST_GROUP)]
public void PerformExit(UUID client, int level, string[] additionalArgs, Destinations source, UUID agentKey, string agentName)
{
MHE(source, client, "Bot exit initiated.");

View file

@ -219,6 +219,7 @@ namespace Bot.CommandSystem
if ((dests & Destinations.DEST_AGENT) == source) Allowed = true;
if ((dests & Destinations.DEST_GROUP) == source) Allowed = true;
if ((dests & Destinations.DEST_LOCAL) == source) Allowed = true;
if ((dests & Destinations.DEST_DISCORD) == source) Allowed = true;
if (!Allowed)
{
@ -248,7 +249,8 @@ namespace Bot.CommandSystem
cgX.AssignedMethod.Invoke(ovj, new object[] { user,level,additionalArgs, source,agentKey, agentName });
}catch(Exception e)
{
MessageFactory.Post(Destinations.DEST_LOCAL, "Exception caught when executing a command\n" + e.Message + "\nStacktrace: " + e.StackTrace, UUID.Zero);
BotSession.Instance.grid.Self.Chat("Exception caught when executing a command\n" + e.Message + "\nStacktrace: " + e.StackTrace, 0, ChatType.Shout);
//MessageFactory.Post(Destinations.DEST_LOCAL, "Exception caught when executing a command\n" + e.Message + "\nStacktrace: " + e.StackTrace, UUID.Zero);
}
});
CMDThread.Start();