From 9d9f8f7f98937af5e2f8751008d12691dd4c6668 Mon Sep 17 00:00:00 2001 From: Hokuto Chen Date: Wed, 29 Nov 2023 12:26:26 +0000 Subject: [PATCH] Notifications will be sent even if dms are off when using .give --- .../Currency/CurrencyServiceExtensions.cs | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/NadekoBot/Services/Currency/CurrencyServiceExtensions.cs b/src/NadekoBot/Services/Currency/CurrencyServiceExtensions.cs index 603eb479b..e5dcfa7ba 100644 --- a/src/NadekoBot/Services/Currency/CurrencyServiceExtensions.cs +++ b/src/NadekoBot/Services/Currency/CurrencyServiceExtensions.cs @@ -1,4 +1,4 @@ -using NadekoBot.Services.Currency; +using NadekoBot.Services.Currency; namespace NadekoBot.Services; @@ -27,13 +27,19 @@ public static class CurrencyServiceExtensions if (await fromWallet.Transfer(amount, toWallet, extra)) { - await to.SendConfirmAsync(ebs, - string.IsNullOrWhiteSpace(note) - ? $"Received {formattedAmount} from {from} " - : $"Received {formattedAmount} from {from}: {note}"); + try + { + await to.SendConfirmAsync(ebs, + string.IsNullOrWhiteSpace(note) + ? $"Received {formattedAmount} from {from} " + : $"Received {formattedAmount} from {from}: {note}"); + } + catch + { + //ignored + } return true; } - return false; } -} \ No newline at end of file +}