From 91ee0d121c5abeb71f86130bb3cd47bb43ed5e91 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sat, 7 May 2022 09:32:22 +0200 Subject: [PATCH] DM send by the bot when being the target of a .give command will now once again contain amount. --- CHANGELOG.md | 4 ++++ src/NadekoBot/Modules/Gambling/Gambling.cs | 2 +- .../Services/Currency/CurrencyServiceExtensions.cs | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 111a384a1..3554cfdb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog. - `.clubdesc ` will now have a nicer response +### Fixed + +- `.give` DM will once again show an amount + ## [4.1.4] - 06-05-2022 ### Fixed diff --git a/src/NadekoBot/Modules/Gambling/Gambling.cs b/src/NadekoBot/Modules/Gambling/Gambling.cs index 30fe72937..8e6734a81 100644 --- a/src/NadekoBot/Modules/Gambling/Gambling.cs +++ b/src/NadekoBot/Modules/Gambling/Gambling.cs @@ -363,7 +363,7 @@ public partial class Gambling : GamblingModule return; } - if (!await _cs.TransferAsync(_eb, ctx.User, receiver, amount, msg)) + if (!await _cs.TransferAsync(_eb, ctx.User, receiver, amount, msg, N(amount))) { await ReplyErrorLocalizedAsync(strs.not_enough(CurrencySign)); return; diff --git a/src/NadekoBot/Services/Currency/CurrencyServiceExtensions.cs b/src/NadekoBot/Services/Currency/CurrencyServiceExtensions.cs index e9009c613..48954bd07 100644 --- a/src/NadekoBot/Services/Currency/CurrencyServiceExtensions.cs +++ b/src/NadekoBot/Services/Currency/CurrencyServiceExtensions.cs @@ -17,7 +17,8 @@ public static class CurrencyServiceExtensions IUser from, IUser to, long amount, - string? note) + string? note, + string formattedAmount) { var fromWallet = await cs.GetWalletAsync(from.Id); var toWallet = await cs.GetWalletAsync(to.Id); @@ -28,8 +29,8 @@ public static class CurrencyServiceExtensions { await to.SendConfirmAsync(ebs, string.IsNullOrWhiteSpace(note) - ? $"Gift from {from}" - : $"Gift from {from}: {note}"); + ? $"Received {formattedAmount} from {from} " + : $"Received {formattedAmount} from {from}: {note}"); return true; }