This commit is contained in:
JustArchi
2019-03-06 23:01:15 +01:00
parent c579053455
commit 000ddca825

View File

@@ -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)) {