using Lagrange.Core.Message; using Lagrange.Core.Message.Entity; using RoBot.Start.LogConfig; using RoBot.Start.Service.Impl; namespace RoBot.Start.Cmd { /// /// 保存或更新物品价格 /// public class InertOrUpdateGoodsInfoCmd { public static async Task Execute(MessageChain chain) { try { foreach (var item in chain) { if (item is TextEntity) { TextEntity txe = item as TextEntity; if (string.IsNullOrWhiteSpace(txe.Text) is false) { if (txe.Text.Contains("不鼓励不保障")) { GoodsService.AnalysisGoodsText(txe.Text); } } } } } catch (Exception ex) { Logs.Write($@"{DateTime.Now:yyyy-MM-dd HH:mm:ss} 保存或更新物品价格 发生异常,异常信息:{ex.Message},异常堆栈:{ex.StackTrace}"); } return await Task.FromResult(true); } } }