adds custom commands back to discord interface
adds custom commands back to discord interface and fixs a bug with unpacking
This commit is contained in:
parent
8c6d2a9701
commit
7103428c32
2 changed files with 31 additions and 16 deletions
|
|
@ -106,24 +106,25 @@ namespace BetterSecondBot.DiscordSupervisor
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string[] bits = message.Content.Split("|||");
|
string[] bits = message.Content.Split("|||");
|
||||||
if(bits.Length >= 2)
|
string target = "None";
|
||||||
|
if (bits.Length == 3)
|
||||||
{
|
{
|
||||||
string target = "None";
|
target = bits[2];
|
||||||
if (bits.Length == 3)
|
}
|
||||||
{
|
string args = "";
|
||||||
target = bits[2];
|
if (bits.Length == 3)
|
||||||
}
|
{
|
||||||
if (controler.Bot.getFullListOfCommands().Contains(bits[0].ToLowerInvariant()) == true)
|
args = bits[1];
|
||||||
{
|
}
|
||||||
controler.Bot.CallAPI(bits[0], bits[1].Split("~#~"), target);
|
if (controler.Bot.GetFullListOfCommandsWithCustoms().Contains(bits[0].ToLowerInvariant()) == true)
|
||||||
await MarkMessage(message, "✅").ConfigureAwait(false);
|
{
|
||||||
}
|
controler.Bot.CallAPI(bits[0], args.Split("~#~"), target);
|
||||||
else
|
await MarkMessage(message, "✅").ConfigureAwait(false);
|
||||||
{
|
}
|
||||||
await MarkMessage(message, "❌").ConfigureAwait(false);
|
else
|
||||||
}
|
{
|
||||||
|
await MarkMessage(message, "❌").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
await MarkMessage(message, "❌").ConfigureAwait(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,20 @@ namespace BetterSecondBot.bottypes
|
||||||
return output.ToArray();
|
return output.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string[] GetFullListOfCommandsWithCustoms()
|
||||||
|
{
|
||||||
|
List<string> output = new List<string>();
|
||||||
|
foreach (string A in endpointcommandmap.Keys)
|
||||||
|
{
|
||||||
|
output.Add(A.ToLowerInvariant());
|
||||||
|
}
|
||||||
|
foreach(string A in custom_commands.Keys)
|
||||||
|
{
|
||||||
|
output.Add(A.ToLowerInvariant());
|
||||||
|
}
|
||||||
|
return output.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
public void NotecardAddContent(string target_notecard_storage_id, string content)
|
public void NotecardAddContent(string target_notecard_storage_id, string content)
|
||||||
{
|
{
|
||||||
NotecardAddContent(target_notecard_storage_id, content, true, "\n\r");
|
NotecardAddContent(target_notecard_storage_id, content, true, "\n\r");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue