feat: 猜成语设置成模糊匹配
This commit is contained in:
@@ -27,12 +27,20 @@ namespace RoBot.Start.Cmd
|
|||||||
{
|
{
|
||||||
string emojiString = match.Groups[1].Value.Trim();
|
string emojiString = match.Groups[1].Value.Trim();
|
||||||
Dictionary<string, string> dict = AppConfigHelper.GetSection<Dictionary<string, string>>("猜成语");
|
Dictionary<string, string> dict = AppConfigHelper.GetSection<Dictionary<string, string>>("猜成语");
|
||||||
if (dict?.Count > 0 && dict.TryGetValue(emojiString, out string val))
|
if (dict?.Count > 0)
|
||||||
{
|
{
|
||||||
var systemConfig = GlobalConfig.ConfigSetting;
|
string val = "";
|
||||||
var bot = GlobalConfig.BotContext;
|
foreach (var item in dict)
|
||||||
var groupMessageChain = MessageBuilder.Group((uint)systemConfig.GroupQQ).Forward(chain).Text(val);
|
{
|
||||||
await bot.SendMessage(groupMessageChain.Build());
|
if (emojiString.Contains(item.Value))
|
||||||
|
{
|
||||||
|
var systemConfig = GlobalConfig.ConfigSetting;
|
||||||
|
var bot = GlobalConfig.BotContext;
|
||||||
|
var groupMessageChain = MessageBuilder.Group((uint)systemConfig.GroupQQ).Forward(chain).Text(val);
|
||||||
|
await bot.SendMessage(groupMessageChain.Build());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user