Fix permission check in !level (#1957)

This commit is contained in:
Vitaliy
2020-09-08 10:48:01 +03:00
committed by GitHub
parent 8d67658b6e
commit afdf9ced94

View File

@@ -1368,14 +1368,14 @@ namespace ArchiSteamFarm {
throw new ArgumentNullException(nameof(steamID));
}
if (!Bot.IsConnectedAndLoggedOn) {
return FormatBotResponse(Strings.BotNotConnected);
}
if (!Bot.HasPermission(steamID, BotConfig.EPermission.Master)) {
return null;
}
if (!Bot.IsConnectedAndLoggedOn) {
return FormatBotResponse(Strings.BotNotConnected);
}
uint? level = await Bot.ArchiHandler.GetLevel().ConfigureAwait(false);
return FormatBotResponse(level.HasValue ? string.Format(Strings.BotLevel, level.Value) : Strings.WarningFailed);