* Start work on #2500

* Update Bot.cs

* Misc refactor

* Update Bot.cs

* Add fallback for older plugins

* Misc

* Apply feedback
This commit is contained in:
Łukasz Domeradzki
2022-01-23 00:14:14 +01:00
committed by GitHub
parent ab6e0a1e1b
commit 4258fed873
37 changed files with 697 additions and 662 deletions

View File

@@ -209,7 +209,7 @@ public sealed class ArchiLogger {
internal void LogInvite(SteamID steamID, bool? handled = null, [CallerMemberName] string? previousMethodName = null) {
if ((steamID == null) || (steamID.AccountType == EAccountType.Invalid)) {
throw new ArgumentNullException(nameof(steamID));
throw new ArgumentOutOfRangeException(nameof(steamID));
}
ulong steamID64 = steamID;

View File

@@ -240,12 +240,6 @@ internal static class Logging {
}
internal static void StartInteractiveConsole() {
if ((ASF.GlobalConfig == null) || (ASF.GlobalConfig.SteamOwnerID == 0)) {
ASF.ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.InteractiveConsoleNotAvailable, nameof(ASF.GlobalConfig.SteamOwnerID)));
return;
}
Utilities.InBackground(HandleConsoleInteractively, true);
ASF.ArchiLogger.LogGenericInfo(Strings.InteractiveConsoleEnabled);
}
@@ -368,10 +362,8 @@ internal static class Logging {
Console.WriteLine($@"<> {Strings.Executing}");
ulong steamOwnerID = ASF.GlobalConfig?.SteamOwnerID ?? GlobalConfig.DefaultSteamOwnerID;
// ReSharper disable once RedundantSuppressNullableWarningExpression - required for .NET Framework
string? response = await targetBot.Commands.Response(steamOwnerID, command!).ConfigureAwait(false);
string? response = await targetBot.Commands.Response(EAccess.Owner, command!).ConfigureAwait(false);
if (string.IsNullOrEmpty(response)) {
ASF.ArchiLogger.LogNullError(nameof(response));