From 1a48c305823eb247a95e37f3591323b856b32092 Mon Sep 17 00:00:00 2001 From: LyMysterious Date: Sat, 6 Sep 2025 13:23:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9F=A5=E8=8D=AF=E6=9D=90=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E6=96=B0=E5=A2=9E=20-f=E5=91=BD=E4=BB=A4,=20=E4=B8=8A?= =?UTF-8?q?=E6=9E=B6=E5=91=BD=E4=BB=A4=E4=BB=A5=20|=20=E5=88=86=E5=89=B2?= =?UTF-8?q?=20=E9=80=82=E9=85=8D=E8=BE=85=E5=8A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XiaoXiaoRoBot/Cmd/GoodsUpShopCmd.cs | 27 +++++++++++++++++++-------- XiaoXiaoRoBot/appsettings.json | 6 +++++- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/XiaoXiaoRoBot/Cmd/GoodsUpShopCmd.cs b/XiaoXiaoRoBot/Cmd/GoodsUpShopCmd.cs index ccd7334..f159a7c 100644 --- a/XiaoXiaoRoBot/Cmd/GoodsUpShopCmd.cs +++ b/XiaoXiaoRoBot/Cmd/GoodsUpShopCmd.cs @@ -25,6 +25,7 @@ namespace RoBot.Start.Cmd if (chain.Count is 3 or 5 && forwardEntities.Count > 0 && textEntities.Count > 0) { bool any = textEntities.Cast().ToList().Where(o => o.Text.Contains("查上架") || o.Text.Contains("查价格")).Any(); + bool upCmd = textEntities.Cast().ToList().Where(o => (o.Text.Contains("查上架") && o.Text.Contains("-f")) || (o.Text.Contains("查价格") && o.Text.Contains("-f"))).Any(); if (any) { if (textEntities.Count == 0) return false; @@ -43,7 +44,7 @@ namespace RoBot.Start.Cmd (desc.Contains("名字") && desc.Contains("拥有数量")) ) { - _ = Herbal(chain, desc); + _ = Herbal(chain, desc, upCmd); } } } @@ -61,7 +62,7 @@ namespace RoBot.Start.Cmd /// 计算药材 /// /// - private static async Task Herbal(MessageChain chain, string text) + private static async Task Herbal(MessageChain chain, string text, bool upCmd) { List results = []; var lines = text.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); @@ -104,16 +105,26 @@ namespace RoBot.Start.Cmd fee += Math.Round(Utils.CalculateFee(nicePrice) * num, 0); - msg += $"确认坊市上架{item.Name} {(int)current.Price - 100000} {num}\n"; + if (upCmd) + { + msg += $"确认坊市上架{item.Name} {(int)current.Price - 100000} {num}|"; + } + else + { + msg += $"确认坊市上架{item.Name} {(int)current.Price - 100000} {num}\n"; + } } } if (string.IsNullOrWhiteSpace(msg) is false) { - msg += "\r\n"; - msg += "使用前请先@小小查看坊市药材,过完一遍以获取最新价格\r\n当前价格为坊市价格-10w\r\n"; - msg += $"总价值约:{Utils.FormatNumberToChineseUnit(totalPrice)}\r\n"; - msg += $"手续费约:{Utils.FormatNumberToChineseUnit(fee)}\r\n"; - msg += $"到账约:{Utils.FormatNumberToChineseUnit(totalPrice - fee)}"; + if (!upCmd) + { + msg += "\r\n"; + msg += "使用前请先@小小查看坊市药材,过完一遍以获取最新价格\r\n当前价格为坊市价格-10w\r\n"; + msg += $"总价值约:{Utils.FormatNumberToChineseUnit(totalPrice)}\r\n"; + msg += $"手续费约:{Utils.FormatNumberToChineseUnit(fee)}\r\n"; + msg += $"到账约:{Utils.FormatNumberToChineseUnit(totalPrice - fee)}"; + } var systemConfig = GlobalConfig.ConfigSetting; var bot = GlobalConfig.BotContext; diff --git a/XiaoXiaoRoBot/appsettings.json b/XiaoXiaoRoBot/appsettings.json index ae159d8..4c7464c 100644 --- a/XiaoXiaoRoBot/appsettings.json +++ b/XiaoXiaoRoBot/appsettings.json @@ -114,6 +114,10 @@ "1️⃣🕸️🈚️💰": "一往无前", "📢🍜🔔🐉": "八面玲珑", "🐍🐔🆘👨": "舍己救人", - "👂👀": "耳目一新" + "👂👀": "耳目一新", + "🍊🐠⬇️🐦": "沉鱼落雁", + "🤍🐳🥩💃": "心惊肉跳", + "👚💉🚀☃️": "一针见血", + "💍🌸🧶🛕": "借花献佛" } } \ No newline at end of file