mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Misc
This commit is contained in:
parent
1bbdce06c4
commit
7aff2ecbb1
2 changed files with 5 additions and 5 deletions
|
@ -72,14 +72,14 @@ namespace ArchiSteamFarm {
|
|||
}
|
||||
|
||||
[PublicAPI]
|
||||
public async Task<string> Response(ulong steamID, string message) {
|
||||
public async Task<string> Response(ulong steamID, string message, bool useCommandPrefix = true) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message)) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(steamID) + " || " + nameof(message));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Program.GlobalConfig.CommandPrefix)) {
|
||||
if (useCommandPrefix && !string.IsNullOrEmpty(Program.GlobalConfig.CommandPrefix)) {
|
||||
if (!message.StartsWith(Program.GlobalConfig.CommandPrefix, StringComparison.Ordinal)) {
|
||||
string pluginsResponse = await Core.OnBotMessage(Bot, steamID, message).ConfigureAwait(false);
|
||||
|
||||
|
|
|
@ -55,11 +55,11 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
|
|||
return BadRequest(new GenericResponse<string>(false, Strings.ErrorNoBotsDefined));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Program.GlobalConfig.CommandPrefix) && !command.StartsWith(Program.GlobalConfig.CommandPrefix, StringComparison.Ordinal)) {
|
||||
command = Program.GlobalConfig.CommandPrefix + command;
|
||||
if (!string.IsNullOrEmpty(Program.GlobalConfig.CommandPrefix) && command.StartsWith(Program.GlobalConfig.CommandPrefix, StringComparison.Ordinal)) {
|
||||
command = command.Substring(Program.GlobalConfig.CommandPrefix.Length);
|
||||
}
|
||||
|
||||
string response = await targetBot.Commands.Response(Program.GlobalConfig.SteamOwnerID, command).ConfigureAwait(false);
|
||||
string response = await targetBot.Commands.Response(Program.GlobalConfig.SteamOwnerID, command, false).ConfigureAwait(false);
|
||||
|
||||
return Ok(new GenericResponse<string>(response));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue