submodule对gitea不管用,所以直接拉了一份拉格兰
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user