This commit is contained in:
JustArchi
2019-02-23 05:02:22 +01:00
parent cd1a9d50de
commit 57272c2b31
2 changed files with 12 additions and 0 deletions

View File

@@ -57,6 +57,10 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
if (!string.IsNullOrEmpty(ASF.GlobalConfig.CommandPrefix) && command.StartsWith(ASF.GlobalConfig.CommandPrefix, StringComparison.Ordinal)) {
command = command.Substring(ASF.GlobalConfig.CommandPrefix.Length);
if (string.IsNullOrEmpty(command)) {
return BadRequest(new GenericResponse<string>(false, string.Format(Strings.ErrorIsEmpty, nameof(command))));
}
}
string response = await targetBot.Commands.Response(ASF.GlobalConfig.SteamOwnerID, command).ConfigureAwait(false);

View File

@@ -265,6 +265,14 @@ namespace ArchiSteamFarm.NLog {
continue;
}
if (!string.IsNullOrEmpty(ASF.GlobalConfig.CommandPrefix) && command.StartsWith(ASF.GlobalConfig.CommandPrefix, StringComparison.Ordinal)) {
command = command.Substring(ASF.GlobalConfig.CommandPrefix.Length);
if (string.IsNullOrEmpty(command)) {
continue;
}
}
Bot targetBot = Bot.Bots.OrderBy(bot => bot.Key).Select(bot => bot.Value).FirstOrDefault();
if (targetBot == null) {