qqbot #1

Merged
milimoe merged 8 commits from qqbot into master 2025-08-02 10:45:22 +00:00
9 changed files with 380 additions and 131 deletions
Showing only changes of commit 045f7fc366 - Show all commits

View File

@ -251,7 +251,7 @@ namespace Milimoe.RainBOT.Command
{ {
if (user_id == GeneralSettings.Master) if (user_id == GeneralSettings.Master)
{ {
SendMessage(send_group, target_id, OshimaController.Instance.HTTPClient?.Connected ?? false ? $"已连接上服务器{OshimaController.Instance.HTTPClient.ServerAddress}" : "连接已断开。"); SendMessage(send_group, target_id, OshimaController.Instance.HTTPClient?.Connected ?? false ? $"已连接上服务器" : "连接已断开。");
} }
else Access_Denied(send_group, target_id); else Access_Denied(send_group, target_id);
} }
@ -300,7 +300,7 @@ namespace Milimoe.RainBOT.Command
await OshimaController.Instance.ConnectToAnonymousServer(); await OshimaController.Instance.ConnectToAnonymousServer();
} }
catch { } catch { }
msg += OshimaController.Instance.HTTPClient?.Connected ?? false ? $"已连接上服务器{OshimaController.Instance.HTTPClient.ServerAddress}" : "重试连接失败。"; msg += OshimaController.Instance.HTTPClient?.Connected ?? false ? $"已连接上服务器" : "重试连接失败。";
SendMessage(send_group, target_id, msg); SendMessage(send_group, target_id, msg);
}); });
} }

View File

@ -42,6 +42,20 @@ namespace Milimoe.RainBOT.ListeningTask
} }
} }
if (e.detail.StartsWith("绑定"))
{
string detail = e.detail.Replace("绑定", "");
string msg = QQOpenID.Bind(detail, e.user_id);
await Bot.SendFriendMessage(e.user_id, "绑定", msg);
}
if (e.detail.StartsWith("解绑"))
{
string detail = e.detail.Replace("解绑", "");
string msg = QQOpenID.Unbind(detail, e.user_id);
await Bot.SendFriendMessage(e.user_id, "解绑", msg);
}
// OSM指令 // OSM指令
if (e.detail.Length >= 4 && e.detail[..4] == ".osm") if (e.detail.Length >= 4 && e.detail[..4] == ".osm")
{ {
@ -55,7 +69,7 @@ namespace Milimoe.RainBOT.ListeningTask
if (!RainBOTFunGame.FunGameSimulation) if (!RainBOTFunGame.FunGameSimulation)
{ {
RainBOTFunGame.FunGameSimulation = true; RainBOTFunGame.FunGameSimulation = true;
List<string> msgs = await Bot.HttpGet<List<string>>("https://api.milimoe.com/fungame/test?isweb=false") ?? []; List<string> msgs = await Bot.HttpGet<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/test?isweb=false") ?? [];
foreach (string msg in msgs) foreach (string msg in msgs)
{ {
await Bot.SendFriendMessage(e.user_id, "FunGame模拟", msg.Trim()); await Bot.SendFriendMessage(e.user_id, "FunGame模拟", msg.Trim());

View File

@ -118,7 +118,7 @@ namespace Milimoe.RainBOT.ListeningTask
if (e.detail == "查询服务器启动时间") if (e.detail == "查询服务器启动时间")
{ {
if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply; if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply;
string msg = (await Bot.HttpGet<string>("https://api.milimoe.com/test/getlastlogintime") ?? "").Trim(); string msg = (await Bot.HttpGet<string>($"https://{GeneralSettings.FunGameServer}/test/getlastlogintime") ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "查询服务器启动时间", msg); await Bot.SendGroupMessage(e.group_id, "查询服务器启动时间", msg);
@ -130,7 +130,7 @@ namespace Milimoe.RainBOT.ListeningTask
{ {
if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply; if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply;
string detail = e.detail.Replace("查询任务计划", "").Trim(); string detail = e.detail.Replace("查询任务计划", "").Trim();
string msg = await Bot.HttpGet<string>($"https://api.milimoe.com/test/gettask?name={detail}") ?? ""; string msg = await Bot.HttpGet<string>($"https://{GeneralSettings.FunGameServer}/test/gettask?name={detail}") ?? "";
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "查询任务计划", msg); await Bot.SendGroupMessage(e.group_id, "查询任务计划", msg);
@ -143,13 +143,10 @@ namespace Milimoe.RainBOT.ListeningTask
return quick_reply; return quick_reply;
} }
if (await RainBOTFunGame.Handler(e)) _ = Task.Run(async () =>
{ {
return quick_reply; await RainBOTFunGame.Handler2(e);
} });
if (GeneralSettings.FunGameGroup.Contains(e.group_id))
{
}
// 发图API // 发图API
if (e.detail == "来图") if (e.detail == "来图")
@ -256,7 +253,7 @@ namespace Milimoe.RainBOT.ListeningTask
{ {
if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply; if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply;
UserDaily daily = await Bot.HttpPost<UserDaily>("https://api.milimoe.com/userdaily/get/" + e.user_id, "") ?? new(0, 0, ""); UserDaily daily = await Bot.HttpPost<UserDaily>($"https://{GeneralSettings.FunGameServer}/userdaily/get/" + e.user_id, "") ?? new(0, 0, "");
if (daily.daily != "") if (daily.daily != "")
{ {
if (daily.type == 0) if (daily.type == 0)
@ -297,7 +294,7 @@ namespace Milimoe.RainBOT.ListeningTask
{ {
if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply; if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return quick_reply;
string msg = await Bot.HttpPost<string>("https://api.milimoe.com/userdaily/remove/" + e.user_id, "") ?? ""; string msg = await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/userdaily/remove/" + e.user_id, "") ?? "";
if (msg != "") if (msg != "")
{ {
GroupMessageContent content = new(e.group_id); GroupMessageContent content = new(e.group_id);
@ -318,9 +315,9 @@ namespace Milimoe.RainBOT.ListeningTask
{ {
if (qq == GeneralSettings.BotQQ) if (qq == GeneralSettings.BotQQ)
{ {
await Bot.HttpPost<UserDaily>("https://api.milimoe.com/userdaily/get/" + qq, ""); await Bot.HttpPost<UserDaily>($"https://{GeneralSettings.FunGameServer}/userdaily/get/" + qq, "");
} }
UserDaily daily = await Bot.HttpGet<UserDaily>("https://api.milimoe.com/userdaily/view/" + qq) ?? new(0, 0, ""); UserDaily daily = await Bot.HttpGet<UserDaily>($"https://{GeneralSettings.FunGameServer}/userdaily/view/" + qq) ?? new(0, 0, "");
if (daily.daily != "") if (daily.daily != "")
{ {
GroupMessageContent content = new(e.group_id); GroupMessageContent content = new(e.group_id);
@ -340,7 +337,7 @@ namespace Milimoe.RainBOT.ListeningTask
{ {
if (long.TryParse(str_qq.Trim().Replace("@", ""), out long qq)) if (long.TryParse(str_qq.Trim().Replace("@", ""), out long qq))
{ {
string msg = await Bot.HttpPost<string>("https://api.milimoe.com/userdaily/remove/" + e.user_id, "") ?? ""; string msg = await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/userdaily/remove/" + e.user_id, "") ?? "";
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "重置运势", "已重置" + Bot.GetMemberNickName(e.group_id, qq) + "" + qq + ")的今日运势。"); await Bot.SendGroupMessage(e.group_id, "重置运势", "已重置" + Bot.GetMemberNickName(e.group_id, qq) + "" + qq + ")的今日运势。");
@ -631,7 +628,7 @@ namespace Milimoe.RainBOT.ListeningTask
{ {
GroupMessageContent content = new(e.group_id); GroupMessageContent content = new(e.group_id);
content.message.Add(new AtMessage(e.user_id)); content.message.Add(new AtMessage(e.user_id));
int sc = 1; int sc = 0;
switch (Random.Shared.Next(4)) switch (Random.Shared.Next(4))
{ {
case 0: case 0:
@ -642,12 +639,12 @@ namespace Milimoe.RainBOT.ListeningTask
break; break;
case 2: case 2:
content.message.Add(new TextMessage(string.Concat(name.AsSpan(pos, name.Length > 0 ? 1 : name.Length), "圣"))); content.message.Add(new TextMessage(string.Concat(name.AsSpan(pos, name.Length > 0 ? 1 : name.Length), "圣")));
sc = 3; sc = Random.Shared.Next(1, 4);
break; break;
case 3: case 3:
default: default:
content.message.Add(new TextMessage(string.Concat(name.AsSpan(pos, name.Length > 0 ? 1 : name.Length), "出"))); content.message.Add(new TextMessage(string.Concat(name.AsSpan(pos, name.Length > 0 ? 1 : name.Length), "出")));
sc = -1; sc = -Random.Shared.Next(1, 4);
break; break;
} }
await Bot.SendGroupMessage(e.group_id, "随机叫哥", content, delay * 1000); await Bot.SendGroupMessage(e.group_id, "随机叫哥", content, delay * 1000);

View File

@ -18,6 +18,16 @@ try
Console.ForegroundColor = ConsoleColor.Gray; Console.ForegroundColor = ConsoleColor.Gray;
} }
if (args.Contains("--test"))
{
GeneralSettings.IsDebug = true;
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("Test模式");
Console.ForegroundColor = ConsoleColor.Gray;
Testing testing = new();
return;
}
if (args.Any(a => a.StartsWith("-g"))) if (args.Any(a => a.StartsWith("-g")))
{ {
string debug_group = args.Where(a => a.StartsWith("-g")).FirstOrDefault() ?? ""; string debug_group = args.Where(a => a.StartsWith("-g")).FirstOrDefault() ?? "";
@ -109,6 +119,7 @@ try
Daily.InitDaily(); Daily.InitDaily();
SayNo.InitSayNo(); SayNo.InitSayNo();
Ignore.InitIgnore(); Ignore.InitIgnore();
QQOpenID.LoadConfig();
Console.ForegroundColor = ConsoleColor.Green; Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("初始化完毕!"); Console.WriteLine("初始化完毕!");
@ -181,9 +192,12 @@ try
catch { } catch { }
} }
} }
Console.ForegroundColor = ConsoleColor.Magenta; if (GeneralSettings.IsDebug)
Console.WriteLine("清空所有已下载的图片,释放空间。"); {
Console.ForegroundColor = ConsoleColor.Gray; Console.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine("清空所有已下载的图片,释放空间。");
Console.ForegroundColor = ConsoleColor.Gray;
}
} }
catch (Exception e) catch (Exception e)
{ {
@ -199,6 +213,7 @@ try
{ {
await OshimaController.Instance.Start(); await OshimaController.Instance.Start();
await OshimaController.Instance.ConnectToAnonymousServer(); await OshimaController.Instance.ConnectToAnonymousServer();
OshimaController.Config.FunGame_isAutoRetry = true;
}); });
bool isListening = true; bool isListening = true;

View File

@ -2,7 +2,7 @@
"profiles": { "profiles": {
"RainBOT": { "RainBOT": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "--debug -g766616821" "commandLineArgs": "--debug --test -g766616821"
} }
} }
} }

View File

@ -67,13 +67,23 @@ namespace Milimoe.RainBOT.Settings
{ {
try try
{ {
result = await ConnectAsync(TransmittalType.WebSocket, GeneralSettings.FunGameServer, ssl: true, subUrl: "ws"); string[] strings = GeneralSettings.FunGameServer.Split(':');
int port = strings.Length > 1 ? int.Parse(strings[1]) : 443;
result = await ConnectAsync(TransmittalType.WebSocket, strings[0], port, true, "ws");
Config.FunGame_isRetrying = false; Config.FunGame_isRetrying = false;
await Task.Delay(5000); if (result != ConnectResult.Success)
{
await Task.Delay(5000);
}
else
{
break;
}
} }
catch (Exception e) catch (Exception e)
{ {
Error(e); Error(e);
break;
} }
} }
} }
@ -84,7 +94,9 @@ namespace Milimoe.RainBOT.Settings
{ {
try try
{ {
if (await ConnectAsync(TransmittalType.WebSocket, GeneralSettings.FunGameServer, ssl: true, subUrl: "ws") == ConnectResult.Success) string[] strings = GeneralSettings.FunGameServer.Split(':');
int port = strings.Length > 1 ? int.Parse(strings[1]) : 443;
if (await ConnectAsync(TransmittalType.WebSocket, strings[0], port, true, "ws") == ConnectResult.Success)
{ {
Console.WriteLine("重连成功!"); Console.WriteLine("重连成功!");
if (send) if (send)
@ -168,10 +180,15 @@ namespace Milimoe.RainBOT.Settings
if (data.Count > 0) if (data.Count > 0)
{ {
long qq = NetworkUtility.JsonDeserializeFromDictionary<long>(data, "qq"); long qq = NetworkUtility.JsonDeserializeFromDictionary<long>(data, "qq");
string openid = NetworkUtility.JsonDeserializeFromDictionary<string>(data, "openid") ?? "";
long groupid = NetworkUtility.JsonDeserializeFromDictionary<long>(data, "groupid"); long groupid = NetworkUtility.JsonDeserializeFromDictionary<long>(data, "groupid");
string msg = NetworkUtility.JsonDeserializeFromDictionary<string>(data, "msg") ?? ""; string msg = NetworkUtility.JsonDeserializeFromDictionary<string>(data, "msg") ?? "";
if (msg != "") if (msg != "")
{ {
if (qq == 0 && openid != "" && QQOpenID.QQAndOpenID.TryGetValue(openid, out long tempqq))
{
qq = tempqq;
}
if (qq > 0 && groupid > 0) if (qq > 0 && groupid > 0)
{ {
await Bot.SendGroupMessageAt(qq, groupid, "匿名服务器消息", msg); await Bot.SendGroupMessageAt(qq, groupid, "匿名服务器消息", msg);
@ -199,10 +216,14 @@ namespace Milimoe.RainBOT.Settings
} }
} }
public async Task SCAdd(long qq, long groupid, double sc = 1) public async Task SCAdd(long qq, long groupid, double sc = 0)
{ {
if (HTTPClient != null) if (HTTPClient != null)
{ {
if (sc == 0)
{
sc = Random.Shared.Next(-3, 4);
}
Dictionary<string, object> data = []; Dictionary<string, object> data = [];
data.Add("command", "scadd"); data.Add("command", "scadd");
data.Add("qq", qq); data.Add("qq", qq);

92
src/Settings/QQOpenID.cs Normal file
View File

@ -0,0 +1,92 @@
using System.Text.Json.Serialization;
using Milimoe.FunGame.Core.Api.Utility;
namespace Milimoe.RainBOT.Settings
{
public class QQOpenID
{
public static Dictionary<string, long> QQAndOpenID { get; set; } = [];
public static PluginConfig Configs { get; set; } = new("rainbot", "qqopenid");
public static void LoadConfig()
{
Configs.LoadConfig();
foreach (string str in Configs.Keys)
{
if (Configs.TryGetValue(str, out object? value) && value is long qq && qq != 0)
{
QQAndOpenID.TryAdd(str, qq);
}
}
}
public static void SaveConfig()
{
lock (Configs)
{
Configs.Clear();
foreach (string openid in QQAndOpenID.Keys)
{
Configs.Add(openid, QQAndOpenID[openid]);
}
Configs.SaveConfig();
}
}
public static string Bind(string openid, long qq)
{
if (openid.Trim() == "" || qq <= 0)
{
return "请输入正确的OpenID和QQ";
}
if (QQAndOpenID.Any(kv => kv.Value == qq || kv.Key != openid))
{
return $"此接入码已被其他人绑定或者你的QQ已经绑定了其他的接入码。如果你是此接入码的主人请联系客服处理。";
}
if (QQAndOpenID.TryAdd(openid, qq))
{
SaveConfig();
}
else
{
return $"绑定失败,请稍后再试!如持续绑定失败请联系客服处理。";
}
return "绑定成功!如果需要解除绑定,请发送【解绑+接入码】!";
}
public static string Unbind(string openid, long qq)
{
if (QQOpenID.QQAndOpenID.TryGetValue(openid, out long bindqq) && bindqq == qq && QQOpenID.QQAndOpenID.Remove(openid))
{
return NetworkUtility.JsonSerialize($"解绑成功!");
}
return NetworkUtility.JsonSerialize("解绑失败!没有查到绑定的信息或者此账号已被其他人绑定,如果你是此接入码的主人,请联系客服处理。");
}
}
public class ThirdPartyMessage
{
[JsonPropertyName("id")]
public string Id { get; set; } = "";
[JsonPropertyName("isgroup")]
public bool IsGroup { get; set; } = false;
[JsonPropertyName("detail")]
public string Detail { get; set; } = "";
[JsonPropertyName("timestamp")]
public string Timestamp { get; set; } = "";
[JsonPropertyName("openid")]
public string OpenId { get; set; } = "";
[JsonPropertyName("authoropenid")]
public string AuthorOpenId { get; set; } = "";
}
}

View File

@ -8,6 +8,26 @@ namespace Milimoe.RainBOT.Settings
public static bool FunGameSimulation { get; set; } = false; public static bool FunGameSimulation { get; set; } = false;
private readonly static List<string> FunGameItemType = ["卡包", "武器", "防具", "鞋子", "饰品", "消耗品", "魔法卡", "收藏品", "特殊物品", "任务物品", "礼包", "其他"]; private readonly static List<string> FunGameItemType = ["卡包", "武器", "防具", "鞋子", "饰品", "消耗品", "魔法卡", "收藏品", "特殊物品", "任务物品", "礼包", "其他"];
public static async Task Handler2(GroupMessageEvent e)
{
if (QQOpenID.QQAndOpenID.Where(kv => kv.Value == e.user_id).Select(kv => kv.Key).FirstOrDefault() is string openid)
{
string msg = await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/qqbot/thirdparty", System.Text.Json.JsonSerializer.Serialize(new ThirdPartyMessage()
{
Id = "",
AuthorOpenId = openid,
OpenId = openid,
Detail = e.detail,
IsGroup = true,
Timestamp = ""
}), true) ?? "";
if (msg.Trim() != "")
{
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "FunGame", msg.Trim());
}
}
}
public static async Task<bool> Handler(GroupMessageEvent e) public static async Task<bool> Handler(GroupMessageEvent e)
{ {
bool result = true; bool result = true;
@ -257,7 +277,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("查技能", "").Trim(); string detail = e.detail.Replace("查技能", "").Trim();
if (int.TryParse(detail, out int id)) if (int.TryParse(detail, out int id))
{ {
string msg = (await Bot.HttpGet<string>($"https://{GeneralSettings.FunGameServer}/fungame/skillinfo?qq={e.user_id}&id=" + id, fungame: true) ?? "").Trim(); string msg = (await Bot.HttpGet<string>($"https://{GeneralSettings.FunGameServer}/fungame/skillinfo?uid={e.user_id}&id=" + id, fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "查询FunGame角色技能", msg); await Bot.SendGroupMessage(e.group_id, "查询FunGame角色技能", msg);
@ -265,7 +285,7 @@ namespace Milimoe.RainBOT.Settings
} }
else else
{ {
string msg = (await Bot.HttpGet<string>($"https://{GeneralSettings.FunGameServer}/fungame/skillinfoname?qq={e.user_id}&name=" + Uri.EscapeDataString(detail.Trim()), fungame: true) ?? "").Trim(); string msg = (await Bot.HttpGet<string>($"https://{GeneralSettings.FunGameServer}/fungame/skillinfoname?uid={e.user_id}&name=" + Uri.EscapeDataString(detail.Trim()), fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "查询FunGame角色技能", msg); await Bot.SendGroupMessage(e.group_id, "查询FunGame角色技能", msg);
@ -280,7 +300,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("查物品", "").Trim(); string detail = e.detail.Replace("查物品", "").Trim();
if (int.TryParse(detail, out int id)) if (int.TryParse(detail, out int id))
{ {
string msg = (await Bot.HttpGet<string>($"https://{GeneralSettings.FunGameServer}/fungame/iteminfo?qq={e.user_id}&id=" + id, fungame: true) ?? "").Trim(); string msg = (await Bot.HttpGet<string>($"https://{GeneralSettings.FunGameServer}/fungame/iteminfo?uid={e.user_id}&id=" + id, fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "查询FunGame物品信息", msg); await Bot.SendGroupMessage(e.group_id, "查询FunGame物品信息", msg);
@ -288,7 +308,7 @@ namespace Milimoe.RainBOT.Settings
} }
else else
{ {
string msg = (await Bot.HttpGet<string>($"https://{GeneralSettings.FunGameServer}/fungame/iteminfoname?qq={e.user_id}&name=" + Uri.EscapeDataString(detail.Trim()), fungame: true) ?? "").Trim(); string msg = (await Bot.HttpGet<string>($"https://{GeneralSettings.FunGameServer}/fungame/iteminfoname?uid={e.user_id}&name=" + Uri.EscapeDataString(detail.Trim()), fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "查询FunGame物品信息", msg); await Bot.SendGroupMessage(e.group_id, "查询FunGame物品信息", msg);
@ -317,7 +337,7 @@ namespace Milimoe.RainBOT.Settings
if (count > 0) if (count > 0)
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/createitem?qq={e.user_id}&name={Uri.EscapeDataString(name)}&count={count}&target={userid}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/createitem?uid={e.user_id}&name={Uri.EscapeDataString(name)}&count={count}&target={userid}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "熟圣之力", msg); await Bot.SendGroupMessage(e.group_id, "熟圣之力", msg);
@ -354,7 +374,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "创建存档") if (e.detail == "创建存档")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/createsaved?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/createsaved?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "创建存档", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "创建存档", "\r\n" + msg);
@ -364,7 +384,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "我的存档") if (e.detail == "我的存档")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showsaved?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showsaved?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "我的存档", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "我的存档", "\r\n" + msg);
@ -374,7 +394,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "我的主战") if (e.detail == "我的主战")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterinfo?qq={e.user_id}&seq=0", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterinfo?uid={e.user_id}&seq=0", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "我的主战", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "我的主战", "\r\n" + msg);
@ -384,7 +404,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "我的状态") if (e.detail == "我的状态")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showmaincharacterorsquadstatus?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showmaincharacterorsquadstatus?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "我的状态", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "我的状态", "\r\n" + msg);
@ -394,7 +414,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "小队状态" || e.detail == "我的小队状态") if (e.detail == "小队状态" || e.detail == "我的小队状态")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showmaincharacterorsquadstatus?qq={e.user_id}&squad=true", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showmaincharacterorsquadstatus?uid={e.user_id}&squad=true", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "我的小队状态", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "我的小队状态", "\r\n" + msg);
@ -404,7 +424,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "我的小队") if (e.detail == "我的小队")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showsquad?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showsquad?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "我的小队", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "我的小队", "\r\n" + msg);
@ -414,7 +434,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "清空小队") if (e.detail == "清空小队")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/clearsquad?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/clearsquad?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "清空小队", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "清空小队", "\r\n" + msg);
@ -424,7 +444,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "还原存档") if (e.detail == "还原存档")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/restoresaved?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/restoresaved?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "还原存档", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "还原存档", "\r\n" + msg);
@ -434,7 +454,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "生成自建角色") if (e.detail == "生成自建角色")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/newcustomcharacter?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/newcustomcharacter?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "抽卡", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "抽卡", "\r\n" + msg);
@ -444,7 +464,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "角色改名") if (e.detail == "角色改名")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/rename?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/rename?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "改名", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "改名", "\r\n" + msg);
@ -454,7 +474,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "角色重随") if (e.detail == "角色重随")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/randomcustom?qq={e.user_id}&confirm=false", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/randomcustom?uid={e.user_id}&confirm=false", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "角色重随", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "角色重随", "\r\n" + msg);
@ -464,7 +484,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "确认角色重随") if (e.detail == "确认角色重随")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/randomcustom?qq={e.user_id}&confirm=true", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/randomcustom?uid={e.user_id}&confirm=true", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "角色重随", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "角色重随", "\r\n" + msg);
@ -474,7 +494,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "取消角色重随") if (e.detail == "取消角色重随")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/cancelrandomcustom?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/cancelrandomcustom?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "角色重随", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "角色重随", "\r\n" + msg);
@ -484,7 +504,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "抽卡") if (e.detail == "抽卡")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/drawcard?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/drawcard?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "抽卡", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "抽卡", "\r\n" + msg);
@ -494,7 +514,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "十连抽卡") if (e.detail == "十连抽卡")
{ {
List<string> msgs = (await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/drawcards?qq={e.user_id}", "", fungame: true) ?? []); List<string> msgs = (await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/drawcards?uid={e.user_id}", "", fungame: true) ?? []);
if (msgs.Count > 0) if (msgs.Count > 0)
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "十连抽卡", "\r\n" + string.Join("\r\n", msgs)); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "十连抽卡", "\r\n" + string.Join("\r\n", msgs));
@ -504,7 +524,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "材料抽卡") if (e.detail == "材料抽卡")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/drawcardm?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/drawcardm?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "材料抽卡", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "材料抽卡", "\r\n" + msg);
@ -514,7 +534,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "材料十连抽卡") if (e.detail == "材料十连抽卡")
{ {
List<string> msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/drawcardsm?qq={e.user_id}", "", fungame: true) ?? []; List<string> msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/drawcardsm?uid={e.user_id}", "", fungame: true) ?? [];
if (msgs.Count > 0) if (msgs.Count > 0)
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "材料十连抽卡", "\r\n" + string.Join("\r\n", msgs)); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "材料十连抽卡", "\r\n" + string.Join("\r\n", msgs));
@ -528,7 +548,7 @@ namespace Milimoe.RainBOT.Settings
List<string> msgs = []; List<string> msgs = [];
if (int.TryParse(detail, out int page)) if (int.TryParse(detail, out int page))
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo2?qq={e.user_id}&page={page}", "", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo2?uid={e.user_id}&page={page}", "", fungame: true) ?? [];
} }
else if (FunGameItemType.FirstOrDefault(detail.Contains) is string matchedType) else if (FunGameItemType.FirstOrDefault(detail.Contains) is string matchedType)
{ {
@ -536,16 +556,16 @@ namespace Milimoe.RainBOT.Settings
string remain = detail.Replace(matchedType, "").Trim(); string remain = detail.Replace(matchedType, "").Trim();
if (int.TryParse(remain, out page)) if (int.TryParse(remain, out page))
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo4?qq={e.user_id}&page={page}&type={typeIndex}", "", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo4?uid={e.user_id}&page={page}&type={typeIndex}", "", fungame: true) ?? [];
} }
else else
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo4?qq={e.user_id}&page=1&type={typeIndex}", "", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo4?uid={e.user_id}&page=1&type={typeIndex}", "", fungame: true) ?? [];
} }
} }
else else
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo2?qq={e.user_id}&page=1", "", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo2?uid={e.user_id}&page=1", "", fungame: true) ?? [];
} }
if (msgs.Count > 0) if (msgs.Count > 0)
{ {
@ -560,11 +580,11 @@ namespace Milimoe.RainBOT.Settings
List<string> msgs = []; List<string> msgs = [];
if (int.TryParse(detail, out int page)) if (int.TryParse(detail, out int page))
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo3?qq={e.user_id}&page={page}&order=2&orderqty=2", "", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo3?uid={e.user_id}&page={page}&order=2&orderqty=2", "", fungame: true) ?? [];
} }
else else
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo3?qq={e.user_id}&page=1&order=2&orderqty=2", "", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo3?uid={e.user_id}&page=1&order=2&orderqty=2", "", fungame: true) ?? [];
} }
if (msgs.Count > 0) if (msgs.Count > 0)
{ {
@ -579,11 +599,11 @@ namespace Milimoe.RainBOT.Settings
List<string> msgs = []; List<string> msgs = [];
if (int.TryParse(detail, out int page)) if (int.TryParse(detail, out int page))
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo5?qq={e.user_id}&page={page}", "", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo5?uid={e.user_id}&page={page}", "", fungame: true) ?? [];
} }
else else
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo5?qq={e.user_id}&page=1", "", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo5?uid={e.user_id}&page=1", "", fungame: true) ?? [];
} }
if (msgs.Count > 0) if (msgs.Count > 0)
{ {
@ -602,11 +622,11 @@ namespace Milimoe.RainBOT.Settings
List<string> msgs = []; List<string> msgs = [];
if (strings.Length > 1 && int.TryParse(strings[1].Trim(), out int page)) if (strings.Length > 1 && int.TryParse(strings[1].Trim(), out int page))
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo4?qq={e.user_id}&page={page}&type={t}", "", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo4?uid={e.user_id}&page={page}&type={t}", "", fungame: true) ?? [];
} }
else else
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo4?qq={e.user_id}&page=1&type={t}", "", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/inventoryinfo4?uid={e.user_id}&page=1&type={t}", "", fungame: true) ?? [];
} }
if (msgs.Count > 0) if (msgs.Count > 0)
{ {
@ -622,11 +642,11 @@ namespace Milimoe.RainBOT.Settings
string msg = ""; string msg = "";
if (int.TryParse(detail, out int seq)) if (int.TryParse(detail, out int seq))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterinfo?qq={e.user_id}&seq={seq}&simple=true", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterinfo?uid={e.user_id}&seq={seq}&simple=true", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterinfo?qq={e.user_id}&seq=1&simple=true", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterinfo?uid={e.user_id}&seq=1&simple=true", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -641,11 +661,11 @@ namespace Milimoe.RainBOT.Settings
string msg = ""; string msg = "";
if (int.TryParse(detail, out int seq)) if (int.TryParse(detail, out int seq))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterinfo?qq={e.user_id}&seq={seq}&simple=false", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterinfo?uid={e.user_id}&seq={seq}&simple=false", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterinfo?qq={e.user_id}&seq=1&simple=false", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterinfo?uid={e.user_id}&seq=1&simple=false", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -660,11 +680,11 @@ namespace Milimoe.RainBOT.Settings
string msg = ""; string msg = "";
if (int.TryParse(detail, out int seq)) if (int.TryParse(detail, out int seq))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterskills?qq={e.user_id}&seq={seq}", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterskills?uid={e.user_id}&seq={seq}", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterskills?qq={e.user_id}&seq=1", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacterskills?uid={e.user_id}&seq=1", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -679,11 +699,11 @@ namespace Milimoe.RainBOT.Settings
string msg = ""; string msg = "";
if (int.TryParse(detail, out int seq)) if (int.TryParse(detail, out int seq))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacteritems?qq={e.user_id}&seq={seq}", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacteritems?uid={e.user_id}&seq={seq}", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacteritems?qq={e.user_id}&seq=1", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showcharacteritems?uid={e.user_id}&seq=1", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -698,11 +718,11 @@ namespace Milimoe.RainBOT.Settings
string msg = ""; string msg = "";
if (int.TryParse(detail, out int cid)) if (int.TryParse(detail, out int cid))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/setmain?qq={e.user_id}&c={cid}", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/setmain?uid={e.user_id}&c={cid}", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/setmain?qq={e.user_id}&c=1", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/setmain?uid={e.user_id}&c=1", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -711,17 +731,17 @@ namespace Milimoe.RainBOT.Settings
return result; return result;
} }
if (e.detail.Length >= 4 && e.detail[..4].Equals("开启练级", StringComparison.CurrentCultureIgnoreCase)) if (e.detail.Length >= 4 && e.detail[..4].Equals("开启练级", StringComparison.CurrentCultureIgnoreCase) || e.detail.Length >= 4 && e.detail[..4].Equals("开始练级", StringComparison.CurrentCultureIgnoreCase))
{ {
string detail = e.detail.Replace("开启练级", "").Trim(); string detail = e.detail.Replace("开启练级", "").Replace("开始练级", "").Trim();
string msg = ""; string msg = "";
if (int.TryParse(detail, out int cid)) if (int.TryParse(detail, out int cid))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/starttraining?qq={e.user_id}&c={cid}", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/starttraining?uid={e.user_id}&c={cid}", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/starttraining?qq={e.user_id}&c=1", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/starttraining?uid={e.user_id}&c=1", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -732,7 +752,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "练级信息") if (e.detail == "练级信息")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/gettraininginfo?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/gettraininginfo?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "练级信息", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "练级信息", "\r\n" + msg);
@ -742,7 +762,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "练级结算") if (e.detail == "练级结算")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/stoptraining?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/stoptraining?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "练级结算", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "练级结算", "\r\n" + msg);
@ -752,7 +772,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "材料抽卡") if (e.detail == "材料抽卡")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/drawcardm?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/drawcardm?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "材料抽卡", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "材料抽卡", "\r\n" + msg);
@ -762,7 +782,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "任务列表") if (e.detail == "任务列表")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/checkquestlist?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/checkquestlist?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "任务列表", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "任务列表", "\r\n" + msg);
@ -772,7 +792,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "任务信息") if (e.detail == "任务信息")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/checkworkingquest?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/checkworkingquest?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "任务信息", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "任务信息", "\r\n" + msg);
@ -782,7 +802,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "任务结算") if (e.detail == "任务结算")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/settlequest?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/settlequest?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "任务结算", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "任务结算", "\r\n" + msg);
@ -792,7 +812,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "签到") if (e.detail == "签到")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/signin?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/signin?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "签到", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "签到", "\r\n" + msg);
@ -805,7 +825,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("开始任务", "").Trim(); string detail = e.detail.Replace("开始任务", "").Trim();
if (int.TryParse(detail, out int index)) if (int.TryParse(detail, out int index))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/acceptquest?qq={e.user_id}&id={index}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/acceptquest?uid={e.user_id}&id={index}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "开始任务", msg); await Bot.SendGroupMessage(e.group_id, "开始任务", msg);
@ -819,7 +839,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("我的物品", "").Trim(); string detail = e.detail.Replace("我的物品", "").Trim();
if (int.TryParse(detail, out int index)) if (int.TryParse(detail, out int index))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showiteminfo?qq={e.user_id}&seq={index}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showiteminfo?uid={e.user_id}&seq={index}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "查库存物品", msg); await Bot.SendGroupMessage(e.group_id, "查库存物品", msg);
@ -833,7 +853,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("兑换金币", "").Trim(); string detail = e.detail.Replace("兑换金币", "").Trim();
if (int.TryParse(detail, out int materials)) if (int.TryParse(detail, out int materials))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/exchangecredits?qq={e.user_id}&materials={materials}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/exchangecredits?uid={e.user_id}&materials={materials}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "兑换金币", msg); await Bot.SendGroupMessage(e.group_id, "兑换金币", msg);
@ -851,7 +871,7 @@ namespace Milimoe.RainBOT.Settings
{ {
if (c != -1 && i != -1) if (c != -1 && i != -1)
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/unequipitem?qq={e.user_id}&c={c}&i={i}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/unequipitem?uid={e.user_id}&c={c}&i={i}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "取消装备", msg); await Bot.SendGroupMessage(e.group_id, "取消装备", msg);
@ -870,7 +890,7 @@ namespace Milimoe.RainBOT.Settings
{ {
if (c != -1 && i != -1) if (c != -1 && i != -1)
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/equipitem?qq={e.user_id}&c={c}&i={i}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/equipitem?uid={e.user_id}&c={c}&i={i}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "装备", msg); await Bot.SendGroupMessage(e.group_id, "装备", msg);
@ -890,7 +910,7 @@ namespace Milimoe.RainBOT.Settings
string s = strings[1].Trim(); string s = strings[1].Trim();
if (c != -1 && s != "") if (c != -1 && s != "")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/getskilllevelupneedy?qq={e.user_id}&c={c}&s={s}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/getskilllevelupneedy?uid={e.user_id}&c={c}&s={s}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "查看技能升级", msg); await Bot.SendGroupMessage(e.group_id, "查看技能升级", msg);
@ -910,7 +930,7 @@ namespace Milimoe.RainBOT.Settings
string s = strings[1].Trim(); string s = strings[1].Trim();
if (c != -1 && s != "") if (c != -1 && s != "")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/skilllevelup?qq={e.user_id}&c={c}&s={s}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/skilllevelup?uid={e.user_id}&c={c}&s={s}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "技能升级", msg); await Bot.SendGroupMessage(e.group_id, "技能升级", msg);
@ -929,7 +949,7 @@ namespace Milimoe.RainBOT.Settings
{ {
if (id1 != -1 && id2 != -1 && id3 != -1) if (id1 != -1 && id2 != -1 && id3 != -1)
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/conflatemagiccardpack?qq={e.user_id}", System.Text.Json.JsonSerializer.Serialize<int[]>([id1, id2, id3]), fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/conflatemagiccardpack?uid={e.user_id}", System.Text.Json.JsonSerializer.Serialize<int[]>([id1, id2, id3]), fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "合成魔法卡", msg); await Bot.SendGroupMessage(e.group_id, "合成魔法卡", msg);
@ -945,11 +965,11 @@ namespace Milimoe.RainBOT.Settings
string msg = ""; string msg = "";
if (int.TryParse(detail, out int cid)) if (int.TryParse(detail, out int cid))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/characterlevelup?qq={e.user_id}&c={cid}", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/characterlevelup?uid={e.user_id}&c={cid}", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/characterlevelup?qq={e.user_id}&c=1", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/characterlevelup?uid={e.user_id}&c=1", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -964,11 +984,11 @@ namespace Milimoe.RainBOT.Settings
string msg = ""; string msg = "";
if (int.TryParse(detail, out int cid)) if (int.TryParse(detail, out int cid))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/getnormalattacklevelupneedy?qq={e.user_id}&c={cid}", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/getnormalattacklevelupneedy?uid={e.user_id}&c={cid}", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/getnormalattacklevelupneedy?qq={e.user_id}&c=1", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/getnormalattacklevelupneedy?uid={e.user_id}&c=1", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -983,11 +1003,11 @@ namespace Milimoe.RainBOT.Settings
string msg = ""; string msg = "";
if (int.TryParse(detail, out int cid)) if (int.TryParse(detail, out int cid))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/normalattacklevelup?qq={e.user_id}&c={cid}", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/normalattacklevelup?uid={e.user_id}&c={cid}", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/normalattacklevelup?qq={e.user_id}&c=1", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/normalattacklevelup?uid={e.user_id}&c=1", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -1002,11 +1022,11 @@ namespace Milimoe.RainBOT.Settings
string msg = ""; string msg = "";
if (int.TryParse(detail, out int cid)) if (int.TryParse(detail, out int cid))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/characterlevelbreak?qq={e.user_id}&c={cid}", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/characterlevelbreak?uid={e.user_id}&c={cid}", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/characterlevelbreak?qq={e.user_id}&c=1", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/characterlevelbreak?uid={e.user_id}&c=1", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -1021,11 +1041,11 @@ namespace Milimoe.RainBOT.Settings
string msg = ""; string msg = "";
if (int.TryParse(detail, out int cid)) if (int.TryParse(detail, out int cid))
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/getlevelbreakneedy?qq={e.user_id}&id={cid}", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/getlevelbreakneedy?uid={e.user_id}&id={cid}", fungame: true) ?? "").Trim();
} }
else else
{ {
msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/getlevelbreakneedy?qq={e.user_id}&id=1", fungame: true) ?? "").Trim(); msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/getlevelbreakneedy?uid={e.user_id}&id=1", fungame: true) ?? "").Trim();
} }
if (msg != "") if (msg != "")
{ {
@ -1050,7 +1070,7 @@ namespace Milimoe.RainBOT.Settings
{ {
if (id > 0 && id2 > 0) if (id > 0 && id2 > 0)
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/useitem3?qq={e.user_id}&id={id}&id2={id2}&c={isCharacter}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/useitem3?uid={e.user_id}&id={id}&id2={id2}&c={isCharacter}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "使用魔法卡", msg); await Bot.SendGroupMessage(e.group_id, "使用魔法卡", msg);
@ -1071,7 +1091,7 @@ namespace Milimoe.RainBOT.Settings
{ {
string characterIdsString = match.Groups["characterIds"].Value; string characterIdsString = match.Groups["characterIds"].Value;
int[] characterIds = characterIdsString != "" ? [.. characterIdsString.Split(chars, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse)] : [1]; int[] characterIds = characterIdsString != "" ? [.. characterIdsString.Split(chars, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse)] : [1];
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/useitem2?qq={e.user_id}&name={itemName}&count={count}", System.Text.Json.JsonSerializer.Serialize(characterIds), fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/useitem2?uid={e.user_id}&name={itemName}&count={count}", System.Text.Json.JsonSerializer.Serialize(characterIds), fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "使用", msg); await Bot.SendGroupMessage(e.group_id, "使用", msg);
@ -1088,7 +1108,7 @@ namespace Milimoe.RainBOT.Settings
{ {
string characterIdsString = match.Groups["characterIds"].Value; string characterIdsString = match.Groups["characterIds"].Value;
int[] characterIds = characterIdsString != "" ? [.. characterIdsString.Split(chars, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse)] : [1]; int[] characterIds = characterIdsString != "" ? [.. characterIdsString.Split(chars, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse)] : [1];
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/useitem?qq={e.user_id}&id={itemId}", System.Text.Json.JsonSerializer.Serialize(characterIds), fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/useitem?uid={e.user_id}&id={itemId}", System.Text.Json.JsonSerializer.Serialize(characterIds), fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "使用", msg); await Bot.SendGroupMessage(e.group_id, "使用", msg);
@ -1104,7 +1124,7 @@ namespace Milimoe.RainBOT.Settings
string itemName = match.Groups["itemName"].Value.Trim(); string itemName = match.Groups["itemName"].Value.Trim();
if (int.TryParse(match.Groups["count"].Value, out int count)) if (int.TryParse(match.Groups["count"].Value, out int count))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/useitem2?qq={e.user_id}&name={itemName}&count={count}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/useitem2?uid={e.user_id}&name={itemName}&count={count}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "使用", msg); await Bot.SendGroupMessage(e.group_id, "使用", msg);
@ -1119,7 +1139,7 @@ namespace Milimoe.RainBOT.Settings
{ {
if (int.TryParse(match.Groups["itemId"].Value, out int itemId)) if (int.TryParse(match.Groups["itemId"].Value, out int itemId))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/useitem?qq={e.user_id}&id={itemId}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/useitem?uid={e.user_id}&id={itemId}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "使用", msg); await Bot.SendGroupMessage(e.group_id, "使用", msg);
@ -1145,7 +1165,7 @@ namespace Milimoe.RainBOT.Settings
ids.Add(id); ids.Add(id);
} }
} }
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/decomposeitem?qq={e.user_id}", System.Text.Json.JsonSerializer.Serialize(ids), fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/decomposeitem?uid={e.user_id}", System.Text.Json.JsonSerializer.Serialize(ids), fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "分解物品", msg); await Bot.SendGroupMessage(e.group_id, "分解物品", msg);
@ -1164,7 +1184,7 @@ namespace Milimoe.RainBOT.Settings
string itemName = match.Groups["itemName"].Value.Trim(); string itemName = match.Groups["itemName"].Value.Trim();
if (int.TryParse(match.Groups["count"].Value, out int count)) if (int.TryParse(match.Groups["count"].Value, out int count))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/decomposeitem2?qq={e.user_id}&name={itemName}&count={count}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/decomposeitem2?uid={e.user_id}&name={itemName}&count={count}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "分解", msg); await Bot.SendGroupMessage(e.group_id, "分解", msg);
@ -1180,7 +1200,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("品质分解", "").Trim(); string detail = e.detail.Replace("品质分解", "").Trim();
if (int.TryParse(detail, out int q)) if (int.TryParse(detail, out int q))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/decomposeitem3?qq={e.user_id}&q={q}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/decomposeitem3?uid={e.user_id}&q={q}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "品质分解", msg); await Bot.SendGroupMessage(e.group_id, "品质分解", msg);
@ -1205,7 +1225,7 @@ namespace Milimoe.RainBOT.Settings
{ {
userid = temp; userid = temp;
} }
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/createitem?qq={e.user_id}&name={name}&count={count}&target={userid}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/createitem?uid={e.user_id}&name={name}&count={count}&target={userid}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "熟圣之力", msg); await Bot.SendGroupMessage(e.group_id, "熟圣之力", msg);
@ -1225,11 +1245,11 @@ namespace Milimoe.RainBOT.Settings
List<string> msgs = []; List<string> msgs = [];
if (long.TryParse(detail.Trim(), out long eqq)) if (long.TryParse(detail.Trim(), out long eqq))
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustom?qq={e.user_id}&eqq={eqq}&all=true", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustom?uid={e.user_id}&euid={eqq}&all=true", fungame: true) ?? [];
} }
else else
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustom2?qq={e.user_id}&name={detail.Trim()}&all=true", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustom2?uid={e.user_id}&name={detail.Trim()}&all=true", fungame: true) ?? [];
} }
List<string> real = []; List<string> real = [];
if (msgs.Count >= 2) if (msgs.Count >= 2)
@ -1278,11 +1298,11 @@ namespace Milimoe.RainBOT.Settings
List<string> msgs = []; List<string> msgs = [];
if (long.TryParse(detail.Trim(), out long eqq)) if (long.TryParse(detail.Trim(), out long eqq))
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustom?qq={e.user_id}&eqq={eqq}&all=false", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustom?uid={e.user_id}&euid={eqq}&all=false", fungame: true) ?? [];
} }
else else
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustom2?qq={e.user_id}&name={detail.Trim()}&all=false", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustom2?uid={e.user_id}&name={detail.Trim()}&all=false", fungame: true) ?? [];
} }
List<string> real = []; List<string> real = [];
if (msgs.Count > 2) if (msgs.Count > 2)
@ -1324,11 +1344,11 @@ namespace Milimoe.RainBOT.Settings
List<string> msgs = []; List<string> msgs = [];
if (long.TryParse(detail.Trim(), out long eqq)) if (long.TryParse(detail.Trim(), out long eqq))
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustomteam?qq={e.user_id}&eqq={eqq}&all=true", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustomteam?uid={e.user_id}&euid={eqq}&all=true", fungame: true) ?? [];
} }
else else
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustomteam2?qq={e.user_id}&name={detail.Trim()}&all=true", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightcustomteam2?uid={e.user_id}&name={detail.Trim()}&all=true", fungame: true) ?? [];
} }
List<string> real = []; List<string> real = [];
if (msgs.Count >= 3) if (msgs.Count >= 3)
@ -1397,7 +1417,7 @@ namespace Milimoe.RainBOT.Settings
List<string> msgs = []; List<string> msgs = [];
if (int.TryParse(detail.Trim(), out int index)) if (int.TryParse(detail.Trim(), out int index))
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightbossteam?qq={e.user_id}&index={index}&all=true", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightbossteam?uid={e.user_id}&index={index}&all=true", fungame: true) ?? [];
List<string> real = []; List<string> real = [];
if (msgs.Count >= 3) if (msgs.Count >= 3)
{ {
@ -1451,7 +1471,7 @@ namespace Milimoe.RainBOT.Settings
List<string> msgs = []; List<string> msgs = [];
if (int.TryParse(detail.Trim(), out int index)) if (int.TryParse(detail.Trim(), out int index))
{ {
msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightboss?qq={e.user_id}&index={index}&all=true", fungame: true) ?? []; msgs = await Bot.HttpPost<List<string>>($"https://{GeneralSettings.FunGameServer}/fungame/fightboss?uid={e.user_id}&index={index}&all=true", fungame: true) ?? [];
List<string> real = []; List<string> real = [];
if (msgs.Count >= 3) if (msgs.Count >= 3)
{ {
@ -1504,7 +1524,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("小队添加", "").Trim(); string detail = e.detail.Replace("小队添加", "").Trim();
if (int.TryParse(detail, out int c)) if (int.TryParse(detail, out int c))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/addsquad?qq={e.user_id}&c={c}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/addsquad?uid={e.user_id}&c={c}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "小队", msg); await Bot.SendGroupMessage(e.group_id, "小队", msg);
@ -1518,7 +1538,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("小队移除", "").Trim(); string detail = e.detail.Replace("小队移除", "").Trim();
if (int.TryParse(detail, out int c)) if (int.TryParse(detail, out int c))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/removesquad?qq={e.user_id}&c={c}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/removesquad?uid={e.user_id}&c={c}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "小队", msg); await Bot.SendGroupMessage(e.group_id, "小队", msg);
@ -1539,7 +1559,7 @@ namespace Milimoe.RainBOT.Settings
cindexs.Add(c); cindexs.Add(c);
} }
} }
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/setsquad?qq={e.user_id}", System.Text.Json.JsonSerializer.Serialize(cindexs), fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/setsquad?uid={e.user_id}", System.Text.Json.JsonSerializer.Serialize(cindexs), fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "小队", msg); await Bot.SendGroupMessage(e.group_id, "小队", msg);
@ -1552,7 +1572,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("加入社团", "").Trim(); string detail = e.detail.Replace("加入社团", "").Trim();
if (int.TryParse(detail, out int c)) if (int.TryParse(detail, out int c))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/joinclub?qq={e.user_id}&id={c}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/joinclub?uid={e.user_id}&id={c}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "社团", msg); await Bot.SendGroupMessage(e.group_id, "社团", msg);
@ -1570,7 +1590,7 @@ namespace Milimoe.RainBOT.Settings
isPublic = false; isPublic = false;
} }
detail = detail.Replace("私密", "").Trim(); detail = detail.Replace("私密", "").Trim();
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/createclub?qq={e.user_id}&public={isPublic}&prefix={detail}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/createclub?uid={e.user_id}&public={isPublic}&prefix={detail}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "社团", msg); await Bot.SendGroupMessage(e.group_id, "社团", msg);
@ -1580,7 +1600,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "退出社团") if (e.detail == "退出社团")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/quitclub?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/quitclub?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg);
@ -1590,7 +1610,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "我的社团") if (e.detail == "我的社团")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showclubinfo?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showclubinfo?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg);
@ -1600,7 +1620,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "解散社团") if (e.detail == "解散社团")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/disbandclub?qq={e.user_id}", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/disbandclub?uid={e.user_id}", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg);
@ -1610,7 +1630,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "查看社团成员") if (e.detail == "查看社团成员")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showclubmemberlist?qq={e.user_id}&type=0", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showclubmemberlist?uid={e.user_id}&type=0", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg);
@ -1620,7 +1640,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "查看社团管理") if (e.detail == "查看社团管理")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showclubmemberlist?qq={e.user_id}&type=1", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showclubmemberlist?uid={e.user_id}&type=1", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg);
@ -1630,7 +1650,7 @@ namespace Milimoe.RainBOT.Settings
if (e.detail == "查看申请人列表") if (e.detail == "查看申请人列表")
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showclubmemberlist?qq={e.user_id}&type=2", "", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showclubmemberlist?uid={e.user_id}&type=2", "", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg); await Bot.SendGroupMessageAt(e.user_id, e.group_id, "社团", "\r\n" + msg);
@ -1643,7 +1663,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("社团批准", "").Replace("@", "").Trim(); string detail = e.detail.Replace("社团批准", "").Replace("@", "").Trim();
if (long.TryParse(detail, out long id)) if (long.TryParse(detail, out long id))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/approveclub?qq={e.user_id}&id={id}&approval=true", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/approveclub?uid={e.user_id}&id={id}&approval=true", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "社团", msg); await Bot.SendGroupMessage(e.group_id, "社团", msg);
@ -1657,7 +1677,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("社团拒绝", "").Replace("@", "").Trim(); string detail = e.detail.Replace("社团拒绝", "").Replace("@", "").Trim();
if (long.TryParse(detail, out long id)) if (long.TryParse(detail, out long id))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/approveclub?qq={e.user_id}&id={id}&approval=false", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/approveclub?uid={e.user_id}&id={id}&approval=false", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "社团", msg); await Bot.SendGroupMessage(e.group_id, "社团", msg);
@ -1671,7 +1691,7 @@ namespace Milimoe.RainBOT.Settings
string detail = e.detail.Replace("社团踢出", "").Replace("@", "").Trim(); string detail = e.detail.Replace("社团踢出", "").Replace("@", "").Trim();
if (long.TryParse(detail, out long id)) if (long.TryParse(detail, out long id))
{ {
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/kickclub?qq={e.user_id}&id={id}", fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/kickclub?uid={e.user_id}&id={id}", fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "社团", msg); await Bot.SendGroupMessage(e.group_id, "社团", msg);
@ -1703,7 +1723,7 @@ namespace Milimoe.RainBOT.Settings
{ {
args = [.. strings[1..]]; args = [.. strings[1..]];
} }
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/changeclub?qq={e.user_id}&part={part}", System.Text.Json.JsonSerializer.Serialize(args), fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/changeclub?uid={e.user_id}&part={part}", System.Text.Json.JsonSerializer.Serialize(args), fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "社团", msg); await Bot.SendGroupMessage(e.group_id, "社团", msg);
@ -1716,7 +1736,7 @@ namespace Milimoe.RainBOT.Settings
{ {
string detail = e.detail.Replace("社团转让", "").Replace("@", "").Trim(); string detail = e.detail.Replace("社团转让", "").Replace("@", "").Trim();
List<string> args = [detail]; List<string> args = [detail];
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/changeclub?qq={e.user_id}&part=setmaster", System.Text.Json.JsonSerializer.Serialize(args), fungame: true) ?? "").Trim(); string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/changeclub?uid={e.user_id}&part=setmaster", System.Text.Json.JsonSerializer.Serialize(args), fungame: true) ?? "").Trim();
if (msg != "") if (msg != "")
{ {
await Bot.SendGroupMessage(e.group_id, "社团", msg); await Bot.SendGroupMessage(e.group_id, "社团", msg);
@ -1724,6 +1744,44 @@ namespace Milimoe.RainBOT.Settings
return result; return result;
} }
if (e.detail == "每日商店")
{
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/showdailystore?uid={e.user_id}", fungame: true) ?? "").Trim();
if (msg != "")
{
await Bot.SendGroupMessageAt(e.user_id, e.group_id, "商店", "\r\n" + msg);
}
return result;
}
if (e.detail.StartsWith("商店购买", StringComparison.CurrentCultureIgnoreCase))
{
string detail = e.detail.Replace("商店购买", "").Trim();
if (int.TryParse(detail, out int id))
{
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/dailystorebuy?uid={e.user_id}&id={id}", fungame: true) ?? "").Trim();
if (msg != "")
{
await Bot.SendGroupMessage(e.group_id, "商店", msg);
}
}
return result;
}
if (e.detail.StartsWith("商店查看", StringComparison.CurrentCultureIgnoreCase))
{
string detail = e.detail.Replace("商店查看", "").Trim();
if (int.TryParse(detail, out int id))
{
string msg = (await Bot.HttpPost<string>($"https://{GeneralSettings.FunGameServer}/fungame/dailystoreshowinfo?uid={e.user_id}&id={id}", fungame: true) ?? "").Trim();
if (msg != "")
{
await Bot.SendGroupMessage(e.group_id, "商店", msg);
}
}
return result;
}
if (e.user_id == GeneralSettings.Master && e.detail.Length >= 9 && e.detail[..9].Equals("重载FunGame", StringComparison.CurrentCultureIgnoreCase)) 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 result; if (!await Bot.CheckBlackList(true, e.user_id, e.group_id)) return result;

52
src/Settings/Testing.cs Normal file
View File

@ -0,0 +1,52 @@
using Milimoe.OneBot.Framework.Utility;
using Milimoe.OneBot.Model.Event;
namespace Milimoe.RainBOT.Settings
{
public class Testing
{
public Testing()
{
GeneralSettings.LoadSetting();
QQOpenID.LoadConfig();
OshimaController.Config.FunGame_isAutoRetry = true;
Task r = Task.Run(async () =>
{
await OshimaController.Instance.Start();
await OshimaController.Instance.ConnectToAnonymousServer();
OshimaController.Config.FunGame_isAutoRetry = true;
string json = @"{""self_id"":928884953,""user_id"":3305106902,""time"":1737787658,""message_id"":212281255,""real_id"":212281255,""message_seq"":212281255,""message_type"":""group"",""sender"":{""user_id"":3305106902,""nickname"":""心音"",""card"":""高僧预测:"",""role"":""admin"",""title"":""注意素质""},""raw_message"":""签到"",""font"":14,""sub_type"":""normal"",""message"":[{""type"":""text"",""data"":{""text"":""签到""}}],""message_format"":""array"",""post_type"":""message"",""group_id"":667678970}";
try
{
GroupMessageEvent e = JsonTools.GetObject<GroupMessageEvent>(json) ?? new();
await RainBOTFunGame.Handler2(e);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
});
while (true)
{
if (Console.ReadLine() == "test")
{
string json = @"{""self_id"":928884953,""user_id"":3305106902,""time"":1737787658,""message_id"":212281255,""real_id"":212281255,""message_seq"":212281255,""message_type"":""group"",""sender"":{""user_id"":3305106902,""nickname"":""心音"",""card"":""高僧预测:"",""role"":""admin"",""title"":""注意素质""},""raw_message"":""签到"",""font"":14,""sub_type"":""normal"",""message"":[{""type"":""text"",""data"":{""text"":""签到""}}],""message_format"":""array"",""post_type"":""message"",""group_id"":667678970}";
try
{
GroupMessageEvent e = JsonTools.GetObject<GroupMessageEvent>(json) ?? new();
_ = RainBOTFunGame.Handler2(e);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
if (Console.ReadLine() == "quit")
break;
}
}
}
}