Skip to content

Commit

Permalink
Merge branch 'main' into temp
Browse files Browse the repository at this point in the history
  • Loading branch information
ezhevita committed Feb 27, 2024
2 parents 743b136 + 1c119a4 commit ffef9ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ jobs:
id: github_release
uses: ncipollo/release-action@v1.13.0
with:
artifacts: "out/*"
artifacts: "out/*.zip"
makeLatest: true
release_name: ${{ github.event.repository.name }} V${{ github.ref_name }}
name: ${{ github.event.repository.name }} V${{ github.ref_name }}
1 change: 1 addition & 0 deletions GameRemover/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<PropertyGroup>
<Description>ASF plugin to remove games from account.</Description>
<NoWarn>$(NoWarn),CA1863</NoWarn>
<Version>2.3.0</Version>
</PropertyGroup>

Expand Down
15 changes: 5 additions & 10 deletions GameRemover/GameRemoverPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using AngleSharp.Dom;
using ArchiSteamFarm.Core;
Expand All @@ -23,10 +22,6 @@ namespace GameRemover;
[UsedImplicitly]
public class GameRemoverPlugin : IBotCommand2
{
private static readonly CompositeFormat ErrorIsInvalid = CompositeFormat.Parse(Strings.ErrorIsInvalid);
private static readonly CompositeFormat ErrorObjectIsNull = CompositeFormat.Parse(Strings.ErrorObjectIsNull);
private static readonly CompositeFormat BotNotFound = CompositeFormat.Parse(Strings.BotNotFound);

public Task OnLoaded()
{
ASF.ArchiLogger.LogGenericInfo($"{Name} by ezhevita | Support & source code: https://github.com/ezhevita/{Name}");
Expand Down Expand Up @@ -64,7 +59,7 @@ public Task OnLoaded()
{
if (!uint.TryParse(appIDText, out var appID) || (appID == 0) || !appIDs.Add(appID))
{
return bot.Commands.FormatBotResponse(string.Format(CultureInfo.CurrentCulture, ErrorIsInvalid, appIDText));
return bot.Commands.FormatBotResponse(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, appIDText));
}
}

Expand All @@ -75,18 +70,18 @@ public Task OnLoaded()
using var responseDeleteGamePage = (await bot.ArchiWebHandler.UrlGetToHtmlDocumentWithSession(uriDeleteGamePage).ConfigureAwait(false))?.Content;
if (responseDeleteGamePage == null)
{
return bot.Commands.FormatBotResponse(string.Format(CultureInfo.CurrentCulture, ErrorObjectIsNull, nameof(responseDeleteGamePage)));
return bot.Commands.FormatBotResponse(string.Format(CultureInfo.CurrentCulture, Strings.ErrorObjectIsNull, nameof(responseDeleteGamePage)));
}

var node = responseDeleteGamePage.SelectSingleNode<IElement>("//input[@id='packageid']");
if (node == null)
{
return bot.Commands.FormatBotResponse(string.Format(CultureInfo.CurrentCulture, ErrorObjectIsNull, nameof(node)));
return bot.Commands.FormatBotResponse(string.Format(CultureInfo.CurrentCulture, Strings.ErrorObjectIsNull, nameof(node)));
}

if (!uint.TryParse(node.GetAttribute("value"), out var packageID) || (packageID == 0))
{
return bot.Commands.FormatBotResponse(string.Format(CultureInfo.CurrentCulture, ErrorIsInvalid, nameof(packageID)));
return bot.Commands.FormatBotResponse(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(packageID)));
}

Dictionary<string, string> data = new(3)
Expand All @@ -110,7 +105,7 @@ public Task OnLoaded()
var bots = Bot.GetBots(botNames);
if ((bots == null) || (bots.Count == 0))
{
return access >= EAccess.Owner ? Commands.FormatStaticResponse(string.Format(CultureInfo.CurrentCulture, BotNotFound, botNames)) : null;
return access >= EAccess.Owner ? Commands.FormatStaticResponse(string.Format(CultureInfo.CurrentCulture, Strings.BotNotFound, botNames)) : null;
}

var results = await Utilities.InParallel(bots.Select(bot => ResponseDeleteGame(bot, Commands.GetProxyAccess(bot, access, steamID), appIDsText))).ConfigureAwait(false);
Expand Down

0 comments on commit ffef9ef

Please sign in to comment.