Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
Coloryr committed May 22, 2024
1 parent 06b7bba commit dd39451
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 53 deletions.
4 changes: 2 additions & 2 deletions Minecraft_QQ_Core/Config/ConfigObj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ public static AskConfig Make()
{
AskList = new()
{
{
{
"服务器菜单",
$"服务器查询菜单:{Environment.NewLine}" +
$"【{Minecraft_QQ.Config.Check.Head}{Minecraft_QQ.Config.Check.Bind} ID】可以绑定你的游戏ID。{Environment.NewLine}" +
$"【{Minecraft_QQ.Config.Check.Head}{Minecraft_QQ.Config.Check.PlayList}】可以查询服务器在线人数。{Environment.NewLine}" +
$"【{Minecraft_QQ.Config.Check.Head}{Minecraft_QQ.Config.Check.ServerCheck}】可以查询服务器是否在运行。{Environment.NewLine}" +
$"【{Minecraft_QQ.Config.Check.Head}{Minecraft_QQ.Config.Check.Send} 内容】可以向服务器里发送消息。(使用前请确保已经绑定了ID,)"
}
}
}
};
}
Expand Down
6 changes: 3 additions & 3 deletions Minecraft_QQ_Core/Config/ConfigRead.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Minecraft_QQ_Core.Utils;
using Newtonsoft.Json;
using System;
using System;
using System.IO;
using Minecraft_QQ_Core.Utils;
using Newtonsoft.Json;

namespace Minecraft_QQ_Core.Config;

Expand Down
4 changes: 2 additions & 2 deletions Minecraft_QQ_Core/Config/ConfigSave.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Minecraft_QQ_Core.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using Minecraft_QQ_Core.Utils;
using Newtonsoft.Json;

namespace Minecraft_QQ_Core.Config;

Expand Down
10 changes: 5 additions & 5 deletions Minecraft_QQ_Core/DBMysql.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Dapper;
using System;
using System.Linq;
using System.Threading.Tasks;
using Dapper;
using Minecraft_QQ_Core.Config;
using Minecraft_QQ_Core.Utils;
using MySqlConnector;
using System;
using System.Linq;
using System.Threading.Tasks;

namespace Minecraft_QQ_Core;

Expand Down Expand Up @@ -175,7 +175,7 @@ private static void LoadMute()
Minecraft_QQ.Players.MuteList.Add(id);
}
}

}
}
/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions Minecraft_QQ_Core/Minecraft_QQ.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Minecraft_QQ_Core.Config;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Minecraft_QQ_Core.Config;
using Minecraft_QQ_Core.MySocket;
using Minecraft_QQ_Core.Robot;
using Minecraft_QQ_Core.Utils;
using OneBotSharp.Objs.Message;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;

namespace Minecraft_QQ_Core;

Expand Down
4 changes: 2 additions & 2 deletions Minecraft_QQ_Core/MySocket/Message.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using DotNetty.Buffers;
using System.Text;
using DotNetty.Buffers;
using Minecraft_QQ_Core.Utils;
using System.Text;

namespace Minecraft_QQ_Core.MySocket;

Expand Down
6 changes: 3 additions & 3 deletions Minecraft_QQ_Core/MySocket/PluginItem.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using DotNetty.Buffers;
using System;
using System.Threading.Tasks;
using DotNetty.Buffers;
using DotNetty.Transport.Channels;
using Minecraft_QQ_Core.Robot;
using Minecraft_QQ_Core.Utils;
using OneBotSharp.Objs.Message;
using System;
using System.Threading.Tasks;

namespace Minecraft_QQ_Core.MySocket;

Expand Down
8 changes: 4 additions & 4 deletions Minecraft_QQ_Core/MySocket/PluginServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using DotNetty.Buffers;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using DotNetty.Buffers;
using DotNetty.Codecs;
using DotNetty.Handlers.Logging;
using DotNetty.Transport.Bootstrapping;
Expand All @@ -7,9 +10,6 @@
using Minecraft_QQ_Core.Robot;
using Minecraft_QQ_Core.Utils;
using OneBotSharp.Objs.Message;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;

namespace Minecraft_QQ_Core.MySocket;

Expand Down
18 changes: 9 additions & 9 deletions Minecraft_QQ_Core/Robot/MessageHelper.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Minecraft_QQ_Core.Config;
using System;
using System.Collections.Generic;
using System.Text;
using Minecraft_QQ_Core.Config;
using Minecraft_QQ_Core.MySocket;
using Minecraft_QQ_Core.Utils;
using OneBotSharp.Objs.Message;
using System;
using System.Collections.Generic;
using System.Text;

namespace Minecraft_QQ_Core.Robot;

Expand Down Expand Up @@ -411,7 +411,7 @@ private static bool SendCommand(long fromGroup, List<MsgBase> msg, long fromQQ)
}
else if (item1 == "{arg:next}")
{
if (nowlist == null || index3 >= nowlist.Length )
if (nowlist == null || index3 >= nowlist.Length)
{
index1++;
if (index1 >= msg.Count || msg[index1] is not MsgText text1)
Expand Down Expand Up @@ -550,7 +550,7 @@ public static void GroupMessage(long fromGroup, long fromQQ, string raw, List<Ms
//SendMessage(group, player, raw, msg);

//始终发送
if (config.Setting.AutoSend && !config.Setting.FixMode && PluginServer.IsReady()
if (config.Setting.AutoSend && !config.Setting.FixMode && PluginServer.IsReady()
&& group.EnableSay && player != null)
{
SendMessage(group, player, raw, msg);
Expand All @@ -572,7 +572,7 @@ public static void GroupMessage(long fromGroup, long fromQQ, string raw, List<Ms
{
if (!string.IsNullOrWhiteSpace(Minecraft_QQ.Config.Message.FixText))
{
RobotCore.SendGroupMessage(fromGroup,
RobotCore.SendGroupMessage(fromGroup,
[
MsgAt.BuildAt(fromQQ.ToString()),
MsgText.Build(Minecraft_QQ.Config.Message.FixText)
Expand All @@ -581,7 +581,7 @@ public static void GroupMessage(long fromGroup, long fromQQ, string raw, List<Ms
}
else if (PluginServer.IsReady() == false)
{
RobotCore.SendGroupMessage(fromGroup,
RobotCore.SendGroupMessage(fromGroup,
[
MsgAt.BuildAt(fromQQ.ToString()),
MsgText.Build("发送失败,没有服务器链接")
Expand All @@ -591,7 +591,7 @@ public static void GroupMessage(long fromGroup, long fromQQ, string raw, List<Ms
{
if (!string.IsNullOrWhiteSpace(Minecraft_QQ.Config.Message.NoneBindID))
{
RobotCore.SendGroupMessage(fromGroup,
RobotCore.SendGroupMessage(fromGroup,
[
MsgAt.BuildAt(fromQQ.ToString()),
MsgText.Build(Minecraft_QQ.Config.Message.NoneBindID)
Expand Down
15 changes: 6 additions & 9 deletions Minecraft_QQ_Core/Robot/RobotCore.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
using Minecraft_QQ_Core.Utils;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using Minecraft_QQ_Core.Utils;
using OneBotSharp;
using OneBotSharp.Objs.Api;
using OneBotSharp.Objs.Event;
using OneBotSharp.Objs.Message;
using OneBotSharp.Protocol;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Minecraft_QQ_Core.Robot;

Expand Down Expand Up @@ -97,7 +94,7 @@ private static void Connect()
Logs.LogOut("[OneBot]机器人链接错误");
if (run == false)
{
return;
return;
}
Logs.LogError(e);
restart = true;
Expand Down
11 changes: 5 additions & 6 deletions Minecraft_QQ_Core/Utils/Funtion.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using Minecraft_QQ_Core.Robot;
using Newtonsoft.Json.Linq;
using OneBotSharp.Objs.Message;
using System;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using Minecraft_QQ_Core.Robot;
using Newtonsoft.Json.Linq;
using OneBotSharp.Objs.Message;

namespace Minecraft_QQ_Core.Utils;

Expand Down Expand Up @@ -137,7 +136,7 @@ public static string GetString(string a, string b, string? c = null)
}
else if (app == "com.tencent.troopsharecard")
{
return obj["prompt"]?.ToString() + ":" + obj["meta"]?["contact"]?["nickname"]?.ToString()
return obj["prompt"]?.ToString() + ":" + obj["meta"]?["contact"]?["nickname"]?.ToString()
+ "\n" + obj["meta"]?["contact"]?["jumpUrl"]?.ToString();
}
}
Expand Down
6 changes: 3 additions & 3 deletions Minecraft_QQ_Core/Utils/SendGroup.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Minecraft_QQ_Core.Robot;
using OneBotSharp.Objs.Message;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using Minecraft_QQ_Core.Robot;
using OneBotSharp.Objs.Message;

namespace Minecraft_QQ_Core.Utils;

Expand Down

0 comments on commit dd39451

Please sign in to comment.