diff --git a/.gitignore b/.gitignore index 12e22ad..0153f7b 100644 --- a/.gitignore +++ b/.gitignore @@ -339,6 +339,6 @@ ASALocalRun/ # BeatPulse healthcheck temp database healthchecksdb DevIcon.* -Test +TestTest nuget.config *.cd \ No newline at end of file diff --git a/AuroraNative.sln b/AuroraNative.sln index d663a09..48f8db0 100644 --- a/AuroraNative.sln +++ b/AuroraNative.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.31005.135 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuroraNative", "AuroraNative\AuroraNative.csproj", "{35A21EA1-3EA7-45A8-A483-DB83DBEC902E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{3F471ABE-3938-4954-BA0F-6F928A35746A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {35A21EA1-3EA7-45A8-A483-DB83DBEC902E}.Debug|Any CPU.Build.0 = Debug|Any CPU {35A21EA1-3EA7-45A8-A483-DB83DBEC902E}.Release|Any CPU.ActiveCfg = Release|Any CPU {35A21EA1-3EA7-45A8-A483-DB83DBEC902E}.Release|Any CPU.Build.0 = Release|Any CPU + {3F471ABE-3938-4954-BA0F-6F928A35746A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F471ABE-3938-4954-BA0F-6F928A35746A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F471ABE-3938-4954-BA0F-6F928A35746A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F471ABE-3938-4954-BA0F-6F928A35746A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/AuroraNative/API/Api.cs b/AuroraNative/API/Api.cs index 37d8ac3..28be4f4 100644 --- a/AuroraNative/API/Api.cs +++ b/AuroraNative/API/Api.cs @@ -470,6 +470,14 @@ namespace AuroraNative return (await SendCallArray(new BaseAPI("get_friend_list", null, "GetFriendList:" + Utils.NowTimeSteamp()))).ToObject>(); } + /// + /// 删除好友 + /// + /// 好友QQ号 + public void DeleteFriend(long UserID) { + SendCallVoid(new BaseAPI("delete_friend", new JObject{{ "friend_id", UserID }}, "DeleteFriend:" + Utils.NowTimeSteamp())); + } + /// /// 获取群信息 /// @@ -941,6 +949,31 @@ namespace AuroraNative return (await SendCallObject(new BaseAPI("check_url_safely", new JObject { { "url", URL } }, "CheckURLSafely:" + Utils.NowTimeSteamp()))).Value("level"); } + /// + /// 获取在线机型 + /// + /// 机型名字 + /// 在线机型列表 + public async Task> GetModels(string ModelName) { + return (await SendCallObject(new BaseAPI("_get_model_show", new JObject { { "model", ModelName } }, "GetModelShow:" + Utils.NowTimeSteamp()))).ToObject>(); + } + + /// + /// 设置在线机型 + /// + /// 机型名字 + /// 在线机型名字 + public void SetModel(string ModelName, string ShowModelName) + { + JObject Params = new JObject + { + { "model", ModelName }, + { "model_show ", ShowModelName } + }; + + SendCallVoid(new BaseAPI("_set_model_show", Params, "SetModelShow:" + Utils.NowTimeSteamp())); + } + #region ==额外API== /// diff --git a/AuroraNative/Abstract/EventArgs/MessageEvents/MessageEventArgs.cs b/AuroraNative/Abstract/EventArgs/MessageEvents/MessageEventArgs.cs index 57b63c0..3e61c2a 100644 --- a/AuroraNative/Abstract/EventArgs/MessageEvents/MessageEventArgs.cs +++ b/AuroraNative/Abstract/EventArgs/MessageEvents/MessageEventArgs.cs @@ -22,6 +22,12 @@ namespace AuroraNative.EventArgs [JsonProperty(PropertyName = "sub_type")] public string SubType { get; private set; } + /// + /// 临时会话来源 + /// + [JsonProperty(PropertyName = "temp_source")] + public int TempSource { get; private set; } + /// /// 消息ID /// diff --git a/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupBanSpeakArgs.cs b/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupBanSpeakArgs.cs index ffcd903..a7254de 100644 --- a/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupBanSpeakArgs.cs +++ b/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupBanSpeakArgs.cs @@ -10,7 +10,7 @@ namespace AuroraNative.EventArgs #region --属性-- /// - /// 禁言时长,单位秒 + /// 禁言时长,单位秒 /// [JsonProperty(PropertyName = "duration")] public long Duration { get; private set; } diff --git a/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupMessageRecallArgs.cs b/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupMessageRecallArgs.cs index a3cda01..8df8ccc 100644 --- a/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupMessageRecallArgs.cs +++ b/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupMessageRecallArgs.cs @@ -16,7 +16,7 @@ namespace AuroraNative.EventArgs public long GroupID { get; private set; } /// - /// 操作者 QQ 号 + /// 操作者 QQ 号 /// [JsonProperty(PropertyName = "operator_id")] public long OperatorID { get; private set; } diff --git a/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupNoticeArgs.cs b/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupNoticeArgs.cs index f5c4414..32f628a 100644 --- a/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupNoticeArgs.cs +++ b/AuroraNative/Abstract/EventArgs/NoticeEvents/GroupNoticeArgs.cs @@ -22,7 +22,7 @@ namespace AuroraNative.EventArgs public string SubType { get; private set; } /// - /// 操作者 QQ 号 + /// 操作者 QQ 号 /// [JsonProperty(PropertyName = "operator_id")] public long OperatorID { get; private set; } diff --git a/AuroraNative/Abstract/Model.cs b/AuroraNative/Abstract/Model.cs new file mode 100644 index 0000000..e67f4c0 --- /dev/null +++ b/AuroraNative/Abstract/Model.cs @@ -0,0 +1,26 @@ +using Newtonsoft.Json; + +namespace AuroraNative.Type +{ + /// + /// 机型 抽象类 + /// + public sealed class Model + { + #region --属性-- + + /// + /// 机型名称 + /// + [JsonProperty(PropertyName = "model_show")] + public string Name; + + /// + /// 是否付费 + /// + [JsonProperty(PropertyName = "need_pay")] + public bool IsPay; + + #endregion + } +} diff --git a/AuroraNative/AuroraNative.csproj b/AuroraNative/AuroraNative.csproj index 4adbbf6..bca1453 100644 --- a/AuroraNative/AuroraNative.csproj +++ b/AuroraNative/AuroraNative.csproj @@ -15,13 +15,13 @@ false false true - 1.3.0.0506 - 1.3.0.0506 + 1.4.1.0715 + 1.4.1.0715 Icon.png false AuroraNative AuroraNative - 1.3.0-Beta + 1.4.1-Beta true true diff --git a/AuroraNative/AuroraNative.xml b/AuroraNative/AuroraNative.xml index 5fa80e0..ef21441 100644 --- a/AuroraNative/AuroraNative.xml +++ b/AuroraNative/AuroraNative.xml @@ -28,7 +28,7 @@ - 提供用于描述事件参数的基础类, 该类是抽象的 + 提供用于描述登录设备的基础类, 该类是抽象的 @@ -211,12 +211,12 @@ - 现在人数 + 性别 - + - 最大人数 + 年龄 @@ -279,6 +279,21 @@ 群名称 + + + 群备注 + + + + + 群创建时间 + + + + + 群等级 + + 现在人数 @@ -459,6 +474,21 @@ 发送者QQ号 + + + 机型 抽象类 + + + + + 机型名称 + + + + + 是否付费 + + OCR结果信息 抽象类 @@ -747,6 +777,11 @@ 消息子类型 + + + 临时会话来源 + + 消息ID @@ -980,7 +1015,7 @@ - 禁言时长,单位秒 + 禁言时长,单位秒 @@ -1134,7 +1169,7 @@ - 操作者 QQ 号 + 操作者 QQ 号 @@ -1172,7 +1207,7 @@ - 操作者 QQ 号 + 操作者 QQ 号 @@ -1584,7 +1619,7 @@ - 设置群组专属头衔 + 设置群组成员专属头衔 群号 QQ号 @@ -1628,6 +1663,12 @@ 错误返回null,成功返回JObject + + + 删除好友 + + 好友QQ号 + 获取群信息 @@ -1847,6 +1888,28 @@ 需要检测的链接 错误返回null,成功返回int + + + 获取在线机型 + + 机型名字 + 在线机型列表 + + + + 设置在线机型 + + 机型名字 + 在线机型名字 + + + + 获取指定群头像 + + 群号 + 保存路径-包括文件名(通常后缀名是jpg) + 是否成功 + API调用类 diff --git a/AuroraNative/WebSockets/WebSocket.cs b/AuroraNative/WebSockets/WebSocket.cs index e50da6b..bdbd6a0 100644 --- a/AuroraNative/WebSockets/WebSocket.cs +++ b/AuroraNative/WebSockets/WebSocket.cs @@ -23,7 +23,7 @@ namespace AuroraNative.WebSockets internal JObject Json; internal int Port = 6700; internal static readonly System.Type[] AttributeTypes = Assembly.GetExecutingAssembly().GetTypes().Where(p => p.IsAbstract == false && p.IsInterface == false && typeof(Attribute).IsAssignableFrom(p)).ToArray(); - internal static readonly Version DependencyVersion = new Version("0.9.40"); + internal static readonly Version DependencyVersion = new Version("1.0.0"); internal static bool IsCheckVersion = false; #endregion diff --git a/Test/EventHook.cs b/Test/EventHook.cs new file mode 100644 index 0000000..28e6f37 --- /dev/null +++ b/Test/EventHook.cs @@ -0,0 +1,20 @@ +using AuroraNative; +using AuroraNative.EventArgs; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Test +{ + class EventHook : Event + { + public override void LifeCycle(LifeCycleArgs e) + { + Console.WriteLine(e.MetaEventType); + Console.WriteLine(e.PostType); + Console.WriteLine(e.SubType); + } + } +} diff --git a/Test/Program.cs b/Test/Program.cs new file mode 100644 index 0000000..687402a --- /dev/null +++ b/Test/Program.cs @@ -0,0 +1,21 @@ +using AuroraNative.WebSockets; +using System; + +namespace Test +{ + class Program + { + static void Main(string[] args) + { + Client client = new Client(new EventHook()); + client.Create(); + + while (true) + { + string Command = Console.ReadLine(); + //TODO 关于指令预判 - Console.WriteLine(LevenshteinDistance.Instance.LevenshteinDistancePercent(Command, "!setid") * 100); + Console.ReadKey(); + } + } + } +} diff --git a/Test/Test.csproj b/Test/Test.csproj new file mode 100644 index 0000000..4b51528 --- /dev/null +++ b/Test/Test.csproj @@ -0,0 +1,12 @@ + + + + Exe + net5.0 + + + + + + +