修复问题 添加新指令

This commit is contained in:
milimoe 2024-04-11 23:04:23 +08:00
parent b37bac6209
commit 535eb18695
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
2 changed files with 23 additions and 4 deletions

View File

@ -144,7 +144,7 @@ namespace Milimoe.RainBOT.ListeningTask
return; return;
}); });
} }
if (e.detail.Contains("丁真") || e.detail == "一眼丁真" || e.detail == "一眼顶针") if (e.detail == "一眼丁真" || e.detail == "一眼顶针")
{ {
TaskUtility.NewTask(async () => TaskUtility.NewTask(async () =>
{ {
@ -155,9 +155,8 @@ namespace Milimoe.RainBOT.ListeningTask
return; return;
}); });
} }
if (EEWords.Any(e.detail.Contains)) if (EEWords.Any(e.detail.Contains) && e.CheckThrow(20, out _))
{ {
if (BlackList.Times.TryGetValue(e.user_id, out long bltimes) && bltimes > 5) return;
GroupMessageContent content = new(e.group_id); GroupMessageContent content = new(e.group_id);
content.message.Add(new ImageMessage("file:///" + AppDomain.CurrentDomain.BaseDirectory.ToString() + @"img\ee.png")); content.message.Add(new ImageMessage("file:///" + AppDomain.CurrentDomain.BaseDirectory.ToString() + @"img\ee.png"));
_ = Bot.SendGroupMessage(e.group_id, "Image", content); _ = Bot.SendGroupMessage(e.group_id, "Image", content);
@ -275,6 +274,26 @@ namespace Milimoe.RainBOT.ListeningTask
}); });
return; return;
} }
if (e.user_id == GeneralSettings.Master && e.detail.Length > 4 && e.detail[..2] == "重置" && (e.detail[^2..] == "运势"))
{
TaskUtility.NewTask(async () =>
{
if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return;
string[] strs = e.detail.Replace("重置", "").Replace("运势", "").Trim().Split(' ');
foreach (string str_qq in strs)
{
if (long.TryParse(str_qq.Trim().Replace("@", ""), out long qq))
{
if (qq == GeneralSettings.BotQQ && !Daily.UserDailys.ContainsKey(qq))
{
Daily.UserDailys.Remove(GeneralSettings.BotQQ);
await Bot.SendGroupMessage(e.group_id, "重置运势", "已重置" + Bot.GetMemberNickName(e.group_id, qq) + "" + qq + ")的今日运势。");
}
}
}
});
return;
}
// 下面是开启了OSM Core的群组才能使用的功能 // 下面是开启了OSM Core的群组才能使用的功能
if (!onOSMCore) return; if (!onOSMCore) return;

View File

@ -111,7 +111,7 @@ namespace Milimoe.RainBOT.Settings
await Task.Delay(1000 * GeneralSettings.BlackFrozenTime); await Task.Delay(1000 * GeneralSettings.BlackFrozenTime);
BlackList.Times.Remove(user_id); BlackList.Times.Remove(user_id);
}); });
await (send_group ? SendFriendMessage(target_id, "黑名单", content) : SendFriendMessage(target_id, "黑名单", content)); await (send_group ? SendGroupMessage(target_id, "黑名单", content) : SendFriendMessage(target_id, "黑名单", content));
return false; return false;
} }
else else