Skip to content

论坛模型

来源文件:

相关类型: Rich Text 模型AuditTypeRichTextRichObject


Format (字面量别名)

帖子内容格式(Literal[1, 2, 3, 4])。

取值语义说明
1普通文本
2HTML
3Markdown
4JSON

ThreadInfo

帖子信息结构。

变量名称变量类型语义说明
thread_idstr帖子 ID
titlestr帖子标题
contentstr帖子内容
date_timestr发布时间

Thread (帖子)

帖子数据结构。

变量名称变量类型语义说明
guild_idstr频道 ID
channel_idstr子频道 ID
author_idstr作者 ID
thread_infoThreadInfo帖子信息

PostInfo

评论信息结构。

变量名称变量类型语义说明
thread_idstr所属帖子 ID
post_idstr评论 ID
contentstr评论内容
date_timestr发布时间

Post (评论)

评论数据结构。

变量名称变量类型语义说明
guild_idstr频道 ID
channel_idstr子频道 ID
author_idstr作者 ID
post_infoPostInfo评论信息

ReplyInfo

回复信息结构。

变量名称变量类型语义说明
thread_idstr所属帖子 ID
post_idstr所属评论 ID
reply_idstr回复 ID
contentstr回复内容
date_timestr发布时间

Reply (回复)

回复数据结构。

变量名称变量类型语义说明
guild_idstr频道 ID
channel_idstr子频道 ID
author_idstr作者 ID
reply_infoReplyInfo回复信息

AuditResult

论坛内容发布审核结果。type 字段取值见 AuditType

变量名称变量类型语义说明
guild_idstr频道 ID
channel_idstr子频道 ID
author_idstr作者 ID
thread_idstr帖子 ID
post_idstr评论 ID
reply_idstr回复 ID
typeAuditType审核类型(1=帖子,2=评论,3=回复)
resultint审核结果(0=通过,1=不通过,2=忽略)
err_msgstr错误信息

ForumRsp

论坛帖子列表响应。

变量名称变量类型语义说明
threadsList[Thread]帖子列表
is_finishint是否已获取完成(0=未完成,1=已完成)

PostThreadRsp

发布帖子响应。

变量名称变量类型语义说明
task_idstr任务 ID
create_timestr创建时间

OpenForumEvent

开放论坛事件数据结构。

变量名称变量类型语义说明
guild_idstr频道 ID
channel_idstr子频道 ID
author_idstr作者 ID

Thread (领域模型)

帖子领域模型,通过 on_forum_thread_create / on_forum_thread_update / on_forum_thread_delete 事件回调接收,是对 Thread 数据结构的封装。

变量名称变量类型语义说明
_apiBotAPIBotAPI 实例,用于调用 API 方法
thread_infoThread._ThreadInfo帖子信息(嵌套对象)
channel_idstr子频道 ID
guild_idstr频道 ID
author_idstr作者 ID
event_idstr事件 ID

Thread._ThreadInfo

帖子信息对象,标题与内容以富文本段落结构保存。

变量名称变量类型语义说明
titleThread._Title帖子标题(富文本段落结构)
contentThread._Content帖子内容(富文本段落结构)
thread_idstr帖子 ID
date_timestr发布时间

Thread._Title

标题富文本结构。

变量名称变量类型语义说明
paragraphsList[Thread._Paragraphs]段落列表

Thread._Content

内容富文本结构。

变量名称变量类型语义说明
paragraphsList[Thread._Paragraphs]段落列表

Thread._Paragraphs

富文本段落,每个段落由元素列表与段落属性组成。

变量名称变量类型语义说明
elemsList[Thread._Elems]元素列表
props待确认段落属性,直接透传原始数据

Thread._Elems

富文本元素,根据 type 区分具体元素类型。

变量名称变量类型语义说明
typeint元素类型(1=文本,2=图片,3=视频,4=URL)
text_Text文本元素(type=1 时有效)
image_Image图片元素(type=2 时有效)
video_Video视频元素(type=3 时有效)
url_UrlURL 元素(type=4 时有效)

元素对象 _Text(含 text)、_Image(含 plat_image,其内部 _PlatImageurl/width/height/image_id)、_Video(含 plat_video,其内部 _PlatVideourl/width/height/video_id/cover)、_Url(含 url/desc),均为模块级私有类,字段类型待确认。


OpenThread (领域模型)

开放论坛事件使用的领域模型,通过 on_open_forum_thread_create 等事件回调接收。构造函数仅接收 (api, data)__init__ 中未初始化部分已声明的 __slots__ 变量。

变量名称变量类型语义说明
_apiBotAPIBotAPI 实例,用于调用 API 方法
thread_info待确认帖子信息,已在 __slots__ 中声明但当前实现未初始化
channel_idstr子频道 ID
guild_idstr频道 ID
author_idstr作者 ID
event_id待确认事件 ID,已在 __slots__ 中声明但当前实现未初始化