submodule对gitea不管用,所以直接拉了一份拉格兰
This commit is contained in:
14
Lagrange.Core/Lagrange.OneBot/Constant.cs
Normal file
14
Lagrange.Core/Lagrange.OneBot/Constant.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Lagrange.OneBot;
|
||||
|
||||
internal static class Constant
|
||||
{
|
||||
public const string OneBotImpl = "Lagrange.OneBot";
|
||||
|
||||
public const int OneBotProtocolVersion = 11;
|
||||
|
||||
public const string OneBotImplVersion = "0.0.3";
|
||||
|
||||
public const bool CanSendImage = true;
|
||||
|
||||
public const bool CanSendRecord = true;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Text.Json.Nodes;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotAction
|
||||
{
|
||||
[JsonPropertyName("action")] public string Action { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("params")] public JsonNode? Params { get; set; }
|
||||
|
||||
[JsonPropertyName("echo")] public object? Echo { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotCreateFolder
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("name")] public string Name { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("parent_id")] public string ParentId { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotDeleteFile
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("file_id")] public string FileId { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotDeleteFolder
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("folder_id")] public string FolderId { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotDeleteFriend
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("block")] public bool Block { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotDeleteGroupMemo
|
||||
{
|
||||
[JsonPropertyName("group_id")] public long GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("notice_id")] public string NoticeId { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotFriendPoke
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetAiCharacters
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; } = 42;
|
||||
|
||||
[JsonPropertyName("chat_type")] public uint ChatType { get; set; } = 1; //1 voice,2 song
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetAiRecord
|
||||
{
|
||||
[JsonPropertyName("character")] public string Character { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("text")] public string Text { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("chat_type")] public uint ChatType { get; set; } = 1;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetFileUrl
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("file_id")] public string FileId { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("busid")] public uint BusId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetFiles
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("folder_id")] public string? FolderId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetForwardMsg
|
||||
{
|
||||
[JsonPropertyName("id")] public string Id { get; set; } = ""; // resId
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetGroupHonorInfo
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetGroupInfo
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("no_cache")] public bool NoCache { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetGroupMemberInfo
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("no_cache")] public bool NoCache { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetGroupMemo
|
||||
{
|
||||
[JsonPropertyName("group_id")] public long GroupId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetMessage
|
||||
{
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetMusicArk
|
||||
{
|
||||
[JsonPropertyName("title")] public string Title { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("desc")] public string Desc { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("jumpUrl")] public string JumpUrl { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("musicUrl")] public string MusicUrl { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("source_icon")] public string SourceIcon { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("tag")] public string Tag { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("preview")] public string Preview { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("sourceMsgId")] public string SourceMsgId { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetPrivateFile
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("file_hash")] public string FileHash { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("file_id")] public required string FileId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetStrangerInfo
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("no_cache")] public bool NoCache { get; set; } = false;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupForward : OneBotForward
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
public class OneBotGroupJoinEmojiChain
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
|
||||
[JsonPropertyName("emoji_id")] public uint EmojiId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
[JsonConverter(typeof(OneBotMessageConverter<OneBotGroupMessageBase, OneBotGroupMessage, OneBotGroupMessageSimple, OneBotGroupMessageText>))]
|
||||
public class OneBotGroupMessageBase
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("auto_escape")] public bool? AutoEscape { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupMessage : OneBotGroupMessageBase
|
||||
{
|
||||
[JsonPropertyName("message")] public List<OneBotSegment> Messages { get; set; } = new();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupMessageSimple : OneBotGroupMessageBase
|
||||
{
|
||||
[JsonPropertyName("message")] public OneBotSegment Messages { get; set; } = new();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupMessageText : OneBotGroupMessageBase
|
||||
{
|
||||
[JsonPropertyName("message")] public string Messages { get; set; } = "";
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupPoke
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
public class OneBotHonorInfo
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("type")] public string Type { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
[JsonConverter(typeof(OneBotMessageConverter<OneBotMessageBase, OneBotMessage, OneBotMessageSimple, OneBotMessageText>))]
|
||||
public class OneBotMessageBase
|
||||
{
|
||||
[JsonPropertyName("message_type")] public string MessageType { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("user_id")] public uint? UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("group_id")] public uint? GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("auto_escape")] public bool? AutoEscape { get; set; }
|
||||
}
|
||||
|
||||
// ReSharper disable once ClassNeverInstantiated.Global
|
||||
public class OneBotMessage : OneBotMessageBase
|
||||
{
|
||||
[JsonPropertyName("message")] public List<OneBotSegment> Messages { get; set; } = new();
|
||||
}
|
||||
|
||||
// ReSharper disable once ClassNeverInstantiated.Global
|
||||
public class OneBotMessageSimple : OneBotMessageBase
|
||||
{
|
||||
[JsonPropertyName("message")] public OneBotSegment Messages { get; set; } = new();
|
||||
}
|
||||
|
||||
// ReSharper disable once ClassNeverInstantiated.Global
|
||||
public class OneBotMessageText : OneBotMessageBase
|
||||
{
|
||||
[JsonPropertyName("message")] public string Messages { get; set; } = "";
|
||||
}
|
||||
|
||||
public class OneBotMessageConverter<T, TList, TSimple, TText> : JsonConverter<T>
|
||||
{
|
||||
public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
Utf8JsonReader readerClone = reader;
|
||||
while (readerClone.Read())
|
||||
{
|
||||
if (readerClone.TokenType != JsonTokenType.PropertyName) continue;
|
||||
if (readerClone.GetString() != "message") continue;
|
||||
readerClone.Read();
|
||||
switch (readerClone.TokenType)
|
||||
{
|
||||
case JsonTokenType.StartArray:
|
||||
// List<Message>
|
||||
return (T?)JsonSerializer.Deserialize(ref reader, typeof(TList), options);
|
||||
case JsonTokenType.StartObject:
|
||||
// Message
|
||||
return (T?)JsonSerializer.Deserialize(ref reader, typeof(TSimple), options);
|
||||
case JsonTokenType.String:
|
||||
// String
|
||||
return (T?)JsonSerializer.Deserialize(ref reader, typeof(TText), options);
|
||||
default:
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception("json error");
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
|
||||
{
|
||||
// Null
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotMoveFile
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("file_id")] public string FileId { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("parent_directory")] public string ParentDirectory { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("target_directory")] public string TargetDirectory { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotOcrImage
|
||||
{
|
||||
[JsonPropertyName("image")] public string Image { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotPrivateForward : OneBotForward
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
public class OneBotPrivateJoinEmojiChain
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
|
||||
[JsonPropertyName("emoji_id")] public uint EmojiId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
[JsonConverter(typeof(OneBotMessageConverter<OneBotPrivateMessageBase, OneBotPrivateMessage, OneBotPrivateMessageSimple, OneBotPrivateMessageText>))]
|
||||
public class OneBotPrivateMessageBase
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("auto_escape")] public bool? AutoEscape { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotPrivateMessage : OneBotPrivateMessageBase
|
||||
{
|
||||
[JsonPropertyName("message")] public List<OneBotSegment> Messages { get; set; } = new();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotPrivateMessageSimple : OneBotPrivateMessageBase
|
||||
{
|
||||
[JsonPropertyName("message")] public OneBotSegment Messages { get; set; } = new();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotPrivateMessageText : OneBotPrivateMessageBase
|
||||
{
|
||||
[JsonPropertyName("message")] public string Messages { get; set; } = "";
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotRenameFolder
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("folder_id")] public string FolderId { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("new_folder_name")] public string NewFolderName { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotResult(object? data, int retCode, string status)
|
||||
{
|
||||
[JsonPropertyName("status")] public string Status { get; set; } = status;
|
||||
|
||||
[JsonPropertyName("retcode")] public int RetCode { get; set; } = retCode;
|
||||
|
||||
[JsonPropertyName("data")] public object? Data { get; set; } = data;
|
||||
|
||||
[JsonPropertyName("echo")] public object? Echo { get; set; }
|
||||
|
||||
[JsonIgnore] public string? Identifier { get; internal set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSendLike
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("times")] public uint? Times { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSendPacket
|
||||
{
|
||||
[JsonPropertyName("data")] public string Data { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("command")] public string Command { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("sign")] public bool Sign { get; set; }
|
||||
|
||||
[JsonPropertyName("type")] public byte Type { get; set; } = 12;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSendPoke
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("group_id")] public uint? GroupId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupAdmin
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("enable")] public bool Enable { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupBan
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("duration")] public uint Duration { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupBot
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("bot_id")] public uint BotId { get; set; }
|
||||
|
||||
[JsonPropertyName("enable")] public uint Enable { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupBothd
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("bot_id")] public uint BotId { get; set; }
|
||||
|
||||
[JsonPropertyName("data_1")] public string? Data_1 { get; set; }
|
||||
|
||||
[JsonPropertyName("data_2")] public string? Data_2 { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupCard
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("card")] public string Card { get; set; } = "";
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupKick
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("reject_add_request")] public bool RejectAddRequest { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupLeave
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("is_dismiss")] public bool IsDismiss { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupMemo
|
||||
{
|
||||
[JsonPropertyName("group_id")] public long GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("content")] public string Content { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("image")] public string Image { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupName
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("group_name")] public string GroupName { get; set; } = "";
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupPortrait
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("file")] public string File { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupReaction
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
|
||||
[JsonPropertyName("code")] public required string Code { get; set; }
|
||||
|
||||
[JsonPropertyName("is_add")] public bool IsAdd { get; set; } = true;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupSpecialTitle
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("special_title")] public string SpecialTitle { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("duration")] public int Duration { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupWholeBan
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("enable")] public bool Enable { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetRequest
|
||||
{
|
||||
[JsonPropertyName("flag")] public string Flag { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("approve")] public bool Approve { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("reason")] public string Reason { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotUploadGroupFile
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("file")] public string File { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("name")] public string? Name { get; set; }
|
||||
|
||||
[JsonPropertyName("folder")] public string? Folder { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotUploadPrivateFile
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("file")] public string File { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("name")] public string? Name { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotForwardResponse(int messageId, string forwardId)
|
||||
{
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; } = messageId;
|
||||
|
||||
[JsonPropertyName("forward_id")] public string ForwardId { get; set; } = forwardId;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.OneBot.Core.Entity.File;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetFilesResponse(List<OneBotFile> files, List<OneBotFolder> folders)
|
||||
{
|
||||
[JsonPropertyName("files")] public List<OneBotFile> Files { get; set; } = files;
|
||||
|
||||
[JsonPropertyName("folders")] public List<OneBotFolder> Folders { get; set; } = folders;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetForwardMsgResponse(List<OneBotSegment> message)
|
||||
{
|
||||
[JsonPropertyName("message")] public List<OneBotSegment> Message { get; set; } = message;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetMessageResponse(DateTime time, string messageType, int messageId, OneBotSender sender, List<OneBotSegment> message)
|
||||
{
|
||||
[JsonPropertyName("time")] public int Time { get; set; } = (int)(TimeZoneInfo.ConvertTimeToUtc(time, TimeZoneInfo.Local) - DateTime.UnixEpoch).TotalSeconds;
|
||||
|
||||
[JsonPropertyName("message_type")] public string MessageType { get; set; } = messageType;
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; } = messageId;
|
||||
|
||||
[JsonPropertyName("real_id")] public int RealId { get; set; } = messageId;
|
||||
|
||||
[JsonPropertyName("sender")] public OneBotSender Sender { get; set; } = sender;
|
||||
|
||||
[JsonPropertyName("message")] public List<OneBotSegment> Message { get; set; } = message;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetRkeyResponse(List<OneBotRkey> rkeys)
|
||||
{
|
||||
[JsonPropertyName("rkeys")] public List<OneBotRkey> Rkeys { get; set; } = rkeys;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotRkey
|
||||
{
|
||||
[JsonPropertyName("type")] public string? Type { get; set; }
|
||||
[JsonPropertyName("rkey")] public string? Rkey { get; set; }
|
||||
[JsonPropertyName("created_at")] public uint? CreateTime { get; set; }
|
||||
[JsonPropertyName("ttl")] public ulong? TtlSeconds { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGetStatusResponse
|
||||
{
|
||||
[JsonPropertyName("app_initialized")] public bool AppInitialized { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("app_enabled")] public bool AppEnabled { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("plugins_good")] public bool PluginsGood { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("app_good")] public bool AppGood { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("online")] public bool Online { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("good")] public bool Good { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("memory")] public long Memory { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotLoginInfoResponse(uint userId, string nickName)
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;
|
||||
|
||||
[JsonPropertyName("nickname")] public string NickName { get; set; } = nickName;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotMessageResponse(int messageId)
|
||||
{
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; } = messageId;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSendPacketResponse
|
||||
{
|
||||
[JsonPropertyName("sequence")] public int Sequence { get; set; }
|
||||
|
||||
[JsonPropertyName("result")] public string Result { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("retcode")] public int RetCode { get; set; }
|
||||
|
||||
[JsonPropertyName("extra")] public string? Extra { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSetGroupMemoResponse(string noticeId)
|
||||
{
|
||||
[JsonPropertyName("notice_id")] public string NoticeId { get; set; } = noticeId;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Action.Response;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotVersionInfoResponse(string ntProtocol)
|
||||
{
|
||||
[JsonPropertyName("app_name")] public string AppName => Constant.OneBotImpl;
|
||||
|
||||
[JsonPropertyName("app_version")] public string AppVersion => Constant.OneBotImplVersion;
|
||||
|
||||
[JsonPropertyName("protocol_version")] public string ProtocolVersion => $"v{Constant.OneBotProtocolVersion}";
|
||||
|
||||
[JsonPropertyName("nt_protocol")] public string NTProtocol { get; } = ntProtocol;
|
||||
}
|
||||
69
Lagrange.Core/Lagrange.OneBot/Core/Entity/Common/LightApp.cs
Normal file
69
Lagrange.Core/Lagrange.OneBot/Core/Entity/Common/LightApp.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.OneBot.Core.Operation.Converters;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Common;
|
||||
#pragma warning disable CS8618
|
||||
|
||||
[Serializable]
|
||||
public class LightApp
|
||||
{
|
||||
[JsonPropertyName("app")] public string App { get; set; }
|
||||
|
||||
[JsonPropertyName("config")] public Config Config { get; set; }
|
||||
|
||||
[JsonPropertyName("desc")] public string Desc { get; set; }
|
||||
|
||||
[JsonPropertyName("from")] public long From { get; set; }
|
||||
|
||||
[JsonPropertyName("meta")] [JsonConverter(typeof(NullIfEmptyConverter<Meta>))] public Meta Meta { get; set; }
|
||||
|
||||
[JsonPropertyName("extra")] [JsonConverter(typeof(NullIfEmptyConverter<Extra>))] public Extra? Extra { get; set; }
|
||||
|
||||
[JsonPropertyName("prompt")] public string Prompt { get; set; }
|
||||
|
||||
[JsonPropertyName("ver")] public string Ver { get; set; }
|
||||
|
||||
[JsonPropertyName("view")] public string View { get; set; }
|
||||
|
||||
[JsonPropertyName("bizsrc")] public string BizSrc { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Config
|
||||
{
|
||||
[JsonPropertyName("autosize")] public bool Autosize { get; set; }
|
||||
|
||||
[JsonPropertyName("ctime")] public long Ctime { get; set; }
|
||||
|
||||
[JsonPropertyName("token")] public string Token { get; set; }
|
||||
|
||||
[JsonPropertyName("type")] public string Type { get; set; }
|
||||
|
||||
[JsonPropertyName("forward")] public int Forward { get; set; }
|
||||
|
||||
[JsonPropertyName("height")] public int Height { get; set; }
|
||||
|
||||
[JsonPropertyName("width")] public int Width { get; set; }
|
||||
|
||||
[JsonPropertyName("showsender")] public int ShowSender { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Meta
|
||||
{
|
||||
[JsonPropertyName("Location.Search")] public LocationSearch LocationSearch { get; set; }
|
||||
|
||||
[JsonPropertyName("pic")] public Pic Pic { get; set; }
|
||||
|
||||
[JsonPropertyName("music")] public Music Music { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Extra
|
||||
{
|
||||
[JsonPropertyName("app_type")] public int AppType { get; set; }
|
||||
|
||||
[JsonPropertyName("appid")] public int AppId { get; set; }
|
||||
|
||||
[JsonPropertyName("uin")] public uint Uin { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Common;
|
||||
#pragma warning disable CS8618
|
||||
|
||||
[Serializable]
|
||||
public class LocationSearch
|
||||
{
|
||||
[JsonPropertyName("address")] public string Address { get; set; }
|
||||
|
||||
[JsonPropertyName("enum_relation_type")] public long EnumRelationType { get; set; }
|
||||
|
||||
[JsonPropertyName("from")] public string From { get; set; }
|
||||
|
||||
[JsonPropertyName("id")] public string Id { get; set; }
|
||||
|
||||
[JsonPropertyName("lat")] public string Lat { get; set; }
|
||||
|
||||
[JsonPropertyName("lng")] public string Lng { get; set; }
|
||||
|
||||
[JsonPropertyName("name")] public string Name { get; set; }
|
||||
}
|
||||
38
Lagrange.Core/Lagrange.OneBot/Core/Entity/Common/Music.cs
Normal file
38
Lagrange.Core/Lagrange.OneBot/Core/Entity/Common/Music.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Common;
|
||||
#pragma warning disable CS8618
|
||||
|
||||
[Serializable]
|
||||
public class Music
|
||||
{
|
||||
[JsonPropertyName("action")] public string Action { get; set; }
|
||||
|
||||
[JsonPropertyName("android_pkg_name")] public string AndroidPkgName { get; set; }
|
||||
|
||||
[JsonPropertyName("app_type")] public int AppType { get; set; }
|
||||
|
||||
[JsonPropertyName("appid")] public int AppId { get; set; }
|
||||
|
||||
[JsonPropertyName("ctime")] public int Ctime { get; set; }
|
||||
|
||||
[JsonPropertyName("desc")] public string Desc { get; set; }
|
||||
|
||||
[JsonPropertyName("jumpUrl")] public string JumpUrl { get; set; }
|
||||
|
||||
[JsonPropertyName("musicUrl")] public string MusicUrl { get; set; }
|
||||
|
||||
[JsonPropertyName("preview")] public string Preview { get; set; }
|
||||
|
||||
[JsonPropertyName("sourceMsgId")] public string SourceMsgId { get; set; }
|
||||
|
||||
[JsonPropertyName("source_icon")] public string SourceIcon { get; set; }
|
||||
|
||||
[JsonPropertyName("source_url")] public string SourceUrl { get; set; }
|
||||
|
||||
[JsonPropertyName("tag")] public string Tag { get; set; }
|
||||
|
||||
[JsonPropertyName("title")] public string Title { get; set; }
|
||||
|
||||
[JsonPropertyName("uin")] public uint Uin { get; set; }
|
||||
}
|
||||
20
Lagrange.Core/Lagrange.OneBot/Core/Entity/Common/Pic.cs
Normal file
20
Lagrange.Core/Lagrange.OneBot/Core/Entity/Common/Pic.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Common;
|
||||
#pragma warning disable CS8618
|
||||
|
||||
[Serializable]
|
||||
public class Pic
|
||||
{
|
||||
[JsonPropertyName("back")] public bool Back { get; set; }
|
||||
|
||||
[JsonPropertyName("desc")] public string Desc { get; set; }
|
||||
|
||||
[JsonPropertyName("jumpUrl")] public string JumpUrl { get; set; }
|
||||
|
||||
[JsonPropertyName("preview")] public string Preview { get; set; }
|
||||
|
||||
[JsonPropertyName("tag")] public string Tag { get; set; }
|
||||
|
||||
[JsonPropertyName("title")] public string Title { get; set; }
|
||||
}
|
||||
29
Lagrange.Core/Lagrange.OneBot/Core/Entity/File/OneBotFile.cs
Normal file
29
Lagrange.Core/Lagrange.OneBot/Core/Entity/File/OneBotFile.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.File;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotFile
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("file_id")] public string FileId { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("file_name")] public string FileName { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("busid")] public int BusId { get; set; }
|
||||
|
||||
[JsonPropertyName("file_size")] public ulong FileSize { get; set; }
|
||||
|
||||
[JsonPropertyName("upload_time")] public uint UploadTime { get; set; }
|
||||
|
||||
[JsonPropertyName("dead_time")] public uint DeadTime { get; set; }
|
||||
|
||||
[JsonPropertyName("modify_time")] public uint ModifyTime { get; set; }
|
||||
|
||||
[JsonPropertyName("download_times")] public uint DownloadTimes { get; set; }
|
||||
|
||||
[JsonPropertyName("uploader")] public uint Uploader { get; set; }
|
||||
|
||||
[JsonPropertyName("uploader_name")] public string UploaderName { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.File;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotFolder
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("folder_id")] public string FolderId { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("folder_name")] public string FolderName { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("create_time")] public uint CreateTime { get; set; }
|
||||
|
||||
[JsonPropertyName("creator")] public uint Creator { get; set; }
|
||||
|
||||
[JsonPropertyName("create_name")] public string CreatorName { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("total_file_count")] public uint TotalFileCount { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotEssenceMessage
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotEssenceMessageSegment
|
||||
{
|
||||
[JsonPropertyName("sender_id")] public uint SenderId { get; set; }
|
||||
|
||||
[JsonPropertyName("sender_nick")] public string SenderNick { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("sender_time")] public uint SenderTime { get; set; }
|
||||
|
||||
[JsonPropertyName("operator_id")] public uint OperatorId { get; set; }
|
||||
|
||||
[JsonPropertyName("operator_nick")] public string OperatorNick { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("operator_time")] public uint OperatorTime { get; set; }
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
|
||||
[JsonPropertyName("content")] public List<OneBotSegment> Content { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotForward
|
||||
{
|
||||
[JsonPropertyName("messages")] public List<OneBotSegment> Messages { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotFriendMsgHistory
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
|
||||
[JsonPropertyName("count")] public uint Count { get; set; } = 20;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotFriendMsgHistoryResponse(List<object> messages)
|
||||
{
|
||||
[JsonPropertyName("messages")] public List<object> Messages { get; set; } = messages;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.Core.Common.Entity;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupMsg(uint selfId, uint groupUin, List<OneBotSegment> message, string rawMessage, BotGroupMember member, int messageId, long time) : OneBotEntityBase(selfId, "message", time)
|
||||
{
|
||||
[JsonPropertyName("message_type")] public string MessageType { get; set; } = "group";
|
||||
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; set; } = "normal";
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; } = messageId;
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; } = groupUin;
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; } = member.Uin;
|
||||
|
||||
[JsonPropertyName("anonymous")] public object? Anonymous { get; set; } = null;
|
||||
|
||||
[JsonPropertyName("message")] public List<OneBotSegment> Message { get; set; } = message;
|
||||
|
||||
[JsonPropertyName("raw_message")] public string RawMessage { get; set; } = rawMessage;
|
||||
|
||||
[JsonPropertyName("font")] public int Font { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("sender")] public OneBotGroupSender GroupSender { get; set; } = new(member.Uin, member.MemberName, member.MemberCard ?? string.Empty, (int)member.GroupLevel, member.Permission);
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupStringMsg(uint selfId, uint groupUin, string message, BotGroupMember member, int messageId, long time) : OneBotEntityBase(selfId, "message", time)
|
||||
{
|
||||
[JsonPropertyName("message_type")] public string MessageType { get; set; } = "group";
|
||||
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; set; } = "normal";
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; } = messageId;
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; } = groupUin;
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; } = member.Uin;
|
||||
|
||||
[JsonPropertyName("anonymous")] public object? Anonymous { get; set; } = null;
|
||||
|
||||
[JsonPropertyName("message")] public string Message { get; set; } = message;
|
||||
|
||||
[JsonPropertyName("raw_message")] public string RawMessage { get; set; } = message;
|
||||
|
||||
[JsonPropertyName("font")] public int Font { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("sender")] public OneBotGroupSender GroupSender { get; set; } = new(member.Uin, member.MemberName, member.MemberCard ?? string.Empty, (int)member.GroupLevel, member.Permission);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupMsgHistory
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
|
||||
[JsonPropertyName("count")] public int Count { get; set; } = 20;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupMsgHistoryResponse(List<object> messages)
|
||||
{
|
||||
[JsonPropertyName("messages")] public List<object> Messages { get; set; } = messages;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.Core.Common.Entity;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupSender(uint userId, string nickname, string card, int level, GroupMemberPermission permission)
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;
|
||||
|
||||
[JsonPropertyName("nickname")] public string Nickname { get; set; } = nickname;
|
||||
|
||||
[JsonPropertyName("card")] public string Card { get; set; } = card;
|
||||
|
||||
[JsonPropertyName("sex")] public string Sex { get; set; } = "unknown";
|
||||
|
||||
[JsonPropertyName("age")] public uint Age { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("area")] public string Area { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("level")] public string Level { get; set; } = level.ToString();
|
||||
|
||||
[JsonPropertyName("role")] public string Role { get; set; } = permission switch
|
||||
{
|
||||
GroupMemberPermission.Owner => "owner",
|
||||
GroupMemberPermission.Admin => "admin",
|
||||
GroupMemberPermission.Member => "member",
|
||||
_ => "unknown"
|
||||
};
|
||||
|
||||
[JsonPropertyName("title")] public string Title { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.Core.Message;
|
||||
using Lagrange.OneBot.Message;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotNode(string userId, string nickName, List<OneBotSegment> content) : SegmentBase
|
||||
{
|
||||
[JsonPropertyName("user_id")] public string UserId { get; set; } = userId;
|
||||
|
||||
[JsonPropertyName("nickname")] public string NickName { get; set; } = nickName;
|
||||
|
||||
[JsonPropertyName("content")] public List<OneBotSegment> Content { get; set; } = content;
|
||||
|
||||
public IMessageEntity ToEntity() => throw new NotImplementedException();
|
||||
|
||||
public override void Build(MessageBuilder builder, SegmentBase segment) => throw new NotImplementedException();
|
||||
|
||||
public override SegmentBase FromEntity(MessageChain chain, IMessageEntity entity) => throw new NotImplementedException();
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotPrivateMsg(uint selfId, OneBotSender groupSender, string subType, long time) : OneBotEntityBase(selfId, "message", time)
|
||||
{
|
||||
[JsonPropertyName("message_type")] public string MessageType { get; set; } = "private";
|
||||
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; set; } = subType;
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("message")] public List<OneBotSegment> Message { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("raw_message")] public string RawMessage { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("font")] public int Font { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("sender")] public OneBotSender GroupSender { get; set; } = groupSender;
|
||||
|
||||
[JsonPropertyName("target_id")] public uint TargetId { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotPrivateStringMsg(uint selfId, OneBotSender groupSender, string subType, long time) : OneBotEntityBase(selfId, "message", time)
|
||||
{
|
||||
[JsonPropertyName("message_type")] public string MessageType { get; set; } = "private";
|
||||
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; set; } = subType;
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("message")] public string Message { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("raw_message")] public string RawMessage { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("font")] public int Font { get; set; } = 0;
|
||||
|
||||
[JsonPropertyName("sender")] public OneBotSender GroupSender { get; set; } = groupSender;
|
||||
|
||||
[JsonPropertyName("target_id")] public uint TargetId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Lagrange.OneBot.Message;
|
||||
using Lagrange.OneBot.Message.Entity;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
public class OneBotSegment(string type, SegmentBase data)
|
||||
{
|
||||
public OneBotSegment() : this("", new TextSegment()) { }
|
||||
|
||||
[JsonPropertyName("type")] public string Type { get; set; } = type;
|
||||
|
||||
[JsonPropertyName("data")] public object Data { get; set; } = data;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Message;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotSender(uint userId, string nickName)
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;
|
||||
|
||||
[JsonPropertyName("nickname")] public string NickName { get; set; } = nickName;
|
||||
|
||||
[JsonPropertyName("sex")] public string Sex { get; set; } = "unknown";
|
||||
|
||||
[JsonPropertyName("age")] public int Age = -1;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Meta;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotHeartBeat(uint selfId, int interval, object status) : OneBotMeta(selfId, "heartbeat")
|
||||
{
|
||||
[JsonPropertyName("interval")] public int Interval { get; set; } = interval;
|
||||
|
||||
[JsonPropertyName("status")] public object Status { get; set; } = status;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Meta;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotLifecycle(uint selfId, string subType) : OneBotMeta(selfId, "lifecycle")
|
||||
{
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; set; } = subType;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Meta;
|
||||
|
||||
[Serializable]
|
||||
public abstract class OneBotMeta(uint selfId, string metaEventType) : OneBotEntityBase(selfId, "meta_event")
|
||||
{
|
||||
[JsonPropertyName("meta_event_type")] public string MetaEventType { get; set; } = metaEventType;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Meta;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotStatus(bool online, bool good)
|
||||
{
|
||||
[JsonPropertyName("app_initialized")] public bool AppInitialized { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("app_enabled")] public bool AppEnabled { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("app_good")] public bool AppGood { get; set; } = true;
|
||||
|
||||
[JsonPropertyName("online")] public bool Online { get; set; } = online;
|
||||
|
||||
[JsonPropertyName("good")] public bool Good { get; set; } = good;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotBotOffline(uint selfId, string tag, string message) : OneBotNotify(selfId, "bot_offline")
|
||||
{
|
||||
[JsonPropertyName("tag")] public string Tag { get; } = tag;
|
||||
|
||||
[JsonPropertyName("message")] public string Message { get; } = message;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using static Lagrange.Core.Event.EventArg.BotOnlineEvent;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotBotOnline(uint selfId, OnlineReason reason) : OneBotNotify(selfId, "bot_online")
|
||||
{
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
[JsonPropertyName("reason")]
|
||||
public OnlineReason Reason { get; } = reason;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotFriendPoke(uint selfId) : OneBotNotify(selfId, "notify")
|
||||
{
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; set; } = "poke";
|
||||
|
||||
[JsonPropertyName("sender_id")] public uint SenderId { get; set; }
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("target_id")] public uint TargetId { get; set; }
|
||||
|
||||
[JsonPropertyName("action")] public string Action { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("suffix")] public string Suffix { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("action_img_url")] public string ActionImgUrl { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotFriendRecall(uint selfId) : OneBotNotify(selfId, "friend_recall")
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
|
||||
[JsonPropertyName("tip")] public string Tip { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotFriendRequest(uint selfId, uint userId, string comment, string flag) :
|
||||
OneBotRequest(selfId, "friend", comment, flag)
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotFriendRequestNotice(uint selfId, uint userId) : OneBotNotify(selfId, "friend_add")
|
||||
{
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupAdmin(uint selfId, string subType, uint groupId, uint userId) : OneBotNotify(selfId, "group_admin")
|
||||
{
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; set; } = subType;
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; } = groupId;
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupEssence(uint selfId) : OneBotNotify(selfId, "essence")
|
||||
{
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("sender_id")] public uint SenderId { get; set; }
|
||||
|
||||
[JsonPropertyName("operator_id")] public uint OperatorId { get; set; }
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupFile(uint selfId, uint groupId, uint userId, OneBotFileInfo fileInfo) : OneBotNotify(selfId, "group_upload")
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; } = groupId;
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;
|
||||
|
||||
[JsonPropertyName("file")] public OneBotFileInfo Info { get; set; } = fileInfo;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class OneBotFileInfo(string id, string name, ulong size, string url)
|
||||
{
|
||||
[JsonPropertyName("id")] public string Id { get; set; } = id;
|
||||
|
||||
[JsonPropertyName("name")] public string Name { get; set; } = name;
|
||||
|
||||
[JsonPropertyName("size")] public ulong Size { get; set; } = size;
|
||||
|
||||
[JsonPropertyName("busid")] public uint BusId { get; set; }
|
||||
|
||||
[JsonPropertyName("url")] public string Url { get; set; } = url;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupMute(uint selfId, string subType, uint groupId, uint operatorId, uint userId, long duration)
|
||||
: OneBotNotify(selfId, "group_ban")
|
||||
{
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; set; } = subType;
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; } = groupId;
|
||||
|
||||
[JsonPropertyName("operator_id")] public uint OperatorId { get; set; } = operatorId;
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;
|
||||
|
||||
[JsonPropertyName("duration")] public long Duration { get; set; } = duration;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupNameChange(uint selfId, uint groupId, string name) : OneBotNotify(selfId, "group_name_change")
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; } = groupId;
|
||||
|
||||
[JsonPropertyName("name")] public string Name { get; } = name;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupPoke(uint selfId) : OneBotNotify(selfId, "notify")
|
||||
{
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; set; } = "poke";
|
||||
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("target_id")] public uint TargetId { get; set; }
|
||||
|
||||
[JsonPropertyName("action")] public string Action { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("suffix")] public string Suffix { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("action_img_url")] public string ActionImgUrl { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupReaction(uint selfId, uint groupId, int messageId, uint operatorId, string subType, string code, uint count)
|
||||
: OneBotNotify(selfId, "reaction")
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; } = groupId;
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; } = messageId;
|
||||
|
||||
[JsonPropertyName("operator_id")] public uint OperatorId { get; } = operatorId;
|
||||
|
||||
[JsonPropertyName("sub_type")] public string SubType { get; } = subType;
|
||||
|
||||
[JsonPropertyName("code")] public string Code { get; } = code;
|
||||
|
||||
|
||||
[JsonPropertyName("count")] public uint Count { get; } = count;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Lagrange.OneBot.Core.Entity.Notify;
|
||||
|
||||
[Serializable]
|
||||
public class OneBotGroupRecall(uint selfId) : OneBotNotify(selfId, "group_recall")
|
||||
{
|
||||
[JsonPropertyName("group_id")] public uint GroupId { get; set; }
|
||||
|
||||
[JsonPropertyName("user_id")] public uint UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("message_id")] public int MessageId { get; set; }
|
||||
|
||||
[JsonPropertyName("operator_id")] public uint OperatorId { get; set; }
|
||||
|
||||
[JsonPropertyName("tip")] public string Tip { get; set; } = string.Empty;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user