mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Closes #1087
This commit is contained in:
@@ -73,32 +73,6 @@ namespace ArchiSteamFarm {
|
||||
return "<" + SharedInfo.ASF + "> " + response;
|
||||
}
|
||||
|
||||
[Obsolete("Use Response(steamID, message) instead, useCommandPrefix is obsolete and no longer used (same as false), this method will be removed in the next ASF version.", true)]
|
||||
[PublicAPI]
|
||||
[SuppressMessage("ReSharper", "MethodOverloadWithOptionalParameter")]
|
||||
public async Task<string> Response(ulong steamID, string message, bool useCommandPrefix = true) {
|
||||
// TODO: Delete the method entirely in the next ASF version
|
||||
ASF.ArchiLogger.LogGenericError(string.Format(Strings.WarningDeprecated, "[API] Response(steamID, message, useCommandPrefix)", "[API] Response(steamID, message)"));
|
||||
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message)) {
|
||||
Bot.ArchiLogger.LogNullError(nameof(steamID) + " || " + nameof(message));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (useCommandPrefix && !string.IsNullOrEmpty(ASF.GlobalConfig.CommandPrefix)) {
|
||||
if (!message.StartsWith(ASF.GlobalConfig.CommandPrefix, StringComparison.Ordinal)) {
|
||||
string pluginsResponse = await Core.OnBotMessage(Bot, steamID, message).ConfigureAwait(false);
|
||||
|
||||
return !string.IsNullOrEmpty(pluginsResponse) ? pluginsResponse : null;
|
||||
}
|
||||
|
||||
message = message.Substring(ASF.GlobalConfig.CommandPrefix.Length);
|
||||
}
|
||||
|
||||
return await Response(steamID, message).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[PublicAPI]
|
||||
public async Task<string> Response(ulong steamID, string message) {
|
||||
if ((steamID == 0) || string.IsNullOrEmpty(message)) {
|
||||
|
||||
Reference in New Issue
Block a user