Notifications will be sent even if dms are off when using .give

This commit is contained in:
Hokuto Chen
2023-11-29 12:26:26 +00:00
committed by Kwoth
parent 77358a563d
commit 9d9f8f7f98

View File

@@ -1,4 +1,4 @@
using NadekoBot.Services.Currency;
using NadekoBot.Services.Currency;
namespace NadekoBot.Services;
@@ -26,14 +26,20 @@ public static class CurrencyServiceExtensions
var extra = new TxData("gift", from.ToString()!, note, from.Id);
if (await fromWallet.Transfer(amount, toWallet, extra))
{
try
{
await to.SendConfirmAsync(ebs,
string.IsNullOrWhiteSpace(note)
? $"Received {formattedAmount} from {from} "
: $"Received {formattedAmount} from {from}: {note}");
}
catch
{
//ignored
}
return true;
}
return false;
}
}