submodule对gitea不管用,所以直接拉了一份拉格兰

This commit is contained in:
2025-02-04 16:29:43 +08:00
parent b0bfc803e3
commit d149a2ea0f
1023 changed files with 43308 additions and 18 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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; }
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
namespace Lagrange.OneBot.Core.Entity.Notify;
[Serializable]
public class OneBotGroupRequest(uint selfId, uint userId, uint groupId, string subType, string? comment, string flag)
: OneBotRequest(selfId, "group", comment, flag)
{
[JsonPropertyName("sub_type")] public string SubType { get; set; } = subType;
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;
[JsonPropertyName("group_id")] public uint GroupId { get; set; } = groupId;
[JsonPropertyName("invitor_id")] public uint InvitorId { get; set; }
}

View File

@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
namespace Lagrange.OneBot.Core.Entity.Notify;
[Serializable]
public class OneBotMemberDecrease(uint selfId, string subType, uint groupId, uint operatorId, uint userId)
: OneBotNotify(selfId, "group_decrease")
{
[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;
}

View File

@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;
namespace Lagrange.OneBot.Core.Entity.Notify;
[Serializable]
public class OneBotMemberIncrease(uint selfId, string subType, uint groupId, uint operatorId, uint userId)
: OneBotNotify(selfId, "group_increase")
{
[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;
}

View File

@@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Lagrange.OneBot.Core.Entity.Notify;
[Serializable]
public abstract class OneBotNotify(uint selfId, string noticeType) : OneBotEntityBase(selfId, "notice")
{
[JsonPropertyName("notice_type")] public string NoticeType { get; set; } = noticeType;
}

View File

@@ -0,0 +1,28 @@
using System.Text.Json.Serialization;
namespace Lagrange.OneBot.Core.Entity.Notify;
[Serializable]
public class OneBotPrivateFile(uint selfId, uint userId, OneBotPrivateFileInfo fileInfo) : OneBotNotify(selfId, "offline_file")
{
[JsonPropertyName("user_id")] public uint UserId { get; set; } = userId;
[JsonPropertyName("file")] public OneBotPrivateFileInfo Info { get; set; } = fileInfo;
}
[Serializable]
public class OneBotPrivateFileInfo(string id, string name, ulong size, string url, string hash)
{
[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("url")] public string Url { get; set; } = url;
[JsonPropertyName("hash")] public string FileHash { get; set; } = hash;
}

View File

@@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
namespace Lagrange.OneBot.Core.Entity.Notify;
[Serializable]
public class OneBotRequest(uint selfId, string requestType, string? comment, string flag) : OneBotEntityBase(selfId, "request")
{
[JsonPropertyName("request_type")] public string RequestType { get; set; } = requestType;
[JsonPropertyName("comment")] public string? Comment { get; set; } = comment;
[JsonPropertyName("flag")] public string Flag { get; set; } = flag;
}