Skip to content
This repository was archived by the owner on Aug 2, 2026. It is now read-only.

Commit c4dec36

Browse files
committed
v9.1.16 - Fix trade cancellation notification duplication and update version
1 parent 741312a commit c4dec36

17 files changed

Lines changed: 109 additions & 18 deletions

File tree

NUL

86.8 KB
Binary file not shown.

SysBot.Pokemon.Discord/Helpers/DiscordTradeNotifier.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ public void TradeCanceled(PokeRoutineExecutor<T> routine, PokeTradeDetail<T> inf
294294
StopPeriodicUpdates();
295295

296296
var cancelMessage = TotalBatchTrades > 1
297-
? $"Batch trade canceled: {msg}. All remaining trades have been canceled."
298-
: msg.ToString();
297+
? $"Batch trade canceled: {msg.ToUserString()}. All remaining trades have been canceled."
298+
: msg.ToUserString();
299299

300300
EmbedHelper.SendTradeCanceledEmbedAsync(Trader, cancelMessage).ConfigureAwait(false);
301301
}

SysBot.Pokemon.Kook/KookTradeNotifier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void TradeCanceled(PokeRoutineExecutor<T> routine, PokeTradeDetail<T> inf
7777
if (routine != null)
7878
OnFinish?.Invoke(routine);
7979

80-
Trader.SendTextAsync($"Trade canceled: {msg}").ConfigureAwait(false);
80+
Trader.SendTextAsync($"Trade canceled: {msg.ToUserString()}").ConfigureAwait(false);
8181
}
8282

8383
public void TradeFinished(PokeRoutineExecutor<T> routine, PokeTradeDetail<T> info, T result)

SysBot.Pokemon.Stoat/StoatTradeNotifier.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ public void TradeCanceled(PokeRoutineExecutor<T> routine, PokeTradeDetail<T> inf
301301
StopPeriodicUpdates();
302302

303303
var cancelMessage = TotalBatchTrades > 1
304-
? $"Batch trade canceled: {msg}. All remaining trades have been canceled."
305-
: msg.ToString();
304+
? $"Batch trade canceled: {msg.ToUserString()}. All remaining trades have been canceled."
305+
: msg.ToUserString();
306306

307307
EmbedHelper.SendTradeCanceledEmbedAsync(_client, UserId, cancelMessage).ConfigureAwait(false);
308308
}

SysBot.Pokemon.Twitch/Helpers/TwitchTradeNotifier.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void SendNotification(PokeRoutineExecutor<T> routine, PokeTradeDetail<T>
7070
public void TradeCanceled(PokeRoutineExecutor<T> routine, PokeTradeDetail<T> info, PokeTradeResult msg)
7171
{
7272
OnFinish?.Invoke(routine);
73-
var line = $"@{info.Trainer.TrainerName}: Trade canceled, {msg}";
73+
var line = $"@{info.Trainer.TrainerName}: Trade canceled, {msg.ToUserString()}";
7474
LogUtil.LogText(line);
7575
SendMessage(line, Settings.TradeCanceledDestination);
7676
}

SysBot.Pokemon.WinForms/SysBot.Pokemon.WinForms.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<Description>Nintendo Switch Pokémon Bot Manager</Description>
1919
<ApplicationIcon>icon.ico</ApplicationIcon>
2020
<StartupObject>SysBot.Pokemon.WinForms.Program</StartupObject>
21-
<Version>9.1.15</Version>
21+
<Version>9.1.16</Version>
2222
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
2323
</PropertyGroup>
2424
<PropertyGroup>

SysBot.Pokemon/BDSP/BotTrade/PokeTradeBotBS.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,9 @@ private async Task<bool> ExitUnionRoomToOverworld(CancellationToken token)
648648

649649
private void HandleAbortedTrade(PokeTradeDetail<PB8> detail, PokeRoutineType type, uint priority, PokeTradeResult result)
650650
{
651+
if (result == PokeTradeResult.NoTrainerFound)
652+
return;
653+
651654
detail.IsProcessing = false;
652655
if (result.ShouldAttemptRetry() && detail.Type != PokeTradeType.Random && !detail.IsRetry)
653656
{
@@ -1589,6 +1592,9 @@ void SendCollectedPokemonAndCleanup()
15891592

15901593
private async Task HandleAbortedBatchTrade(PokeTradeDetail<PB8> detail, PokeRoutineType type, uint priority, PokeTradeResult result, CancellationToken token)
15911594
{
1595+
if (result == PokeTradeResult.NoTrainerFound)
1596+
return;
1597+
15921598
detail.IsProcessing = false;
15931599

15941600
// Always remove from UsersInQueue on abort

SysBot.Pokemon/Helpers/NexusBot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace SysBot.Pokemon.Helpers
33
public static class NexusBot
44
{
55
public static string Name { get; set; } = "NexusBot";
6-
public static string Version => "9.1.15";
6+
public static string Version => "9.1.16";
77
public const string ConfigPath = "config.json";
88
}
99
}

SysBot.Pokemon/LA/BotTrade/PokeTradeBotLA.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ private async Task PerformTrade(SAV8LA sav, PokeTradeDetail<PA8> detail, PokeRou
264264

265265
private async Task HandleAbortedBatchTrade(PokeTradeDetail<PA8> detail, PokeRoutineType type, uint priority, PokeTradeResult result, CancellationToken token)
266266
{
267+
if (result == PokeTradeResult.NoTrainerFound)
268+
return;
269+
267270
detail.IsProcessing = false;
268271

269272
// Always remove from UsersInQueue on abort
@@ -297,6 +300,9 @@ private async Task HandleAbortedBatchTrade(PokeTradeDetail<PA8> detail, PokeRout
297300

298301
private void HandleAbortedTrade(PokeTradeDetail<PA8> detail, PokeRoutineType type, uint priority, PokeTradeResult result)
299302
{
303+
if (result == PokeTradeResult.NoTrainerFound)
304+
return;
305+
300306
detail.IsProcessing = false;
301307
if (result.ShouldAttemptRetry() && detail.Type != PokeTradeType.Random && !detail.IsRetry)
302308
{

SysBot.Pokemon/LGPE/BotTrade/PokeTradeBotLGPE.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ private async Task PerformTrade(SAV7b sav, PokeTradeDetail<PB7> detail, PokeRout
229229

230230
private void HandleAbortedTrade(PokeTradeDetail<PB7> detail, PokeRoutineType type, uint priority, PokeTradeResult result)
231231
{
232+
if (result == PokeTradeResult.NoTrainerFound)
233+
return;
234+
232235
detail.IsProcessing = false;
233236
if (result.ShouldAttemptRetry() && detail.Type != PokeTradeType.Random && !detail.IsRetry)
234237
{

0 commit comments

Comments
 (0)