|
|
|
|
@ -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<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 (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
|
|
|
|
|
/// 计算药材
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <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 = [];
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|