From d4f35b5e8f82c9ff2878351de240957842ecfbcb Mon Sep 17 00:00:00 2001 From: milimoe Date: Tue, 12 Nov 2024 21:29:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9B=B4=E5=A4=9A=20FunGame?= =?UTF-8?q?=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ListeningTask/GroupMessageTask.cs | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/ListeningTask/GroupMessageTask.cs b/src/ListeningTask/GroupMessageTask.cs index 6b1dc9d..68d03da 100644 --- a/src/ListeningTask/GroupMessageTask.cs +++ b/src/ListeningTask/GroupMessageTask.cs @@ -105,6 +105,17 @@ namespace Milimoe.RainBOT.ListeningTask return quick_reply; } + if (e.detail == "查询服务器启动时间") + { + if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply; + string msg = (await Bot.HttpGet("https://api.milimoe.com/test/getlastlogintime") ?? "").Trim(); + if (msg != "") + { + await Bot.SendGroupMessage(e.group_id, "查询服务器启动时间", msg); + } + return quick_reply; + } + if (e.detail.Length >= 9 && e.detail[..9].Equals("FunGame模拟", StringComparison.CurrentCultureIgnoreCase)) { if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply; @@ -293,6 +304,38 @@ namespace Milimoe.RainBOT.ListeningTask } return quick_reply; } + + if (e.detail.Length >= 6 && e.detail[..6] == "生成魔法卡包") + { + if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply; + string msg = (await Bot.HttpGet("https://api.milimoe.com/fungame/mfkb") ?? "").Trim(); + if (msg != "") + { + await Bot.SendGroupMessage(e.group_id, "生成魔法卡包", msg); + } + return quick_reply; + } + else if (e.detail.Length >= 5 && e.detail[..5] == "生成魔法卡") + { + if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply; + string msg = (await Bot.HttpGet("https://api.milimoe.com/fungame/mfk") ?? "").Trim(); + if (msg != "") + { + await Bot.SendGroupMessage(e.group_id, "生成魔法卡", msg); + } + return quick_reply; + } + + if (e.user_id == GeneralSettings.Master && e.detail.Length >= 9 && e.detail[..9].Equals("重载FunGame", StringComparison.CurrentCultureIgnoreCase)) + { + if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply; + string msg = (await Bot.HttpGet("https://api.milimoe.com/fungame/reload?master=" + GeneralSettings.Master) ?? "").Trim(); + if (msg != "") + { + await Bot.SendGroupMessage(e.group_id, "重载FunGame", msg); + } + return quick_reply; + } // 发图API if (e.detail == "来图")