添加12点大挑战终止

This commit is contained in:
milimoe 2024-09-13 00:33:02 +08:00
parent 6fd8bd636f
commit b6b7ad9257
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
8 changed files with 2433 additions and 231 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -49,6 +49,12 @@ namespace Milimoe.RainBOT.ListeningTask
return quick_reply; return quick_reply;
} }
if (e.detail == "挑战结束" && e.user_id == GeneralSettings.Master)
{
await Bot.Unmute12ClockMembers();
return quick_reply;
}
if (GeneralSettings.IsMute && e.detail == "忏悔") if (GeneralSettings.IsMute && e.detail == "忏悔")
{ {
if (!await Bot.CheckBlackList(false, e.user_id, e.user_id)) return quick_reply; if (!await Bot.CheckBlackList(false, e.user_id, e.user_id)) return quick_reply;

View File

@ -108,6 +108,11 @@ namespace Milimoe.RainBOT.ListeningTask
await Bot.SendGroupMessage(e.group_id, "12点大挑战", "欢迎加入12点大挑战。参加本挑战后你将在每晚的12点获得8小时禁言和优质的睡眠确保第二天的精神饱满\r\n发送【加入12点】即可参加。"); await Bot.SendGroupMessage(e.group_id, "12点大挑战", "欢迎加入12点大挑战。参加本挑战后你将在每晚的12点获得8小时禁言和优质的睡眠确保第二天的精神饱满\r\n发送【加入12点】即可参加。");
return quick_reply; return quick_reply;
} }
else if (e.detail == "挑战结束" && e.user_id == GeneralSettings.Master)
{
await Bot.Unmute12ClockMembers();
return quick_reply;
}
// 发图API // 发图API
if (e.detail == "来图") if (e.detail == "来图")

View File

@ -354,5 +354,29 @@ namespace Milimoe.RainBOT.Settings
Console.WriteLine("已向12点大挑战的成员发放奖励。"); Console.WriteLine("已向12点大挑战的成员发放奖励。");
Console.ForegroundColor = ConsoleColor.Gray; Console.ForegroundColor = ConsoleColor.Gray;
} }
public static async Task Unmute12ClockMembers()
{
foreach (long group_id in GroupMembers.Keys)
{
List<IContent> list = [];
foreach (Member m in GroupMembers[group_id])
{
if (GeneralSettings.Challenge12ClockGroup.Contains(m.user_id))
{
MuteRecall.Muted.Remove(m.user_id);
SetGroupBanContent content = new(group_id, m.user_id, 0);
list.Add(content);
}
}
if (list.Count > 0)
{
await SendMessage(SupportedAPI.set_group_ban, group_id, "12点大挑战", list, true);
}
}
Console.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine("已解禁所有参与12点大挑战的成员。");
Console.ForegroundColor = ConsoleColor.Gray;
}
} }
} }

View File

@ -1,5 +1,4 @@
using System.Drawing; using Milimoe.OneBot.Framework.Utility;
using Milimoe.OneBot.Framework.Utility;
namespace Milimoe.RainBOT.Settings namespace Milimoe.RainBOT.Settings
{ {

View File

@ -3,8 +3,8 @@
public class OSMCore public class OSMCore
{ {
public const string version = "v1.0"; public const string version = "v1.0";
public const string version2 = "Patch9"; public const string version2 = "Patch10";
public const string time = "Aug. 12th 2024"; public const string time = "Sep. 12th 2024";
public static string Info => $"OSM Core {version} {version2}\r\nAuthor: Milimoe\r\nBuilt on {time}\r\nSee: https://github.com/milimoe"; public static string Info => $"OSM Core {version} {version2}\r\nAuthor: Milimoe\r\nBuilt on {time}\r\nSee: https://github.com/milimoe";
} }