Skip to content

Commit

Permalink
style 格式修正
Browse files Browse the repository at this point in the history
  • Loading branch information
chr233 committed Sep 28, 2023
1 parent 831316b commit 8582999
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ASFEnhance/ASFEnhance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public Task OnLoaded()
//Explorer
case "EXPLORER" when access >= EAccess.Master:
case "EX" when access >= EAccess.Master:
return Explorer.Command.ResponseExploreDiscoveryQueue(bot);
return Task.FromResult(Explorer.Command.ResponseExploreDiscoveryQueue(bot));

//Friend
case "DELETEALLFRIEND" when access >= EAccess.Master:
Expand Down
4 changes: 2 additions & 2 deletions ASFEnhance/Account/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ private static string NotificationTargetToString(NotificationTarget target)
/// <summary>
/// 获取账户封禁情况 (多个Bot)
/// </summary>
/// <param name="steamIds"></param>
/// <param name="query"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
internal static async Task<string?> ResponseSteamidAccountBanned(string query)
Expand Down Expand Up @@ -892,7 +892,7 @@ private static string NotificationTargetToString(NotificationTarget target)
/// <summary>
/// 获取账户封禁情况 (多个Bot)
/// </summary>
/// <param name="steamIds"></param>
/// <param name="botNames"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
internal static async Task<string?> ResponseReceiveGift(string botNames)
Expand Down
12 changes: 6 additions & 6 deletions ASFEnhance/Explorer/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@ internal static class Command
/// </summary>
/// <param name="bot"></param>
/// <returns></returns>
internal static Task<string?> ResponseExploreDiscoveryQueue(Bot bot)
internal static string? ResponseExploreDiscoveryQueue(Bot bot)
{
if (!bot.IsConnectedAndLoggedOn)
{
return Task.FromResult(bot.FormatBotResponse(Strings.BotNotConnected));
return bot.FormatBotResponse(Strings.BotNotConnected);
}

var steamSaleEvent = Type.GetType("ArchiSteamFarm.Steam.Integration.SteamSaleEvent,ArchiSteamFarm");

if (steamSaleEvent == null)
{
return Task.FromResult(bot.FormatBotResponse(Langs.SteamSaleEventIsNull));
return bot.FormatBotResponse(Langs.SteamSaleEventIsNull);
}

var steamSaleEventCls = bot.GetPrivateField("SteamSaleEvent", steamSaleEvent);

if (steamSaleEventCls == null)
{
return Task.FromResult(bot.FormatBotResponse(Langs.SteamSaleEventIsNull));
return bot.FormatBotResponse(Langs.SteamSaleEventIsNull);
}

var saleEventTimer = steamSaleEventCls.GetPrivateField<Timer>("SaleEventTimer");

saleEventTimer.Change(TimeSpan.FromSeconds(5), TimeSpan.FromHours(8.1));

return Task.FromResult(bot.FormatBotResponse(Langs.ExplorerStart));
return bot.FormatBotResponse(Langs.ExplorerStart);
}

/// <summary>
Expand Down Expand Up @@ -95,7 +95,7 @@ internal static class Command

var semaphore = new SemaphoreSlim(1);

IList<string?> results = await Utilities.InParallel(bots.Select(bot => ResponseExploreDiscoveryQueue(bot, semaphore))).ConfigureAwait(false);
var results = await Utilities.InParallel(bots.Select(bot => ResponseExploreDiscoveryQueue(bot, semaphore))).ConfigureAwait(false);

List<string> responses = new(results.Where(result => !string.IsNullOrEmpty(result))!);

Expand Down

0 comments on commit 8582999

Please sign in to comment.