feat: 查药材价格新增 -f命令, 上架命令以 | 分割 适配辅助
This commit is contained in:
@@ -25,6 +25,7 @@ namespace RoBot.Start.Cmd
|
|||||||
if (chain.Count is 3 or 5 && forwardEntities.Count > 0 && textEntities.Count > 0)
|
if (chain.Count is 3 or 5 && forwardEntities.Count > 0 && textEntities.Count > 0)
|
||||||
{
|
{
|
||||||
bool any = textEntities.Cast<TextEntity>().ToList().Where(o => o.Text.Contains("查上架") || o.Text.Contains("查价格")).Any();
|
bool any = textEntities.Cast<TextEntity>().ToList().Where(o => o.Text.Contains("查上架") || o.Text.Contains("查价格")).Any();
|
||||||
|
bool upCmd = textEntities.Cast<TextEntity>().ToList().Where(o => (o.Text.Contains("查上架") && o.Text.Contains("-f")) || (o.Text.Contains("查价格") && o.Text.Contains("-f"))).Any();
|
||||||
if (any)
|
if (any)
|
||||||
{
|
{
|
||||||
if (textEntities.Count == 0) return false;
|
if (textEntities.Count == 0) return false;
|
||||||
@@ -43,7 +44,7 @@ namespace RoBot.Start.Cmd
|
|||||||
(desc.Contains("名字") && desc.Contains("拥有数量"))
|
(desc.Contains("名字") && desc.Contains("拥有数量"))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_ = Herbal(chain, desc);
|
_ = Herbal(chain, desc, upCmd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,7 +62,7 @@ namespace RoBot.Start.Cmd
|
|||||||
/// 计算药材
|
/// 计算药材
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static async Task<bool> Herbal(MessageChain chain, string text)
|
private static async Task<bool> Herbal(MessageChain chain, string text, bool upCmd)
|
||||||
{
|
{
|
||||||
List<GoodsInfo> results = [];
|
List<GoodsInfo> results = [];
|
||||||
var lines = text.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
|
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);
|
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)
|
if (string.IsNullOrWhiteSpace(msg) is false)
|
||||||
{
|
{
|
||||||
msg += "\r\n";
|
if (!upCmd)
|
||||||
msg += "使用前请先@小小查看坊市药材,过完一遍以获取最新价格\r\n当前价格为坊市价格-10w\r\n";
|
{
|
||||||
msg += $"总价值约:{Utils.FormatNumberToChineseUnit(totalPrice)}\r\n";
|
msg += "\r\n";
|
||||||
msg += $"手续费约:{Utils.FormatNumberToChineseUnit(fee)}\r\n";
|
msg += "使用前请先@小小查看坊市药材,过完一遍以获取最新价格\r\n当前价格为坊市价格-10w\r\n";
|
||||||
msg += $"到账约:{Utils.FormatNumberToChineseUnit(totalPrice - fee)}";
|
msg += $"总价值约:{Utils.FormatNumberToChineseUnit(totalPrice)}\r\n";
|
||||||
|
msg += $"手续费约:{Utils.FormatNumberToChineseUnit(fee)}\r\n";
|
||||||
|
msg += $"到账约:{Utils.FormatNumberToChineseUnit(totalPrice - fee)}";
|
||||||
|
}
|
||||||
var systemConfig = GlobalConfig.ConfigSetting;
|
var systemConfig = GlobalConfig.ConfigSetting;
|
||||||
var bot = GlobalConfig.BotContext;
|
var bot = GlobalConfig.BotContext;
|
||||||
|
|
||||||
|
|||||||
@@ -114,6 +114,10 @@
|
|||||||
"1️⃣🕸️🈚️💰": "一往无前",
|
"1️⃣🕸️🈚️💰": "一往无前",
|
||||||
"📢🍜🔔🐉": "八面玲珑",
|
"📢🍜🔔🐉": "八面玲珑",
|
||||||
"🐍🐔🆘👨": "舍己救人",
|
"🐍🐔🆘👨": "舍己救人",
|
||||||
"👂👀": "耳目一新"
|
"👂👀": "耳目一新",
|
||||||
|
"🍊🐠⬇️🐦": "沉鱼落雁",
|
||||||
|
"🤍🐳🥩💃": "心惊肉跳",
|
||||||
|
"👚💉🚀☃️": "一针见血",
|
||||||
|
"💍🌸🧶🛕": "借花献佛"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user