-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forum, GroupChannel, UserChannel events
- Loading branch information
Showing
21 changed files
with
1,100 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace QQBot; | ||
|
||
/// <summary> | ||
/// 表示一个通用的论坛主题评论。 | ||
/// </summary> | ||
public interface IPost : IEntity<string> | ||
{ | ||
/// <summary> | ||
/// 获取此主题评论所属的频道。 | ||
/// </summary> | ||
IGuild Guild { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论所属的论坛子频道。 | ||
/// </summary> | ||
IForumChannel Channel { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论的作者用户的 ID。 | ||
/// </summary> | ||
ulong AuthorId { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论所属的主题的 ID。 | ||
/// </summary> | ||
string ThreadId { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题的原始内容。 | ||
/// </summary> | ||
string RawContent { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论的富文本内容。 | ||
/// </summary> | ||
RichText Content { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论的创建时间。 | ||
/// </summary> | ||
DateTimeOffset CreatedAt { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
namespace QQBot; | ||
|
||
/// <summary> | ||
/// 表示一个通用的论坛主题评论回复。 | ||
/// </summary> | ||
public interface IReply : IEntity<string> | ||
{ | ||
/// <summary> | ||
/// 获取此主题评论回复所属的频道。 | ||
/// </summary> | ||
IGuild Guild { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论回复所属的论坛子频道。 | ||
/// </summary> | ||
IForumChannel Channel { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论回复的作者用户的 ID。 | ||
/// </summary> | ||
ulong AuthorId { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论回复所属的主题的 ID。 | ||
/// </summary> | ||
string ThreadId { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论回复所属的主题评论的 ID。 | ||
/// </summary> | ||
string PostId { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题的原始内容。 | ||
/// </summary> | ||
string RawContent { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论回复的富文本内容。 | ||
/// </summary> | ||
RichText Content { get; } | ||
|
||
/// <summary> | ||
/// 获取此主题评论回复的创建时间。 | ||
/// </summary> | ||
DateTimeOffset CreatedAt { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace QQBot.API; | ||
|
||
internal class PostInfo | ||
{ | ||
[JsonPropertyName("thread_id")] | ||
public required string ThreadId { get; init; } | ||
|
||
[JsonPropertyName("post_id")] | ||
public required string PostId { get; init; } | ||
|
||
[JsonPropertyName("content")] | ||
public required string Content { get; init; } | ||
|
||
[JsonPropertyName("date_time")] | ||
public required DateTimeOffset DateTime { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace QQBot.API; | ||
|
||
internal class ReplyInfo | ||
{ | ||
[JsonPropertyName("thread_id")] | ||
public required string ThreadId { get; init; } | ||
|
||
[JsonPropertyName("post_id")] | ||
public required string PostId { get; init; } | ||
|
||
[JsonPropertyName("reply_id")] | ||
public required string ReplyId { get; init; } | ||
|
||
[JsonPropertyName("content")] | ||
public required string Content { get; init; } | ||
|
||
[JsonPropertyName("date_time")] | ||
public required DateTimeOffset DateTime { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace QQBot.API.Gateway; | ||
|
||
internal enum AuditType | ||
{ | ||
Thread = 1, | ||
Post = 2, | ||
Reply = 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace QQBot.API.Gateway; | ||
|
||
internal class ForumPostEvent | ||
{ | ||
[JsonPropertyName("guild_id")] | ||
public required ulong GuildId { get; init; } | ||
|
||
[JsonPropertyName("channel_id")] | ||
public required ulong ChannelId { get; init; } | ||
|
||
[JsonPropertyName("author_id")] | ||
public required ulong AuthorId { get; init; } | ||
|
||
[JsonPropertyName("post_info")] | ||
public required PostInfo PostInfo { get; set; } | ||
} |
35 changes: 35 additions & 0 deletions
35
src/QQBot.Net.WebSocket/API/Gateway/ForumPublishAuditResultEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Text.Json.Serialization; | ||
using QQBot.Net.Converters; | ||
|
||
namespace QQBot.API.Gateway; | ||
|
||
internal class ForumPublishAuditResultEvent | ||
{ | ||
[JsonPropertyName("guild_id")] | ||
public required ulong GuildId { get; init; } | ||
|
||
[JsonPropertyName("channel_id")] | ||
public required ulong ChannelId { get; init; } | ||
|
||
[JsonPropertyName("author_id")] | ||
public required ulong AuthorId { get; init; } | ||
|
||
[JsonPropertyName("thread_id")] | ||
public required string? ThreadId { get; init; } | ||
|
||
[JsonPropertyName("post_id")] | ||
public required string? PostId { get; init; } | ||
|
||
[JsonPropertyName("reply_id")] | ||
public required string? ReplyId { get; init; } | ||
|
||
[JsonPropertyName("type")] | ||
public AuditType AuditType { get; init; } | ||
|
||
[JsonPropertyName("result")] | ||
[NumberBooleanConverter] | ||
public bool Failed { get; init; } | ||
|
||
[JsonPropertyName("err_msg")] | ||
public string? ErrorMessage { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace QQBot.API.Gateway; | ||
|
||
internal class ForumReplyEvent | ||
{ | ||
[JsonPropertyName("guild_id")] | ||
public required ulong GuildId { get; init; } | ||
|
||
[JsonPropertyName("channel_id")] | ||
public required ulong ChannelId { get; init; } | ||
|
||
[JsonPropertyName("author_id")] | ||
public required ulong AuthorId { get; init; } | ||
|
||
[JsonPropertyName("reply_info")] | ||
public required ReplyInfo ReplyInfo { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace QQBot.API.Gateway; | ||
|
||
internal class ForumThreadEvent | ||
{ | ||
[JsonPropertyName("guild_id")] | ||
public required ulong GuildId { get; init; } | ||
|
||
[JsonPropertyName("channel_id")] | ||
public required ulong ChannelId { get; init; } | ||
|
||
[JsonPropertyName("author_id")] | ||
public required ulong AuthorId { get; init; } | ||
|
||
[JsonPropertyName("thread_info")] | ||
public required ThreadInfo ThreadInfo { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace QQBot.API.Gateway; | ||
|
||
internal class GroupBotEvent | ||
{ | ||
[JsonPropertyName("group_openid")] | ||
public required Guid GroupOpenid { get; init; } | ||
|
||
[JsonPropertyName("op_member_openid")] | ||
public required string OpMemberOpenId { get; init; } | ||
|
||
[JsonPropertyName("timestamp")] | ||
public required int Timestamp { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace QQBot.API.Gateway; | ||
|
||
internal class UserBotEvent | ||
{ | ||
[JsonPropertyName("openid")] | ||
public required Guid OpenId { get; init; } | ||
|
||
[JsonPropertyName("timestamp")] | ||
public required int Timestamp { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.