Skip to content

Commit 220a9ba

Browse files
committed
More bugfixes
1 parent a7f2dd9 commit 220a9ba

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

ArchiSteamFarm/ArchiSteamFarm.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@
120120
</ItemGroup>
121121
<ItemGroup>
122122
<None Include="App.config" />
123+
<None Include="config\example.json">
124+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
125+
</None>
126+
<None Include="config\minimal.json">
127+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
128+
</None>
123129
<None Include="packages.config" />
124130
</ItemGroup>
125131
<ItemGroup>
@@ -143,9 +149,7 @@
143149
<Name>SteamAuth</Name>
144150
</ProjectReference>
145151
</ItemGroup>
146-
<ItemGroup>
147-
<Folder Include="config\" />
148-
</ItemGroup>
152+
<ItemGroup />
149153
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
150154
<PropertyGroup>
151155
<PreBuildEvent>

ArchiSteamFarm/Bot.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,19 +428,14 @@ private async Task<string> ResponseSendTrade() {
428428
return "Trade couldn't be send because SteamMasterID is not defined!";
429429
}
430430

431-
string token = null;
432-
if (!string.IsNullOrEmpty(BotConfig.SteamTradeToken) && !BotConfig.SteamTradeToken.Equals("null")) {
433-
token = BotConfig.SteamTradeToken;
434-
}
435-
436431
await Trading.LimitInventoryRequestsAsync().ConfigureAwait(false);
437432
List<SteamItem> inventory = await ArchiWebHandler.GetMyTradableInventory().ConfigureAwait(false);
438433

439434
if (inventory == null || inventory.Count == 0) {
440435
return "Nothing to send, inventory seems empty!";
441436
}
442437

443-
if (await ArchiWebHandler.SendTradeOffer(inventory, BotConfig.SteamMasterID, token).ConfigureAwait(false)) {
438+
if (await ArchiWebHandler.SendTradeOffer(inventory, BotConfig.SteamMasterID, BotConfig.SteamTradeToken).ConfigureAwait(false)) {
444439
await AcceptAllConfirmations().ConfigureAwait(false);
445440
return "Trade offer sent successfully!";
446441
} else {

ArchiSteamFarm/BotConfig.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ internal sealed class BotConfig {
8080
[JsonProperty(Required = Required.DisallowNull)]
8181
internal bool SendOnFarmingFinished { get; private set; } = false;
8282

83-
[JsonProperty(Required = Required.DisallowNull)]
83+
[JsonProperty]
8484
internal string SteamTradeToken { get; private set; } = null;
8585

8686
[JsonProperty(Required = Required.DisallowNull)]
@@ -230,6 +230,10 @@ internal static BotConfig LoadOldFormat(string path) {
230230
botConfig.SteamParentalPIN = null;
231231
}
232232

233+
if (botConfig.SteamTradeToken != null && botConfig.SteamTradeToken.Equals("null")) {
234+
botConfig.SteamTradeToken = null;
235+
}
236+
233237
return botConfig;
234238
}
235239

ArchiSteamFarm/config/example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"UseAsfAsMobileAuthenticator": false,
1616
"ShutdownOnFarmingFinished": false,
1717
"SendOnFarmingFinished": false,
18-
"SteamTradeToken": "null",
18+
"SteamTradeToken": null,
1919
"SendTradePeriod": 0,
2020
"GamesPlayedWhileIdle": [
2121
0

0 commit comments

Comments
 (0)