Update Inbound.cs

improve / fix discord inbound
This commit is contained in:
Madpeterz 2021-04-02 20:50:22 +01:00
parent 4f93c8f312
commit 242ea5b7fa

View file

@ -111,15 +111,15 @@ namespace BetterSecondBot.DiscordSupervisor
{ {
target = bits[2]; target = bits[2];
} }
string args = ""; string args = null;
if (bits.Length == 3) if (bits.Length >= 2)
{ {
args = bits[1]; args = bits[1];
} }
if (controler.getBot().GetFullListOfCommandsWithCustoms().Contains(bits[0].ToLowerInvariant()) == true) if (controler.getBot().GetFullListOfCommandsWithCustoms().Contains(bits[0].ToLowerInvariant()) == true)
{ {
controler.getBot().CallAPI(bits[0], args.Split("~#~"), target); string reply = controler.getBot().CallAPI(bits[0], args.Split("~#~"), target);
await MarkMessage(message, "✅").ConfigureAwait(false); await message.Channel.SendMessageAsync(reply, false, null,null,null, new MessageReference(message.Id)).ConfigureAwait(false);
} }
else else
{ {