diff --git a/.changelog/v4.0.0-beta6.md b/.changelog/v4.0.0-beta6.md new file mode 100644 index 00000000..df4c417c --- /dev/null +++ b/.changelog/v4.0.0-beta6.md @@ -0,0 +1,12 @@ +> 对应核心版本: [**v4.1.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.1.0) + + +我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), +感谢您的贡献与支持! + +也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! + +> [!warning] +> 此版本增加、修改了不少东西,可能会产生不兼容或者任何未知问题, +> 十分欢迎积极地[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), +> 非常感谢~ diff --git a/.changelog/v4.0.0-dev1.md b/.changelog/v4.0.0-dev1.md deleted file mode 100644 index 639b35a9..00000000 --- a/.changelog/v4.0.0-dev1.md +++ /dev/null @@ -1,11 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev2**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev2) - - -> [!warning] -> **目前版本处于 `dev` 阶段,代表此版本是一个开发预览版,可能不稳定、可能随时发生更改、且不保证可用性。** - - -我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), -感谢您的贡献与支持! - -也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! diff --git a/.changelog/v4.0.0-dev2.md b/.changelog/v4.0.0-dev2.md deleted file mode 100644 index 4dc01f77..00000000 --- a/.changelog/v4.0.0-dev2.md +++ /dev/null @@ -1,11 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev4**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev4) - - -> [!warning] -> **目前版本处于 `dev` 阶段,代表此版本是一个开发预览版,可能不稳定、可能随时发生更改、且不保证可用性。** - - -我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), -感谢您的贡献与支持! - -也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! diff --git a/.changelog/v4.0.0-dev3.md b/.changelog/v4.0.0-dev3.md deleted file mode 100644 index da50602d..00000000 --- a/.changelog/v4.0.0-dev3.md +++ /dev/null @@ -1,11 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev6**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev6) - - -> [!warning] -> **目前版本处于 `dev` 阶段,代表此版本是一个开发预览版,可能不稳定、可能随时发生更改、且不保证可用性。** - - -我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), -感谢您的贡献与支持! - -也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! diff --git a/.changelog/v4.0.0-dev4.md b/.changelog/v4.0.0-dev4.md deleted file mode 100644 index 585a55c7..00000000 --- a/.changelog/v4.0.0-dev4.md +++ /dev/null @@ -1,11 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev11**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev11) - - -> [!warning] -> **目前版本处于 `dev` 阶段,代表此版本是一个开发预览版,可能不稳定、可能随时发生更改、且不保证可用性。** - - -我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), -感谢您的贡献与支持! - -也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! diff --git a/.changelog/v4.0.0-dev5.md b/.changelog/v4.0.0-dev5.md deleted file mode 100644 index 7b688fcd..00000000 --- a/.changelog/v4.0.0-dev5.md +++ /dev/null @@ -1,11 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev13**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev13) - - -> [!warning] -> **目前版本处于 `dev` 阶段,代表此版本是一个开发预览版,可能不稳定、可能随时发生更改、且不保证可用性。** - - -我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), -感谢您的贡献与支持! - -也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! diff --git a/.changelog/v4.0.0-dev6.md b/.changelog/v4.0.0-dev6.md deleted file mode 100644 index 74435d6d..00000000 --- a/.changelog/v4.0.0-dev6.md +++ /dev/null @@ -1,11 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev14**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev14) - - -> [!warning] -> **目前版本处于 `dev` 阶段,代表此版本是一个开发预览版,可能不稳定、可能随时发生更改、且不保证可用性。** - - -我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), -感谢您的贡献与支持! - -也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! diff --git a/.changelog/v4.0.0-dev7.md b/.changelog/v4.0.0-dev7.md deleted file mode 100644 index 1d88140f..00000000 --- a/.changelog/v4.0.0-dev7.md +++ /dev/null @@ -1,11 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev15**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev15) - - -> [!warning] -> **目前版本处于 `dev` 阶段,代表此版本是一个开发预览版,可能不稳定、可能随时发生更改、且不保证可用性。** - - -我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), -感谢您的贡献与支持! - -也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! diff --git a/.changelog/v4.0.0-dev8.md b/.changelog/v4.0.0-dev8.md deleted file mode 100644 index 68bd4eb5..00000000 --- a/.changelog/v4.0.0-dev8.md +++ /dev/null @@ -1,11 +0,0 @@ -> 对应核心版本: [**v4.0.0-dev18**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.0-dev18) - - -> [!warning] -> **目前版本处于 `dev` 阶段,代表此版本是一个开发预览版,可能不稳定、可能随时发生更改、且不保证可用性。** - - -我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-qq-guild/issues)或[协助](https://github.com/simple-robot/simbot-component-qq-guild/pulls), -感谢您的贡献与支持! - -也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! diff --git a/.github/workflows/deploy-v4-website.yml b/.github/workflows/deploy-v4-website.yml index 9a05dcba..0a3507c0 100644 --- a/.github/workflows/deploy-v4-website.yml +++ b/.github/workflows/deploy-v4-website.yml @@ -26,7 +26,7 @@ env: # Replace HI with the ID of the instance in capital letters ARTIFACT: webHelpQG2-all.zip # Writerside docker image version - DOCKER_VERSION: 233.14389 + DOCKER_VERSION: 241.16003 # Add the variable below to upload Algolia indexes # Replace HI with the ID of the instance in capital letters ALGOLIA_ARTIFACT: algolia-indexes-QG.zip @@ -127,7 +127,7 @@ jobs: needs: [build, test] runs-on: ubuntu-latest container: - image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-2 + image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3 env: diff --git a/README.md b/README.md index b5e70589..c2294209 100644 --- a/README.md +++ b/README.md @@ -25,24 +25,21 @@ -这是一个基于 [Kotlin coroutines](https://github.com/Kotlin/kotlinx.coroutines) -对 [**QQ频道机器人**][qg bot doc] 进行实现的 API/SDK -[Kotlin 多平台][KMP]库,异步高效、Java友好。 +这是一个 [Kotlin 多平台][KMP] +的 [**QQ机器人官方API**][qg bot doc] +SDK 实现库, +也是 [Simple Robot][simbot4 gh] 标准API下实现的组件库, +异步高效、Java友好! -它同样是一个 [Simple Robot v4][simbot4 gh] (下文简称 simbot) -的组件库,是 simbot 的子项目之一。 -借助 simbot 核心库提供的能力,它可以支持更多高级功能和封装,比如组件协同、Spring支持等。 +借助 simbot 核心库提供的能力,它可以支持很多高级功能和封装,比如组件协同、Spring支持等, +助你快速开发机器人应用! -它可以作为一个低级别的 API/SDK 辅助依赖库, -也可在 simbot 核心库的支持下用作为一个轻量级的快速开发框架! - -序列化和网络请求相关分别基于 [Kotlin serialization](https://github.com/Kotlin/kotlinx.serialization) +> 序列化和网络请求相关分别基于 [Kotlin serialization](https://github.com/Kotlin/kotlinx.serialization) 和 [Ktor](https://ktor.io/). ## 文档与引导 -- QQ频道组件手册: [应用手册](https://component-qqguild.simbot.forte.love/) (即当前仓库的 GitHub Pages) -- 了解simbot: [Simple Robot 应用手册](https://simbot.forte.love) +- 手册: [Simple Robot 应用手册](https://simbot.forte.love) 及其中 [**QQ机器人组件**](https://simbot.forte.love/component-qq-guild.html) 部分 - [文档引导站&API文档](https://docs.simbot.forte.love) - [**社群**](https://simbot.forte.love/communities.html) 文档中也有提供社群信息喔 - 前往 [组织首页](https://github.com/simple-robot/) 了解更多有关组件、文档、以及社群等相关信息! @@ -76,10 +73,9 @@ 👉 [前往模块](simbot-component-qq-guild-stdlib) 了解更多。 -### 核心组件模块 +### 核心组件模块 ⭐ -基于 -[标准库模块](simbot-component-qq-guild-stdlib) +基于 [标准库模块](simbot-component-qq-guild-stdlib) 对 [simbot4核心库](https://github.com/simple-robot/simpler-robot) 的组件实现, 是一个相对高度封装的模块,并提供simbot4大部分能力,包括事件监听、多组件协同、Spring Boot Starter 等。 diff --git a/Writerside/qg.tree b/Writerside/qg.tree index 1e8675b0..94644243 100644 --- a/Writerside/qg.tree +++ b/Writerside/qg.tree @@ -37,7 +37,7 @@ - + diff --git a/Writerside/topics/ApiPermission.md b/Writerside/topics/ApiPermission.md index d72a8de4..41e85e84 100644 --- a/Writerside/topics/ApiPermission.md +++ b/Writerside/topics/ApiPermission.md @@ -2,6 +2,8 @@ # API权限信息 + + ## ApiPermission 在API模块中,有一个类型 `ApiPermission`,它代表了一个频道服务器中、 diff --git a/Writerside/topics/Home.md b/Writerside/topics/Home.md index cf9080a4..90d2924a 100644 --- a/Writerside/topics/Home.md +++ b/Writerside/topics/Home.md @@ -1,5 +1,7 @@ # 欢迎! + + 这里是 [**Simple Robot v4**](https://github.com/simple-robot/simpler-robot/tree/v4-dev) 的 diff --git a/Writerside/topics/QGBot.md b/Writerside/topics/QGBot.md index 2b56374d..24775c1f 100644 --- a/Writerside/topics/QGBot.md +++ b/Writerside/topics/QGBot.md @@ -3,8 +3,11 @@ switcher-label: Java API 风格 --- + # QGBot + + 作为一个QQ频道的 Bot 库,有一个用于描述机器人的 `Bot` 想必肯定是很正常的。 diff --git a/Writerside/topics/QGChannel.md b/Writerside/topics/QGChannel.md index b699dc51..b70ce019 100644 --- a/Writerside/topics/QGChannel.md +++ b/Writerside/topics/QGChannel.md @@ -6,6 +6,8 @@ switcher-label: Java API 风格 # 子频道 QGChannel + + 子频道,即 `Channel`,存在于频道服务器(`Guild`)中, 有多种类型,例如文字子频道、论坛子频道等。 diff --git a/Writerside/topics/QGGuild.md b/Writerside/topics/QGGuild.md index ff715a6c..3bd6efad 100644 --- a/Writerside/topics/QGGuild.md +++ b/Writerside/topics/QGGuild.md @@ -6,6 +6,8 @@ switcher-label: Java API 风格 # 频道 QGGuild + + ## API模块中的Guild {id='guild-in-api'} API模块中部分用于获取频道信息的API中会返回一些与 `Guild` 相关的数据类型。 diff --git a/Writerside/topics/QGMember.md b/Writerside/topics/QGMember.md index a933b33b..77b6602b 100644 --- a/Writerside/topics/QGMember.md +++ b/Writerside/topics/QGMember.md @@ -6,6 +6,8 @@ switcher-label: Java API 风格 # 频道成员 QGMember + + 频道成员,即 `Member`,存在于频道服务器(`Guild`)中。 diff --git a/Writerside/topics/actors.md b/Writerside/topics/actors.md index 69e0e4d0..8b5f4b26 100644 --- a/Writerside/topics/actors.md +++ b/Writerside/topics/actors.md @@ -1,5 +1,7 @@ # 行为对象 + + QQ频道的**行为对象**(例如 `QGGuild`、`QGMember` 等) 都是对 simbot 标准库中的行为对象进行的实现与延伸扩展。 diff --git a/Writerside/topics/api-list.md b/Writerside/topics/api-list.md index c41fa897..da1a2354 100644 --- a/Writerside/topics/api-list.md +++ b/Writerside/topics/api-list.md @@ -1,5 +1,7 @@ # API定义列表 + + 此处会列举 `API 模块` 中、`love.forte.simbot.qguild.api` 包下定义的所有 `QQGuildApi` 实现。 > 对于一个具体的API的详细说明,我们建议你前往 [API 文档](https://docs.simbot.forte.love/) 或源码注释查阅, diff --git a/Writerside/topics/api.md b/Writerside/topics/api.md index 84f6f21b..df4894da 100644 --- a/Writerside/topics/api.md +++ b/Writerside/topics/api.md @@ -4,6 +4,8 @@ switcher-label: Java API 风格 + + # API ## API模块 {id='api-module'} diff --git a/Writerside/topics/ark/api_ark.md b/Writerside/topics/ark/api_ark.md index 64d8ad05..12ae78aa 100644 --- a/Writerside/topics/ark/api_ark.md +++ b/Writerside/topics/ark/api_ark.md @@ -1,5 +1,7 @@ # Ark消息 + + QQ频道中有一些针对 `Ark消息` 的API。 diff --git a/Writerside/topics/bot-config.md b/Writerside/topics/bot-config.md index 9248c17b..c8df6467 100644 --- a/Writerside/topics/bot-config.md +++ b/Writerside/topics/bot-config.md @@ -1,5 +1,7 @@ # Bot配置文件 + +

在使用 Spring Boot 时自动注册 bot 所需的配置文件。

diff --git a/Writerside/topics/embed/api_embed.md b/Writerside/topics/embed/api_embed.md index 8a71f389..dc61b9b3 100644 --- a/Writerside/topics/embed/api_embed.md +++ b/Writerside/topics/embed/api_embed.md @@ -1,5 +1,7 @@ # Embed消息 + + QQ频道中有一些针对 `Embed消息` 的API。 diff --git a/Writerside/topics/event.md b/Writerside/topics/event.md index 15139638..d093ead9 100644 --- a/Writerside/topics/event.md +++ b/Writerside/topics/event.md @@ -1,5 +1,7 @@ # 事件定义列表 + + QQ频道组件中的**事件类型**包含两个层面: 1. **API 模块** 中,对 QQ频道 API 中官方定义的事件结构的基本封装与实现。 diff --git a/Writerside/topics/forum/api_forum.md b/Writerside/topics/forum/api_forum.md index 5e4674f3..9565968c 100644 --- a/Writerside/topics/forum/api_forum.md +++ b/Writerside/topics/forum/api_forum.md @@ -4,6 +4,8 @@ switcher-label: Java API 风格 # 论坛 QGForum + + QQ频道中有一些针对 `论坛子频道` 的API。([参考文档](https://bot.q.qq.com/wiki/develop/api/openapi/forum/model.html#thread)) diff --git a/Writerside/topics/messages.md b/Writerside/topics/messages.md index 5898b543..5efca4e8 100644 --- a/Writerside/topics/messages.md +++ b/Writerside/topics/messages.md @@ -5,6 +5,8 @@ switcher-label: Java API 风格 # 消息 + + - 对那些 **核心库** 中、实现了 simbot4 标准库的 `Message.Element` 消息元素类型的说明, diff --git a/Writerside/topics/modules.md b/Writerside/topics/modules.md index 1b8b0455..69dad98f 100644 --- a/Writerside/topics/modules.md +++ b/Writerside/topics/modules.md @@ -1,5 +1,7 @@ # 模块概述 + + 本章节对整个 [Simple Robot QQ频道组件库](https://github.com/simple-robot/simbot-component-qq-guild) 中出现的各模块进行一个简单的介绍。 diff --git a/Writerside/topics/old-versions.md b/Writerside/topics/old-versions.md new file mode 100644 index 00000000..4b51625b --- /dev/null +++ b/Writerside/topics/old-versions.md @@ -0,0 +1,3 @@ +# 历史版本 + +一些已经成为历史的过去... diff --git a/Writerside/topics/role/api_role.md b/Writerside/topics/role/api_role.md index f86d0071..16f358c3 100644 --- a/Writerside/topics/role/api_role.md +++ b/Writerside/topics/role/api_role.md @@ -6,6 +6,8 @@ switcher-label: Java API 风格 # 角色 QGRole + + QQ频道中有一些针对 `角色` 的API。 ## API中的角色 {id="api-roles"} diff --git a/Writerside/topics/snippets.md b/Writerside/topics/snippets.md index 34bc50da..040176ef 100644 --- a/Writerside/topics/snippets.md +++ b/Writerside/topics/snippets.md @@ -211,7 +211,7 @@ implementation 'io.ktor:ktor-client-darwin:$ktor_version' ```Kotlin -implementation("love.forte.simbot.component:%module%:%version%") +implementation("love.forte.simbot.component:%module%:%qg-version%") ``` @@ -220,7 +220,7 @@ implementation("love.forte.simbot.component:%module%:%version%") 那么你需要指定依赖的后缀为 `-jvm`。 ```Kotlin -implementation("love.forte.simbot.component:%module-jvm%:%version%") +implementation("love.forte.simbot.component:%module-jvm%:%qg-version%") ``` @@ -229,7 +229,7 @@ implementation("love.forte.simbot.component:%module-jvm%:%version%") ```Groovy -implementation 'love.forte.simbot.component:%module%:%version%' +implementation 'love.forte.simbot.component:%module%:%qg-version%' ``` @@ -238,7 +238,7 @@ implementation 'love.forte.simbot.component:%module%:%version%' 那么你需要指定依赖的后缀为 `-jvm`。 ```Groovy -implementation 'love.forte.simbot.component:%module-jvm%:%version%' +implementation 'love.forte.simbot.component:%module-jvm%:%qg-version%' ``` @@ -250,7 +250,7 @@ implementation 'love.forte.simbot.component:%module-jvm%:%version%' love.forte.simbot.component %module-jvm% - %version% + %qg-version% ``` @@ -258,3 +258,27 @@ implementation 'love.forte.simbot.component:%module-jvm%:%version%' + + + +

站点迁移啦~!

+ + + +QQ机器人组件的内容已经迁移合并到了[**核心库手册**](https://simbot.forte.love/component-qq-guild.html)中(除了 [_历史版本_](old-versions.md) 的内容以外)! +本站点将不再更新,直接前往核心库手册的[**QQ机器人组件**](https://simbot.forte.love/component-qq-guild.html)部分吧~! + + + + + +作为由我们官方维护的组件库,分散在各自的文档站点中的确有好处:它们可以各自维护自己所需的东西、互不干扰。 + +但是缺点也很明显:**太过分散。** + +组件库与核心库之间的关系是比较**紧密**的, +我们希望你能够在一个站点内就可以查阅或搜索到所有你想要得知的信息。 + + + +
diff --git a/Writerside/topics/tips-send-image.md b/Writerside/topics/tips-send-image.md index ad5118c7..c67d0b16 100644 --- a/Writerside/topics/tips-send-image.md +++ b/Writerside/topics/tips-send-image.md @@ -1,5 +1,7 @@ # 用例: 发送图片 + + 发送图片是一个经常使用、且经常被问及“怎么发图片”的内容。 本章节介绍在QQ频道组件中,如何发送一个图片。 diff --git a/Writerside/topics/use-api.md b/Writerside/topics/use-api.md index 5f8d0cc2..8e08babc 100644 --- a/Writerside/topics/use-api.md +++ b/Writerside/topics/use-api.md @@ -6,6 +6,8 @@ switcher-label: Java API 风格 # 使用 API 模块 + +

本章节介绍如何使用 API 模块 来构建、请求一个QQ频道的API。

@@ -48,7 +50,7 @@ API 模块无法直接作为 Simple Robot 组件使用。 ```Kotlin -implementation("love.forte.simbot.component:simbot-component-qq-guild-api:%version%") +implementation("love.forte.simbot.component:simbot-component-qq-guild-api:%qg-version%") ``` @@ -57,7 +59,7 @@ implementation("love.forte.simbot.component:simbot-component-qq-guild-api:%versi 那么你需要指定依赖的后缀为 `-jvm`。 ```Kotlin -implementation("love.forte.simbot.component:simbot-component-qq-guild-api-jvm:%version%") +implementation("love.forte.simbot.component:simbot-component-qq-guild-api-jvm:%qg-version%") ``` @@ -66,7 +68,7 @@ implementation("love.forte.simbot.component:simbot-component-qq-guild-api-jvm:%v ```Groovy -implementation 'love.forte.simbot.component:simbot-component-qq-guild-api:%version%' +implementation 'love.forte.simbot.component:simbot-component-qq-guild-api:%qg-version%' ``` @@ -75,7 +77,7 @@ implementation 'love.forte.simbot.component:simbot-component-qq-guild-api:%versi 那么你需要指定依赖的后缀为 `-jvm`。 ```Groovy -implementation 'love.forte.simbot.component:simbot-component-qq-guild-api-jvm:%version%' +implementation 'love.forte.simbot.component:simbot-component-qq-guild-api-jvm:%qg-version%' ``` @@ -88,7 +90,7 @@ implementation 'love.forte.simbot.component:simbot-component-qq-guild-api-jvm:%v love.forte.simbot.component simbot-component-qq-guild-api-jvm - %version% + %qg-version% ``` diff --git a/Writerside/topics/use-core.md b/Writerside/topics/use-core.md index 97f924bf..17815713 100644 --- a/Writerside/topics/use-core.md +++ b/Writerside/topics/use-core.md @@ -5,6 +5,8 @@ switcher-label: Java API 风格 # 使用核心库模块 + +

使用 核心库模块(core 模块) 配合 simbot4 核心库来将QQ频道作为 simbot4 的组件之一应用在 Application 中。

@@ -35,7 +37,7 @@ simbot 核心库的版本尽量不要低于 `v%minimum-core-version%`,可前 // simbot4核心库 implementation("love.forte.simbot:simbot-core:%minimum-core-version%") // QQ频道组件库 -implementation("love.forte.simbot.component:simbot-component-qq-guild-core:%version%") +implementation("love.forte.simbot.component:simbot-component-qq-guild-core:%qg-version%") ``` @@ -47,7 +49,7 @@ implementation("love.forte.simbot.component:simbot-component-qq-guild-core:%vers // simbot4核心库 implementation("love.forte.simbot:simbot-core-jvm:%minimum-core-version%") // QQ频道组件库 -implementation("love.forte.simbot.component:simbot-component-qq-guild-core-jvm:%version%") +implementation("love.forte.simbot.component:simbot-component-qq-guild-core-jvm:%qg-version%") ``` @@ -59,7 +61,7 @@ implementation("love.forte.simbot.component:simbot-component-qq-guild-core-jvm:% // simbot4核心库 implementation 'love.forte.simbot:simbot-core:%minimum-core-version%' // QQ频道组件库 -implementation 'love.forte.simbot.component:simbot-component-qq-guild-core:%version%' +implementation 'love.forte.simbot.component:simbot-component-qq-guild-core:%qg-version%' ``` @@ -71,7 +73,7 @@ implementation 'love.forte.simbot.component:simbot-component-qq-guild-core:%vers // simbot4核心库 implementation 'love.forte.simbot:simbot-core-jvm:%minimum-core-version%' // QQ频道组件库 -implementation 'love.forte.simbot.component:simbot-component-qq-guild-core-jvm:%version%' +implementation 'love.forte.simbot.component:simbot-component-qq-guild-core-jvm:%qg-version%' ``` @@ -90,7 +92,7 @@ implementation 'love.forte.simbot.component:simbot-component-qq-guild-core-jvm:% love.forte.simbot.component simbot-component-qq-guild-core-jvm - %version% + %qg-version% ``` diff --git a/Writerside/topics/use-spring-boot.md b/Writerside/topics/use-spring-boot.md index c658db28..8899aecb 100644 --- a/Writerside/topics/use-spring-boot.md +++ b/Writerside/topics/use-spring-boot.md @@ -6,6 +6,8 @@ switcher-label: Java API 风格 # 使用 Spring Boot + +

使用 核心库(core 模块) 配合 simbot4 Spring Boot starter 来将QQ频道组件作为 simbot4 的组件之一应用在 Spring Boot 3 中。

@@ -50,7 +52,7 @@ simbot 核心库的版本尽量不要低于 `v%minimum-core-version%`,可前 // simbot4核心库 implementation("love.forte.simbot:simbot-core-spring-boot-starter:%minimum-core-version%") // QQ频道组件库 -implementation("love.forte.simbot.component:simbot-component-qq-guild-core:%version%") +implementation("love.forte.simbot.component:simbot-component-qq-guild-core:%qg-version%") ``` @@ -62,7 +64,7 @@ implementation("love.forte.simbot.component:simbot-component-qq-guild-core:%vers // simbot4核心库 implementation("love.forte.simbot:simbot-core-spring-boot-starter:%minimum-core-version%") // QQ频道组件库 -implementation("love.forte.simbot.component:simbot-component-qq-guild-core-jvm:%version%") +implementation("love.forte.simbot.component:simbot-component-qq-guild-core-jvm:%qg-version%") ``` @@ -74,7 +76,7 @@ implementation("love.forte.simbot.component:simbot-component-qq-guild-core-jvm:% // simbot4核心库 implementation 'love.forte.simbot:simbot-core-spring-boot-starter:%minimum-core-version%' // QQ频道组件库 -implementation 'love.forte.simbot.component:simbot-component-qq-guild-core:%version%' +implementation 'love.forte.simbot.component:simbot-component-qq-guild-core:%qg-version%' ``` @@ -86,7 +88,7 @@ implementation 'love.forte.simbot.component:simbot-component-qq-guild-core:%vers // simbot4核心库 implementation 'love.forte.simbot:simbot-core-spring-boot-starter:%minimum-core-version%' // QQ频道组件库 -implementation 'love.forte.simbot.component:simbot-component-qq-guild-core-jvm:%version%' +implementation 'love.forte.simbot.component:simbot-component-qq-guild-core-jvm:%qg-version%' ``` @@ -105,7 +107,7 @@ implementation 'love.forte.simbot.component:simbot-component-qq-guild-core-jvm:% love.forte.simbot.component simbot-component-qq-guild-core-jvm - %version% + %qg-version% ``` diff --git a/Writerside/topics/use-stdlib.md b/Writerside/topics/use-stdlib.md index 5ae71611..ddf7e9d5 100644 --- a/Writerside/topics/use-stdlib.md +++ b/Writerside/topics/use-stdlib.md @@ -4,6 +4,8 @@ switcher-label: Java API 风格 # 使用标准库模块 + +

本章节介绍如何使用 标准库模块(stdlib模块) 来构建 Bot 实例、订阅并处理事件。

@@ -47,7 +49,7 @@ switcher-label: Java API 风格 ```Kotlin -implementation("love.forte.simbot.component:simbot-component-qq-guild-stdlib:%version%") +implementation("love.forte.simbot.component:simbot-component-qq-guild-stdlib:%qg-version%") ``` @@ -56,7 +58,7 @@ implementation("love.forte.simbot.component:simbot-component-qq-guild-stdlib:%ve 那么你需要指定依赖的后缀为 `-jvm`。 ```Kotlin -implementation("love.forte.simbot.component:simbot-component-qq-guild-stdlib-jvm:%version%") +implementation("love.forte.simbot.component:simbot-component-qq-guild-stdlib-jvm:%qg-version%") ``` @@ -65,7 +67,7 @@ implementation("love.forte.simbot.component:simbot-component-qq-guild-stdlib-jvm ```Groovy -implementation 'love.forte.simbot.component:simbot-component-qq-guild-stdlib:%version%' +implementation 'love.forte.simbot.component:simbot-component-qq-guild-stdlib:%qg-version%' ``` @@ -74,7 +76,7 @@ implementation 'love.forte.simbot.component:simbot-component-qq-guild-stdlib:%ve 那么你需要指定依赖的后缀为 `-jvm`。 ```Groovy -implementation 'love.forte.simbot.component:simbot-component-qq-guild-stdlib-jvm:%version%' +implementation 'love.forte.simbot.component:simbot-component-qq-guild-stdlib-jvm:%qg-version%' ``` @@ -87,7 +89,7 @@ implementation 'love.forte.simbot.component:simbot-component-qq-guild-stdlib-jvm love.forte.simbot.component simbot-component-qq-guild-stdlib-jvm - %version% + %qg-version% ``` diff --git a/Writerside/v.list b/Writerside/v.list index ca23ff48..2a810f25 100644 --- a/Writerside/v.list +++ b/Writerside/v.list @@ -5,6 +5,6 @@ - + diff --git a/Writerside/writerside.cfg b/Writerside/writerside.cfg index e2faeba2..06eecab7 100644 --- a/Writerside/writerside.cfg +++ b/Writerside/writerside.cfg @@ -4,5 +4,5 @@ - + diff --git a/buildSrc/src/main/kotlin/P.kt b/buildSrc/src/main/kotlin/P.kt index 5ea930c2..b0a412f6 100644 --- a/buildSrc/src/main/kotlin/P.kt +++ b/buildSrc/src/main/kotlin/P.kt @@ -56,8 +56,8 @@ object P { override val homepage: String get() = HOMEPAGE - const val VERSION = "4.0.0-beta5" - const val NEXT_VERSION = "4.0.0-beta6" + const val VERSION = "4.0.0-beta6" + const val NEXT_VERSION = "4.0.0-beta7" override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT" override val version = if (isSnapshot()) snapshotVersion else VERSION diff --git a/simbot-component-qq-guild-api/README.md b/simbot-component-qq-guild-api/README.md index ebc17a03..23ee49a0 100644 --- a/simbot-component-qq-guild-api/README.md +++ b/simbot-component-qq-guild-api/README.md @@ -140,3 +140,5 @@ guildList.forEach { guild -> - [x] 帖子 API - [x] API接口权限 API - [x] WebSocket API +- [x] QQ群聊 +- [x] C2C单聊 diff --git a/simbot-component-qq-guild-api/api/simbot-component-qq-guild-api.api b/simbot-component-qq-guild-api/api/simbot-component-qq-guild-api.api index 3fda1b64..9be301c4 100644 --- a/simbot-component-qq-guild-api/api/simbot-component-qq-guild-api.api +++ b/simbot-component-qq-guild-api/api/simbot-component-qq-guild-api.api @@ -91,49 +91,65 @@ public final class love/forte/simbot/qguild/api/ApiDescriptionKt { } public final class love/forte/simbot/qguild/api/ApiRequests { + public static final field X_UNION_APPID_HEADER Ljava/lang/String; public static final fun newHttpClient ()Lio/ktor/client/HttpClient; public static final fun newJson ()Lkotlinx/serialization/json/Json; public static final fun newJson (Ljava/util/function/Consumer;)Lkotlinx/serialization/json/Json; public static synthetic fun newJson$default (Ljava/util/function/Consumer;ILjava/lang/Object;)Lkotlinx/serialization/json/Json; + public static final synthetic fun request (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final synthetic fun request (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun request$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final synthetic fun request (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun request (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun request$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun requestAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;)Ljava/util/concurrent/CompletableFuture; public static final fun requestAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;)Ljava/util/concurrent/CompletableFuture; public static final fun requestAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;)Ljava/util/concurrent/CompletableFuture; - public static synthetic fun requestAsync$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;ILjava/lang/Object;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;)Ljava/util/concurrent/CompletableFuture; + public static synthetic fun requestAsync$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;ILjava/lang/Object;)Ljava/util/concurrent/CompletableFuture; public static final fun requestBlocking (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;)Lio/ktor/client/statement/HttpResponse; public static final fun requestBlocking (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;)Lio/ktor/client/statement/HttpResponse; - public static synthetic fun requestBlocking$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;ILjava/lang/Object;)Lio/ktor/client/statement/HttpResponse; + public static final fun requestBlocking (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Ljava/lang/String;)Lio/ktor/client/statement/HttpResponse; + public static synthetic fun requestBlocking$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Ljava/lang/String;ILjava/lang/Object;)Lio/ktor/client/statement/HttpResponse; + public static final synthetic fun requestData (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final synthetic fun requestData (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/serialization/json/Json;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final synthetic fun requestData (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/serialization/json/Json;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun requestData$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/serialization/json/Json;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final synthetic fun requestData (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun requestData$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/serialization/json/Json;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun requestDataAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;)Ljava/util/concurrent/CompletableFuture; public static final fun requestDataAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;)Ljava/util/concurrent/CompletableFuture; public static final fun requestDataAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;)Ljava/util/concurrent/CompletableFuture; - public static synthetic fun requestDataAsync$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;ILjava/lang/Object;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestDataAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;)Ljava/util/concurrent/CompletableFuture; + public static synthetic fun requestDataAsync$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;ILjava/lang/Object;)Ljava/util/concurrent/CompletableFuture; public static final fun requestDataBlocking (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;)Ljava/lang/Object; public static final fun requestDataBlocking (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;)Ljava/lang/Object; - public static synthetic fun requestDataBlocking$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun requestDataBlocking (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Ljava/lang/String;)Ljava/lang/Object; + public static synthetic fun requestDataBlocking$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/Object; public static final fun requestDataReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public static final fun requestDataReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public static final fun requestDataReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; - public static synthetic fun requestDataReserve$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;ILjava/lang/Object;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public static final fun requestDataReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public static synthetic fun requestDataReserve$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public static final fun requestReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public static final fun requestReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public static final fun requestReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; - public static synthetic fun requestReserve$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;ILjava/lang/Object;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; - public static final fun requestText (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun requestText$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun requestReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public static synthetic fun requestReserve$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public static final fun requestText (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun requestText$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static final fun requestTextAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;)Ljava/util/concurrent/CompletableFuture; public static final fun requestTextAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;)Ljava/util/concurrent/CompletableFuture; public static final fun requestTextAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;)Ljava/util/concurrent/CompletableFuture; - public static synthetic fun requestTextAsync$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;ILjava/lang/Object;)Ljava/util/concurrent/CompletableFuture; + public static final fun requestTextAsync (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;)Ljava/util/concurrent/CompletableFuture; + public static synthetic fun requestTextAsync$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;ILjava/lang/Object;)Ljava/util/concurrent/CompletableFuture; public static final fun requestTextBlocking (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;)Ljava/lang/String; public static final fun requestTextBlocking (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;)Ljava/lang/String; - public static synthetic fun requestTextBlocking$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;ILjava/lang/Object;)Ljava/lang/String; + public static final fun requestTextBlocking (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Ljava/lang/String;)Ljava/lang/String; + public static synthetic fun requestTextBlocking$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String; public static final fun requestTextReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public static final fun requestTextReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public static final fun requestTextReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; - public static synthetic fun requestTextReserve$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;ILjava/lang/Object;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public static final fun requestTextReserve (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public static synthetic fun requestTextReserve$default (Llove/forte/simbot/qguild/api/QQGuildApi;Lio/ktor/client/HttpClient;Ljava/lang/String;Lio/ktor/http/Url;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; } public abstract class love/forte/simbot/qguild/api/DeleteQQGuildApi : love/forte/simbot/common/apidefinition/DeleteApiDefinition, love/forte/simbot/qguild/api/QQGuildApi { @@ -504,6 +520,80 @@ public final class love/forte/simbot/qguild/api/apipermission/GetApiPermissionLi public static final fun hasAuth (Llove/forte/simbot/qguild/api/apipermission/ApiPermissions;Llove/forte/simbot/qguild/api/ApiDescription;)Z } +public final class love/forte/simbot/qguild/api/app/AppAccessToken { + public static final field Companion Llove/forte/simbot/qguild/api/app/AppAccessToken$Companion; + public fun (Ljava/lang/String;I)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()I + public final fun copy (Ljava/lang/String;I)Llove/forte/simbot/qguild/api/app/AppAccessToken; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/api/app/AppAccessToken;Ljava/lang/String;IILjava/lang/Object;)Llove/forte/simbot/qguild/api/app/AppAccessToken; + public fun equals (Ljava/lang/Object;)Z + public final fun getAccessToken ()Ljava/lang/String; + public final fun getExpiresIn ()I + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/api/app/AppAccessToken$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/api/app/AppAccessToken$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/api/app/AppAccessToken; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/api/app/AppAccessToken;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/app/AppAccessToken$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/app/GetAppAccessTokenApi : love/forte/simbot/qguild/api/PostQQGuildApi { + public static final field Factory Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Factory; + public static final field HTTP_URL_STRING Ljava/lang/String; + public static final field httpUrl Lio/ktor/http/Url; + public synthetic fun (Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public static final fun create (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi; + public synthetic fun getBody ()Ljava/lang/Object; + public fun getBody ()Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body; + public fun getResultDeserializationStrategy ()Lkotlinx/serialization/DeserializationStrategy; + public fun getUrl ()Lio/ktor/http/Url; +} + +public final class love/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body { + public static final field Companion Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body$Companion; + public fun (Ljava/lang/String;Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body; + public fun equals (Ljava/lang/Object;)Z + public final fun getAppId ()Ljava/lang/String; + public final fun getClientSecret ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Body$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/app/GetAppAccessTokenApi$Factory { + public final fun create (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/app/GetAppAccessTokenApi; +} + public final class love/forte/simbot/qguild/api/channel/CreateChannelApi : love/forte/simbot/qguild/api/PostQQGuildApi { public static final field Factory Llove/forte/simbot/qguild/api/channel/CreateChannelApi$Factory; public synthetic fun (Ljava/lang/String;Llove/forte/simbot/qguild/api/channel/CreateChannelApi$Body;Lkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -933,6 +1023,108 @@ public final class love/forte/simbot/qguild/api/channel/schedules/ScheduleReques public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class love/forte/simbot/qguild/api/files/UploadGroupFilesApi : love/forte/simbot/qguild/api/PostQQGuildApi { + public static final field FILE_TYPE_AUDIO I + public static final field FILE_TYPE_FILE I + public static final field FILE_TYPE_IMAGE I + public static final field FILE_TYPE_VIDEO I + public static final field Factory Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Factory; + public synthetic fun (Ljava/lang/String;Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public static final fun create (Ljava/lang/String;ILjava/lang/String;)Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi; + public static final fun create (Ljava/lang/String;ILjava/lang/String;Z)Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi; + public static final fun create (Ljava/lang/String;Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body;)Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi; + public fun getResultDeserializationStrategy ()Lkotlinx/serialization/DeserializationStrategy; +} + +public final class love/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body { + public static final field Companion Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body$Companion; + public fun (ILjava/lang/String;Z)V + public final fun component1 ()I + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Z + public final fun copy (ILjava/lang/String;Z)Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body;ILjava/lang/String;ZILjava/lang/Object;)Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body; + public fun equals (Ljava/lang/Object;)Z + public final fun getFileType ()I + public final fun getSrvSendMsg ()Z + public final fun getUrl ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/files/UploadGroupFilesApi$Factory : love/forte/simbot/qguild/api/SimplePostApiDescription { + public final fun create (Ljava/lang/String;ILjava/lang/String;)Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi; + public final fun create (Ljava/lang/String;ILjava/lang/String;Z)Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi; + public final fun create (Ljava/lang/String;Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Body;)Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi; + public static synthetic fun create$default (Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi$Factory;Ljava/lang/String;ILjava/lang/String;ZILjava/lang/Object;)Llove/forte/simbot/qguild/api/files/UploadGroupFilesApi; +} + +public final class love/forte/simbot/qguild/api/files/UploadUserFilesApi : love/forte/simbot/qguild/api/PostQQGuildApi { + public static final field FILE_TYPE_AUDIO I + public static final field FILE_TYPE_FILE I + public static final field FILE_TYPE_IMAGE I + public static final field FILE_TYPE_VIDEO I + public static final field Factory Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Factory; + public synthetic fun (Ljava/lang/String;Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Body;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public static final fun create (Ljava/lang/String;ILjava/lang/String;)Llove/forte/simbot/qguild/api/files/UploadUserFilesApi; + public static final fun create (Ljava/lang/String;ILjava/lang/String;Z)Llove/forte/simbot/qguild/api/files/UploadUserFilesApi; + public static final fun create (Ljava/lang/String;Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Body;)Llove/forte/simbot/qguild/api/files/UploadUserFilesApi; + public fun getResultDeserializationStrategy ()Lkotlinx/serialization/DeserializationStrategy; +} + +public final class love/forte/simbot/qguild/api/files/UploadUserFilesApi$Body { + public static final field Companion Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Body$Companion; + public fun (ILjava/lang/String;Z)V + public final fun component1 ()I + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Z + public final fun copy (ILjava/lang/String;Z)Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Body; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Body;ILjava/lang/String;ZILjava/lang/Object;)Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Body; + public fun equals (Ljava/lang/Object;)Z + public final fun getFileType ()I + public final fun getSrvSendMsg ()Z + public final fun getUrl ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/api/files/UploadUserFilesApi$Body$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Body$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Body; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Body;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/files/UploadUserFilesApi$Body$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/files/UploadUserFilesApi$Factory : love/forte/simbot/qguild/api/SimplePostApiDescription { + public final fun create (Ljava/lang/String;ILjava/lang/String;)Llove/forte/simbot/qguild/api/files/UploadUserFilesApi; + public final fun create (Ljava/lang/String;ILjava/lang/String;Z)Llove/forte/simbot/qguild/api/files/UploadUserFilesApi; + public final fun create (Ljava/lang/String;Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Body;)Llove/forte/simbot/qguild/api/files/UploadUserFilesApi; + public static synthetic fun create$default (Llove/forte/simbot/qguild/api/files/UploadUserFilesApi$Factory;Ljava/lang/String;ILjava/lang/String;ZILjava/lang/Object;)Llove/forte/simbot/qguild/api/files/UploadUserFilesApi; +} + public final class love/forte/simbot/qguild/api/forum/DeleteThreadApi : love/forte/simbot/qguild/api/DeleteQQGuildApi, love/forte/simbot/qguild/api/QQGuildApiWithoutResult { public static final field Factory Llove/forte/simbot/qguild/api/forum/DeleteThreadApi$Factory; public fun (Ljava/lang/String;Ljava/lang/String;)V @@ -1331,6 +1523,56 @@ public final class love/forte/simbot/qguild/api/message/GetMessageApi$Factory : public final fun create (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/GetMessageApi; } +public class love/forte/simbot/qguild/api/message/GroupAndC2CSendBody { + public static final field Companion Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody$Companion; + public static final field MSG_TYPE_ARK I + public static final field MSG_TYPE_EMBED I + public static final field MSG_TYPE_MARKDOWN I + public static final field MSG_TYPE_MEDIA I + public static final field MSG_TYPE_TEXT I + public synthetic fun (ILjava/lang/String;ILlove/forte/simbot/qguild/model/Message$Markdown;Llove/forte/simbot/qguild/model/MessageKeyboard;Llove/forte/simbot/qguild/model/MessageMedia;Llove/forte/simbot/qguild/model/Message$Ark;Llove/forte/simbot/qguild/model/Message$Reference;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V + public static final fun create (Ljava/lang/String;I)Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody; + public fun getArk ()Llove/forte/simbot/qguild/model/Message$Ark; + public fun getContent ()Ljava/lang/String; + public fun getEventId ()Ljava/lang/String; + public fun getKeyboard ()Llove/forte/simbot/qguild/model/MessageKeyboard; + public fun getMarkdown ()Llove/forte/simbot/qguild/model/Message$Markdown; + public fun getMedia ()Llove/forte/simbot/qguild/model/MessageMedia; + public fun getMessageReference ()Llove/forte/simbot/qguild/model/Message$Reference; + public fun getMsgId ()Ljava/lang/String; + public fun getMsgSeq ()Ljava/lang/Integer; + public fun getMsgType ()I + public fun setArk (Llove/forte/simbot/qguild/model/Message$Ark;)V + public fun setContent (Ljava/lang/String;)V + public fun setEventId (Ljava/lang/String;)V + public fun setKeyboard (Llove/forte/simbot/qguild/model/MessageKeyboard;)V + public fun setMarkdown (Llove/forte/simbot/qguild/model/Message$Markdown;)V + public fun setMedia (Llove/forte/simbot/qguild/model/MessageMedia;)V + public fun setMessageReference (Llove/forte/simbot/qguild/model/Message$Reference;)V + public fun setMsgId (Ljava/lang/String;)V + public fun setMsgSeq (Ljava/lang/Integer;)V + public fun setMsgType (I)V + public fun toString ()Ljava/lang/String; + public static final synthetic fun write$Self (Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V +} + +public synthetic class love/forte/simbot/qguild/api/message/GroupAndC2CSendBody$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/message/GroupAndC2CSendBody$Companion { + public final fun create (Ljava/lang/String;I)Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody; + public final fun create (Ljava/lang/String;ILkotlin/jvm/functions/Function1;)Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class love/forte/simbot/qguild/api/message/MessageSendApi : love/forte/simbot/qguild/api/PostQQGuildApi { public static final field Factory Llove/forte/simbot/qguild/api/message/MessageSendApi$Factory; public synthetic fun (Ljava/lang/String;Llove/forte/simbot/qguild/api/message/MessageSendApi$Body;Lkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -1465,6 +1707,60 @@ public final class love/forte/simbot/qguild/api/message/direct/DmsSendApiKt { public static final synthetic fun create (Llove/forte/simbot/qguild/api/message/direct/DmsSendApi$Factory;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Llove/forte/simbot/qguild/api/message/direct/DmsSendApi; } +public final class love/forte/simbot/qguild/api/message/group/GroupMessageSendApi : love/forte/simbot/qguild/api/PostQQGuildApi { + public static final field Factory Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi$Factory; + public static final field MSG_TYPE_ARK I + public static final field MSG_TYPE_EMBED I + public static final field MSG_TYPE_MARKDOWN I + public static final field MSG_TYPE_MEDIA I + public static final field MSG_TYPE_TEXT I + public synthetic fun (Ljava/lang/String;Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public static final fun create (Ljava/lang/String;Ljava/lang/String;I)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; + public static final fun create (Ljava/lang/String;Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; + public static final fun createMarkdown (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; + public static final fun createMarkdown (Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/MessageKeyboard;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; + public static final fun createText (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; + public fun getResultDeserializationStrategy ()Lkotlinx/serialization/DeserializationStrategy; +} + +public final class love/forte/simbot/qguild/api/message/group/GroupMessageSendApi$Factory : love/forte/simbot/qguild/api/SimplePostApiDescription { + public final fun create (Ljava/lang/String;Ljava/lang/String;I)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; + public final fun create (Ljava/lang/String;Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; + public final fun createMarkdown (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; + public final fun createMarkdown (Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/MessageKeyboard;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; + public static synthetic fun createMarkdown$default (Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi$Factory;Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/MessageKeyboard;ILjava/lang/Object;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; + public final fun createText (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendApi; +} + +public final class love/forte/simbot/qguild/api/message/group/GroupMessageSendResult { + public static final field Companion Llove/forte/simbot/qguild/api/message/group/GroupMessageSendResult$Companion; + public fun (Ljava/lang/String;Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendResult; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/api/message/group/GroupMessageSendResult;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendResult; + public fun equals (Ljava/lang/Object;)Z + public final fun getId ()Ljava/lang/String; + public final fun getTimestamp ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/api/message/group/GroupMessageSendResult$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/api/message/group/GroupMessageSendResult$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/api/message/group/GroupMessageSendResult; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/api/message/group/GroupMessageSendResult;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/message/group/GroupMessageSendResult$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class love/forte/simbot/qguild/api/message/setting/GetMessageSettingApi : love/forte/simbot/qguild/api/GetQQGuildApi { public static final field Factory Llove/forte/simbot/qguild/api/message/setting/GetMessageSettingApi$Factory; public synthetic fun (Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -1476,6 +1772,98 @@ public final class love/forte/simbot/qguild/api/message/setting/GetMessageSettin public final fun create (Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/setting/GetMessageSettingApi; } +public final class love/forte/simbot/qguild/api/message/user/UserMessageSendApi : love/forte/simbot/qguild/api/PostQQGuildApi { + public static final field Factory Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi$Factory; + public static final field MSG_TYPE_ARK I + public static final field MSG_TYPE_EMBED I + public static final field MSG_TYPE_MARKDOWN I + public static final field MSG_TYPE_MEDIA I + public static final field MSG_TYPE_TEXT I + public synthetic fun (Ljava/lang/String;Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody;Lkotlin/jvm/internal/DefaultConstructorMarker;)V + public static final fun create (Ljava/lang/String;Ljava/lang/String;I)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; + public static final fun create (Ljava/lang/String;Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; + public static final fun createMarkdown (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; + public static final fun createMarkdown (Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/MessageKeyboard;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; + public static final fun createText (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; + public fun getResultDeserializationStrategy ()Lkotlinx/serialization/DeserializationStrategy; +} + +public final class love/forte/simbot/qguild/api/message/user/UserMessageSendApi$Body { + public static final field Companion Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi$Body$Companion; + public fun (Ljava/lang/String;I)V + public final fun getArk ()Llove/forte/simbot/qguild/model/Message$Ark; + public final fun getContent ()Ljava/lang/String; + public final fun getEventId ()Ljava/lang/String; + public final fun getKeyboard ()Llove/forte/simbot/qguild/model/MessageKeyboard; + public final fun getMarkdown ()Llove/forte/simbot/qguild/model/Message$Markdown; + public final fun getMedia ()Llove/forte/simbot/qguild/model/SendMessageMedia; + public final fun getMessageReference ()Llove/forte/simbot/qguild/model/Message$Reference; + public final fun getMsgId ()Ljava/lang/String; + public final fun getMsgSeq ()Ljava/lang/Integer; + public final fun getMsgType ()I + public final fun setArk (Llove/forte/simbot/qguild/model/Message$Ark;)V + public final fun setEventId (Ljava/lang/String;)V + public final fun setKeyboard (Llove/forte/simbot/qguild/model/MessageKeyboard;)V + public final fun setMarkdown (Llove/forte/simbot/qguild/model/Message$Markdown;)V + public final fun setMedia (Llove/forte/simbot/qguild/model/SendMessageMedia;)V + public final fun setMessageReference (Llove/forte/simbot/qguild/model/Message$Reference;)V + public final fun setMsgId (Ljava/lang/String;)V + public final fun setMsgSeq (Ljava/lang/Integer;)V +} + +public synthetic class love/forte/simbot/qguild/api/message/user/UserMessageSendApi$Body$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi$Body$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi$Body; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi$Body;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/message/user/UserMessageSendApi$Body$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/message/user/UserMessageSendApi$Factory : love/forte/simbot/qguild/api/SimplePostApiDescription { + public final fun create (Ljava/lang/String;Ljava/lang/String;I)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; + public final fun create (Ljava/lang/String;Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; + public final fun createMarkdown (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; + public final fun createMarkdown (Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/MessageKeyboard;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; + public static synthetic fun createMarkdown$default (Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi$Factory;Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/MessageKeyboard;ILjava/lang/Object;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; + public final fun createText (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendApi; +} + +public final class love/forte/simbot/qguild/api/message/user/UserMessageSendResult { + public static final field Companion Llove/forte/simbot/qguild/api/message/user/UserMessageSendResult$Companion; + public fun (Ljava/lang/String;Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendResult; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/api/message/user/UserMessageSendResult;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendResult; + public fun equals (Ljava/lang/Object;)Z + public final fun getId ()Ljava/lang/String; + public final fun getTimestamp ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/api/message/user/UserMessageSendResult$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/api/message/user/UserMessageSendResult$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/api/message/user/UserMessageSendResult; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/api/message/user/UserMessageSendResult;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/api/message/user/UserMessageSendResult$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class love/forte/simbot/qguild/api/role/AddMemberRoleApi : love/forte/simbot/qguild/api/PutQQGuildApi, love/forte/simbot/qguild/api/QQGuildApiWithoutResult { public static final field Factory Llove/forte/simbot/qguild/api/role/AddMemberRoleApi$Factory; public synthetic fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -1702,13 +2090,16 @@ public final class love/forte/simbot/qguild/api/user/GetBotInfoApi$Description : public final class love/forte/simbot/qguild/event/AtMessageCreate : love/forte/simbot/qguild/event/MessageDispatch { public static final field Companion Llove/forte/simbot/qguild/event/AtMessageCreate$Companion; - public fun (JLlove/forte/simbot/qguild/model/Message;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/Message; - public final fun copy (JLlove/forte/simbot/qguild/model/Message;)Llove/forte/simbot/qguild/event/AtMessageCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/AtMessageCreate;JLlove/forte/simbot/qguild/model/Message;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/AtMessageCreate; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/Message; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;)Llove/forte/simbot/qguild/event/AtMessageCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/AtMessageCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/AtMessageCreate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/model/Message; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -1728,132 +2119,333 @@ public final class love/forte/simbot/qguild/event/AtMessageCreate$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ChannelCreate : love/forte/simbot/qguild/event/ChannelDispatch { - public static final field Companion Llove/forte/simbot/qguild/event/ChannelCreate$Companion; - public fun (JLlove/forte/simbot/qguild/event/EventChannel;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/EventChannel; - public final fun copy (JLlove/forte/simbot/qguild/event/EventChannel;)Llove/forte/simbot/qguild/event/ChannelCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ChannelCreate;JLlove/forte/simbot/qguild/event/EventChannel;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ChannelCreate; +public final class love/forte/simbot/qguild/event/C2CManagementData { + public static final field Companion Llove/forte/simbot/qguild/event/C2CManagementData$Companion; + public fun (Ljava/lang/String;Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/event/C2CManagementData; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/C2CManagementData;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/C2CManagementData; public fun equals (Ljava/lang/Object;)Z - public synthetic fun getData ()Ljava/lang/Object; - public fun getData ()Llove/forte/simbot/qguild/event/EventChannel; + public final fun getOpenid ()Ljava/lang/String; + public final fun getTimestamp ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public synthetic class love/forte/simbot/qguild/event/ChannelCreate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Llove/forte/simbot/qguild/event/ChannelCreate$$serializer; +public synthetic class love/forte/simbot/qguild/event/C2CManagementData$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/C2CManagementData$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ChannelCreate; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/C2CManagementData; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ChannelCreate;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/C2CManagementData;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ChannelCreate$Companion { +public final class love/forte/simbot/qguild/event/C2CManagementData$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ChannelDelete : love/forte/simbot/qguild/event/ChannelDispatch { - public static final field Companion Llove/forte/simbot/qguild/event/ChannelDelete$Companion; - public fun (JLlove/forte/simbot/qguild/event/EventChannel;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/EventChannel; - public final fun copy (JLlove/forte/simbot/qguild/event/EventChannel;)Llove/forte/simbot/qguild/event/ChannelDelete; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ChannelDelete;JLlove/forte/simbot/qguild/event/EventChannel;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ChannelDelete; +public abstract class love/forte/simbot/qguild/event/C2CManagementDispatch : love/forte/simbot/qguild/event/Signal$Dispatch { + public abstract fun getData ()Llove/forte/simbot/qguild/event/C2CManagementData; +} + +public final class love/forte/simbot/qguild/event/C2CMessageCreate : love/forte/simbot/qguild/event/Signal$Dispatch { + public static final field Companion Llove/forte/simbot/qguild/event/C2CMessageCreate$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CMessageCreate$Data;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CMessageCreate$Data;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/C2CMessageCreate$Data; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CMessageCreate$Data;)Llove/forte/simbot/qguild/event/C2CMessageCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/C2CMessageCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CMessageCreate$Data;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/C2CMessageCreate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; - public fun getData ()Llove/forte/simbot/qguild/event/EventChannel; + public fun getData ()Llove/forte/simbot/qguild/event/C2CMessageCreate$Data; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public synthetic class love/forte/simbot/qguild/event/ChannelDelete$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Llove/forte/simbot/qguild/event/ChannelDelete$$serializer; +public synthetic class love/forte/simbot/qguild/event/C2CMessageCreate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/C2CMessageCreate$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ChannelDelete; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/C2CMessageCreate; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ChannelDelete;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/C2CMessageCreate;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ChannelDelete$Companion { +public final class love/forte/simbot/qguild/event/C2CMessageCreate$Author { + public static final field Companion Llove/forte/simbot/qguild/event/C2CMessageCreate$Author$Companion; + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Llove/forte/simbot/qguild/event/C2CMessageCreate$Author; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/C2CMessageCreate$Author;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/C2CMessageCreate$Author; + public fun equals (Ljava/lang/Object;)Z + public final fun getUserOpenid ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/C2CMessageCreate$Author$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/C2CMessageCreate$Author$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/C2CMessageCreate$Author; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/C2CMessageCreate$Author;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/C2CMessageCreate$Author$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract class love/forte/simbot/qguild/event/ChannelDispatch : love/forte/simbot/qguild/event/Signal$Dispatch { - public abstract fun getData ()Llove/forte/simbot/qguild/event/EventChannel; +public final class love/forte/simbot/qguild/event/C2CMessageCreate$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ChannelUpdate : love/forte/simbot/qguild/event/ChannelDispatch { - public static final field Companion Llove/forte/simbot/qguild/event/ChannelUpdate$Companion; - public fun (JLlove/forte/simbot/qguild/event/EventChannel;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/EventChannel; - public final fun copy (JLlove/forte/simbot/qguild/event/EventChannel;)Llove/forte/simbot/qguild/event/ChannelUpdate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ChannelUpdate;JLlove/forte/simbot/qguild/event/EventChannel;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ChannelUpdate; +public final class love/forte/simbot/qguild/event/C2CMessageCreate$Data { + public static final field Companion Llove/forte/simbot/qguild/event/C2CMessageCreate$Data$Companion; + public fun (Ljava/lang/String;Llove/forte/simbot/qguild/event/C2CMessageCreate$Author;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)V + public synthetic fun (Ljava/lang/String;Llove/forte/simbot/qguild/event/C2CMessageCreate$Author;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Llove/forte/simbot/qguild/event/C2CMessageCreate$Author; + public final fun component3 ()Ljava/lang/String; + public final fun component4 ()Ljava/lang/String; + public final fun component5 ()Ljava/util/List; + public final fun copy (Ljava/lang/String;Llove/forte/simbot/qguild/event/C2CMessageCreate$Author;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)Llove/forte/simbot/qguild/event/C2CMessageCreate$Data; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/C2CMessageCreate$Data;Ljava/lang/String;Llove/forte/simbot/qguild/event/C2CMessageCreate$Author;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/C2CMessageCreate$Data; public fun equals (Ljava/lang/Object;)Z - public synthetic fun getData ()Ljava/lang/Object; - public fun getData ()Llove/forte/simbot/qguild/event/EventChannel; + public final fun getAttachments ()Ljava/util/List; + public final fun getAuthor ()Llove/forte/simbot/qguild/event/C2CMessageCreate$Author; + public final fun getContent ()Ljava/lang/String; + public final fun getId ()Ljava/lang/String; + public final fun getTimestamp ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public synthetic class love/forte/simbot/qguild/event/ChannelUpdate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Llove/forte/simbot/qguild/event/ChannelUpdate$$serializer; +public synthetic class love/forte/simbot/qguild/event/C2CMessageCreate$Data$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/C2CMessageCreate$Data$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ChannelUpdate; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/C2CMessageCreate$Data; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ChannelUpdate;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/C2CMessageCreate$Data;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ChannelUpdate$Companion { +public final class love/forte/simbot/qguild/event/C2CMessageCreate$Data$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/DirectMessageCreate : love/forte/simbot/qguild/event/MessageDispatch { - public static final field Companion Llove/forte/simbot/qguild/event/DirectMessageCreate$Companion; - public fun (JLlove/forte/simbot/qguild/model/Message;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/Message; - public final fun copy (JLlove/forte/simbot/qguild/model/Message;)Llove/forte/simbot/qguild/event/DirectMessageCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/DirectMessageCreate;JLlove/forte/simbot/qguild/model/Message;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/DirectMessageCreate; +public final class love/forte/simbot/qguild/event/C2CMsgReceive : love/forte/simbot/qguild/event/C2CManagementDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/C2CMsgReceive$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/C2CManagementData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;)Llove/forte/simbot/qguild/event/C2CMsgReceive; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/C2CMsgReceive;Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/C2CMsgReceive; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; - public fun getData ()Llove/forte/simbot/qguild/model/Message; + public fun getData ()Llove/forte/simbot/qguild/event/C2CManagementData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public synthetic class love/forte/simbot/qguild/event/DirectMessageCreate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Llove/forte/simbot/qguild/event/DirectMessageCreate$$serializer; +public synthetic class love/forte/simbot/qguild/event/C2CMsgReceive$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/C2CMsgReceive$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/DirectMessageCreate; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/C2CMsgReceive; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/DirectMessageCreate;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/C2CMsgReceive;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/DirectMessageCreate$Companion { +public final class love/forte/simbot/qguild/event/C2CMsgReceive$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/EventChannel { - public static final field Companion Llove/forte/simbot/qguild/event/EventChannel$Companion; - public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/ChannelType;Llove/forte/simbot/qguild/model/ChannelSubType;Ljava/lang/String;Ljava/lang/String;)V +public final class love/forte/simbot/qguild/event/C2CMsgReject : love/forte/simbot/qguild/event/C2CManagementDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/C2CMsgReject$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ljava/lang/String; - public final fun component2 ()Ljava/lang/String; - public final fun component3 ()Ljava/lang/String; - public final fun component4 ()Llove/forte/simbot/qguild/model/ChannelType; - public final fun component5 ()Llove/forte/simbot/qguild/model/ChannelSubType; - public final fun component6 ()Ljava/lang/String; - public final fun component7 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/C2CManagementData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;)Llove/forte/simbot/qguild/event/C2CMsgReject; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/C2CMsgReject;Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/C2CMsgReject; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public fun getData ()Llove/forte/simbot/qguild/event/C2CManagementData; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/C2CMsgReject$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/C2CMsgReject$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/C2CMsgReject; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/C2CMsgReject;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/C2CMsgReject$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ChannelCreate : love/forte/simbot/qguild/event/ChannelDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/ChannelCreate$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/EventChannel; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;)Llove/forte/simbot/qguild/event/ChannelCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ChannelCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ChannelCreate; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public fun getData ()Llove/forte/simbot/qguild/event/EventChannel; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/ChannelCreate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/ChannelCreate$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ChannelCreate; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ChannelCreate;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ChannelCreate$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ChannelDelete : love/forte/simbot/qguild/event/ChannelDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/ChannelDelete$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/EventChannel; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;)Llove/forte/simbot/qguild/event/ChannelDelete; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ChannelDelete;Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ChannelDelete; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public fun getData ()Llove/forte/simbot/qguild/event/EventChannel; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/ChannelDelete$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/ChannelDelete$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ChannelDelete; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ChannelDelete;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ChannelDelete$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public abstract class love/forte/simbot/qguild/event/ChannelDispatch : love/forte/simbot/qguild/event/Signal$Dispatch { + public abstract fun getData ()Llove/forte/simbot/qguild/event/EventChannel; +} + +public final class love/forte/simbot/qguild/event/ChannelUpdate : love/forte/simbot/qguild/event/ChannelDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/ChannelUpdate$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/EventChannel; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;)Llove/forte/simbot/qguild/event/ChannelUpdate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ChannelUpdate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventChannel;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ChannelUpdate; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public fun getData ()Llove/forte/simbot/qguild/event/EventChannel; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/ChannelUpdate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/ChannelUpdate$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ChannelUpdate; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ChannelUpdate;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ChannelUpdate$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/DirectMessageCreate : love/forte/simbot/qguild/event/MessageDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/DirectMessageCreate$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/Message; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;)Llove/forte/simbot/qguild/event/DirectMessageCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/DirectMessageCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/DirectMessageCreate; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public fun getData ()Llove/forte/simbot/qguild/model/Message; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/DirectMessageCreate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/DirectMessageCreate$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/DirectMessageCreate; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/DirectMessageCreate;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/DirectMessageCreate$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/EventChannel { + public static final field Companion Llove/forte/simbot/qguild/event/EventChannel$Companion; + public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/ChannelType;Llove/forte/simbot/qguild/model/ChannelSubType;Ljava/lang/String;Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Ljava/lang/String; + public final fun component4 ()Llove/forte/simbot/qguild/model/ChannelType; + public final fun component5 ()Llove/forte/simbot/qguild/model/ChannelSubType; + public final fun component6 ()Ljava/lang/String; + public final fun component7 ()Ljava/lang/String; public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/ChannelType;Llove/forte/simbot/qguild/model/ChannelSubType;Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/event/EventChannel; public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/EventChannel;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/ChannelType;Llove/forte/simbot/qguild/model/ChannelSubType;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/EventChannel; public fun equals (Ljava/lang/Object;)Z @@ -1994,6 +2586,25 @@ public final class love/forte/simbot/qguild/event/EventIntents$ForumsEvent : lov public fun toString ()Ljava/lang/String; } +public final class love/forte/simbot/qguild/event/EventIntents$GroupAndC2CEvent : love/forte/simbot/qguild/event/EventIntents { + public static final field C2C_MESSAGE_CREATE_TYPE Ljava/lang/String; + public static final field C2C_MSG_RECEIVE_TYPE Ljava/lang/String; + public static final field C2C_MSG_REJECT_TYPE Ljava/lang/String; + public static final field FRIEND_ADD_TYPE Ljava/lang/String; + public static final field FRIEND_DEL_TYPE Ljava/lang/String; + public static final field GROUP_ADD_ROBOT_TYPE Ljava/lang/String; + public static final field GROUP_AT_MESSAGE_CREATE_TYPE Ljava/lang/String; + public static final field GROUP_DEL_ROBOT_TYPE Ljava/lang/String; + public static final field GROUP_MSG_RECEIVE_TYPE Ljava/lang/String; + public static final field GROUP_MSG_REJECT_TYPE Ljava/lang/String; + public static final field INSTANCE Llove/forte/simbot/qguild/event/EventIntents$GroupAndC2CEvent; + public fun equals (Ljava/lang/Object;)Z + public static final fun getIntents ()I + public fun getIntentsValue ()I + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + public final class love/forte/simbot/qguild/event/EventIntents$GuildMembers : love/forte/simbot/qguild/event/EventIntents { public static final field GUILD_MEMBER_ADD_TYPE Ljava/lang/String; public static final field GUILD_MEMBER_REMOVE_TYPE Ljava/lang/String; @@ -2139,14 +2750,17 @@ public abstract class love/forte/simbot/qguild/event/ForumDispatch : love/forte/ public final class love/forte/simbot/qguild/event/ForumPostCreate : love/forte/simbot/qguild/event/ForumPostDispatch { public static final field Companion Llove/forte/simbot/qguild/event/ForumPostCreate$Companion; - public fun (JLlove/forte/simbot/qguild/model/forum/Post;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/forum/Post; - public final fun copy (JLlove/forte/simbot/qguild/model/forum/Post;)Llove/forte/simbot/qguild/event/ForumPostCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumPostCreate;JLlove/forte/simbot/qguild/model/forum/Post;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumPostCreate; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Post;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Post;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/forum/Post; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Post;)Llove/forte/simbot/qguild/event/ForumPostCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumPostCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Post;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumPostCreate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; public fun getData ()Llove/forte/simbot/qguild/model/forum/Post; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2168,14 +2782,17 @@ public final class love/forte/simbot/qguild/event/ForumPostCreate$Companion { public final class love/forte/simbot/qguild/event/ForumPostDelete : love/forte/simbot/qguild/event/ForumPostDispatch { public static final field Companion Llove/forte/simbot/qguild/event/ForumPostDelete$Companion; - public fun (JLlove/forte/simbot/qguild/model/forum/Post;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/forum/Post; - public final fun copy (JLlove/forte/simbot/qguild/model/forum/Post;)Llove/forte/simbot/qguild/event/ForumPostDelete; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumPostDelete;JLlove/forte/simbot/qguild/model/forum/Post;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumPostDelete; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Post;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Post;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/forum/Post; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Post;)Llove/forte/simbot/qguild/event/ForumPostDelete; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumPostDelete;Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Post;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumPostDelete; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; public fun getData ()Llove/forte/simbot/qguild/model/forum/Post; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2199,197 +2816,535 @@ public abstract class love/forte/simbot/qguild/event/ForumPostDispatch : love/fo public abstract fun getData ()Llove/forte/simbot/qguild/model/forum/Post; } -public final class love/forte/simbot/qguild/event/ForumPublishAuditResult : love/forte/simbot/qguild/event/ForumDispatch { - public static final field Companion Llove/forte/simbot/qguild/event/ForumPublishAuditResult$Companion; - public fun (JLlove/forte/simbot/qguild/model/forum/AuditResult;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/forum/AuditResult; - public final fun copy (JLlove/forte/simbot/qguild/model/forum/AuditResult;)Llove/forte/simbot/qguild/event/ForumPublishAuditResult; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumPublishAuditResult;JLlove/forte/simbot/qguild/model/forum/AuditResult;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumPublishAuditResult; +public final class love/forte/simbot/qguild/event/ForumPublishAuditResult : love/forte/simbot/qguild/event/ForumDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/ForumPublishAuditResult$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/AuditResult;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/AuditResult;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/forum/AuditResult; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/AuditResult;)Llove/forte/simbot/qguild/event/ForumPublishAuditResult; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumPublishAuditResult;Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/AuditResult;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumPublishAuditResult; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public fun getData ()Llove/forte/simbot/qguild/model/forum/AuditResult; + public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/ForumPublishAuditResult$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumPublishAuditResult$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumPublishAuditResult; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumPublishAuditResult;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ForumPublishAuditResult$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ForumReplyCreate : love/forte/simbot/qguild/event/ForumReplyDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/ForumReplyCreate$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Reply;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Reply;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/forum/Reply; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Reply;)Llove/forte/simbot/qguild/event/ForumReplyCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumReplyCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Reply;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumReplyCreate; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; + public fun getData ()Llove/forte/simbot/qguild/model/forum/Reply; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/ForumReplyCreate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumReplyCreate$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumReplyCreate; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumReplyCreate;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ForumReplyCreate$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ForumReplyDelete : love/forte/simbot/qguild/event/ForumReplyDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/ForumReplyDelete$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Reply;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Reply;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/forum/Reply; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Reply;)Llove/forte/simbot/qguild/event/ForumReplyDelete; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumReplyDelete;Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Reply;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumReplyDelete; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; + public fun getData ()Llove/forte/simbot/qguild/model/forum/Reply; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/ForumReplyDelete$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumReplyDelete$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumReplyDelete; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumReplyDelete;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ForumReplyDelete$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public abstract class love/forte/simbot/qguild/event/ForumReplyDispatch : love/forte/simbot/qguild/event/ForumDispatch { + public abstract fun getData ()Llove/forte/simbot/qguild/model/forum/Reply; +} + +public final class love/forte/simbot/qguild/event/ForumThreadCreate : love/forte/simbot/qguild/event/ForumThreadDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/ForumThreadCreate$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/forum/Thread; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;)Llove/forte/simbot/qguild/event/ForumThreadCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumThreadCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumThreadCreate; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; + public fun getData ()Llove/forte/simbot/qguild/model/forum/Thread; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/ForumThreadCreate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumThreadCreate$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumThreadCreate; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumThreadCreate;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ForumThreadCreate$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ForumThreadDelete : love/forte/simbot/qguild/event/ForumThreadDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/ForumThreadDelete$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/forum/Thread; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;)Llove/forte/simbot/qguild/event/ForumThreadDelete; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumThreadDelete;Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumThreadDelete; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; + public fun getData ()Llove/forte/simbot/qguild/model/forum/Thread; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/ForumThreadDelete$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumThreadDelete$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumThreadDelete; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumThreadDelete;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ForumThreadDelete$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public abstract class love/forte/simbot/qguild/event/ForumThreadDispatch : love/forte/simbot/qguild/event/ForumDispatch { + public abstract fun getData ()Llove/forte/simbot/qguild/model/forum/Thread; +} + +public final class love/forte/simbot/qguild/event/ForumThreadUpdate : love/forte/simbot/qguild/event/ForumThreadDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/ForumThreadUpdate$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/forum/Thread; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;)Llove/forte/simbot/qguild/event/ForumThreadUpdate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumThreadUpdate;Ljava/lang/String;JLlove/forte/simbot/qguild/model/forum/Thread;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumThreadUpdate; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; + public fun getData ()Llove/forte/simbot/qguild/model/forum/Thread; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/ForumThreadUpdate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumThreadUpdate$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumThreadUpdate; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumThreadUpdate;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/ForumThreadUpdate$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/FriendAdd : love/forte/simbot/qguild/event/C2CManagementDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/FriendAdd$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/C2CManagementData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;)Llove/forte/simbot/qguild/event/FriendAdd; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/FriendAdd;Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/FriendAdd; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public fun getData ()Llove/forte/simbot/qguild/event/C2CManagementData; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/FriendAdd$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/FriendAdd$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/FriendAdd; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/FriendAdd;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/FriendAdd$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/FriendDel : love/forte/simbot/qguild/event/C2CManagementDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/FriendDel$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/C2CManagementData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;)Llove/forte/simbot/qguild/event/FriendDel; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/FriendDel;Ljava/lang/String;JLlove/forte/simbot/qguild/event/C2CManagementData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/FriendDel; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public fun getData ()Llove/forte/simbot/qguild/event/C2CManagementData; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/FriendDel$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/FriendDel$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/FriendDel; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/FriendDel;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/FriendDel$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/GroupAddRobot : love/forte/simbot/qguild/event/GroupRobotManagementDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/GroupAddRobot$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/GroupRobotManagementData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;)Llove/forte/simbot/qguild/event/GroupAddRobot; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GroupAddRobot;Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GroupAddRobot; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public fun getData ()Llove/forte/simbot/qguild/event/GroupRobotManagementData; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/GroupAddRobot$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/GroupAddRobot$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/GroupAddRobot; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/GroupAddRobot;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/GroupAddRobot$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/GroupAtMessageCreate : love/forte/simbot/qguild/event/Signal$Dispatch { + public static final field Companion Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupAtMessageCreate$Data;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupAtMessageCreate$Data;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Data; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupAtMessageCreate$Data;)Llove/forte/simbot/qguild/event/GroupAtMessageCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GroupAtMessageCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupAtMessageCreate$Data;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GroupAtMessageCreate; + public fun equals (Ljava/lang/Object;)Z + public synthetic fun getData ()Ljava/lang/Object; + public fun getData ()Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Data; + public fun getId ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/event/GroupAtMessageCreate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/GroupAtMessageCreate$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/GroupAtMessageCreate; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/GroupAtMessageCreate;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/GroupAtMessageCreate$Author { + public static final field Companion Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author$Companion; + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author; public fun equals (Ljava/lang/Object;)Z - public synthetic fun getData ()Ljava/lang/Object; - public fun getData ()Llove/forte/simbot/qguild/model/forum/AuditResult; - public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; + public final fun getMemberOpenid ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public synthetic class love/forte/simbot/qguild/event/ForumPublishAuditResult$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumPublishAuditResult$$serializer; +public synthetic class love/forte/simbot/qguild/event/GroupAtMessageCreate$Author$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumPublishAuditResult; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumPublishAuditResult;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ForumPublishAuditResult$Companion { +public final class love/forte/simbot/qguild/event/GroupAtMessageCreate$Author$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ForumReplyCreate : love/forte/simbot/qguild/event/ForumReplyDispatch { - public static final field Companion Llove/forte/simbot/qguild/event/ForumReplyCreate$Companion; - public fun (JLlove/forte/simbot/qguild/model/forum/Reply;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/forum/Reply; - public final fun copy (JLlove/forte/simbot/qguild/model/forum/Reply;)Llove/forte/simbot/qguild/event/ForumReplyCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumReplyCreate;JLlove/forte/simbot/qguild/model/forum/Reply;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumReplyCreate; +public final class love/forte/simbot/qguild/event/GroupAtMessageCreate$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/event/GroupAtMessageCreate$Data { + public static final field Companion Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Data$Companion; + public fun (Ljava/lang/String;Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)V + public synthetic fun (Ljava/lang/String;Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author; + public final fun component3 ()Ljava/lang/String; + public final fun component4 ()Ljava/lang/String; + public final fun component5 ()Ljava/lang/String; + public final fun component6 ()Ljava/util/List; + public final fun copy (Ljava/lang/String;Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Data; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Data;Ljava/lang/String;Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Data; public fun equals (Ljava/lang/Object;)Z - public synthetic fun getData ()Ljava/lang/Object; - public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; - public fun getData ()Llove/forte/simbot/qguild/model/forum/Reply; + public final fun getAttachments ()Ljava/util/List; + public final fun getAuthor ()Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Author; + public final fun getContent ()Ljava/lang/String; + public final fun getGroupOpenid ()Ljava/lang/String; + public final fun getId ()Ljava/lang/String; + public final fun getTimestamp ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public synthetic class love/forte/simbot/qguild/event/ForumReplyCreate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumReplyCreate$$serializer; +public synthetic class love/forte/simbot/qguild/event/GroupAtMessageCreate$Data$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Data$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumReplyCreate; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Data; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumReplyCreate;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/GroupAtMessageCreate$Data;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ForumReplyCreate$Companion { +public final class love/forte/simbot/qguild/event/GroupAtMessageCreate$Data$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ForumReplyDelete : love/forte/simbot/qguild/event/ForumReplyDispatch { - public static final field Companion Llove/forte/simbot/qguild/event/ForumReplyDelete$Companion; - public fun (JLlove/forte/simbot/qguild/model/forum/Reply;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/forum/Reply; - public final fun copy (JLlove/forte/simbot/qguild/model/forum/Reply;)Llove/forte/simbot/qguild/event/ForumReplyDelete; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumReplyDelete;JLlove/forte/simbot/qguild/model/forum/Reply;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumReplyDelete; +public final class love/forte/simbot/qguild/event/GroupDelRobot : love/forte/simbot/qguild/event/GroupRobotManagementDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/GroupDelRobot$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/GroupRobotManagementData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;)Llove/forte/simbot/qguild/event/GroupDelRobot; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GroupDelRobot;Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GroupDelRobot; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; - public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; - public fun getData ()Llove/forte/simbot/qguild/model/forum/Reply; + public fun getData ()Llove/forte/simbot/qguild/event/GroupRobotManagementData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public synthetic class love/forte/simbot/qguild/event/ForumReplyDelete$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumReplyDelete$$serializer; +public synthetic class love/forte/simbot/qguild/event/GroupDelRobot$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/GroupDelRobot$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumReplyDelete; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/GroupDelRobot; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumReplyDelete;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/GroupDelRobot;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ForumReplyDelete$Companion { +public final class love/forte/simbot/qguild/event/GroupDelRobot$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract class love/forte/simbot/qguild/event/ForumReplyDispatch : love/forte/simbot/qguild/event/ForumDispatch { - public abstract fun getData ()Llove/forte/simbot/qguild/model/forum/Reply; -} - -public final class love/forte/simbot/qguild/event/ForumThreadCreate : love/forte/simbot/qguild/event/ForumThreadDispatch { - public static final field Companion Llove/forte/simbot/qguild/event/ForumThreadCreate$Companion; - public fun (JLlove/forte/simbot/qguild/model/forum/Thread;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/forum/Thread; - public final fun copy (JLlove/forte/simbot/qguild/model/forum/Thread;)Llove/forte/simbot/qguild/event/ForumThreadCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumThreadCreate;JLlove/forte/simbot/qguild/model/forum/Thread;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumThreadCreate; +public final class love/forte/simbot/qguild/event/GroupMsgReceive : love/forte/simbot/qguild/event/GroupRobotManagementDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/GroupMsgReceive$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/GroupRobotManagementData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;)Llove/forte/simbot/qguild/event/GroupMsgReceive; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GroupMsgReceive;Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GroupMsgReceive; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; - public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; - public fun getData ()Llove/forte/simbot/qguild/model/forum/Thread; + public fun getData ()Llove/forte/simbot/qguild/event/GroupRobotManagementData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public synthetic class love/forte/simbot/qguild/event/ForumThreadCreate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumThreadCreate$$serializer; +public synthetic class love/forte/simbot/qguild/event/GroupMsgReceive$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/GroupMsgReceive$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumThreadCreate; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/GroupMsgReceive; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumThreadCreate;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/GroupMsgReceive;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ForumThreadCreate$Companion { +public final class love/forte/simbot/qguild/event/GroupMsgReceive$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ForumThreadDelete : love/forte/simbot/qguild/event/ForumThreadDispatch { - public static final field Companion Llove/forte/simbot/qguild/event/ForumThreadDelete$Companion; - public fun (JLlove/forte/simbot/qguild/model/forum/Thread;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/forum/Thread; - public final fun copy (JLlove/forte/simbot/qguild/model/forum/Thread;)Llove/forte/simbot/qguild/event/ForumThreadDelete; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumThreadDelete;JLlove/forte/simbot/qguild/model/forum/Thread;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumThreadDelete; +public final class love/forte/simbot/qguild/event/GroupMsgReject : love/forte/simbot/qguild/event/GroupRobotManagementDispatch { + public static final field Companion Llove/forte/simbot/qguild/event/GroupMsgReject$Companion; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/GroupRobotManagementData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;)Llove/forte/simbot/qguild/event/GroupMsgReject; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GroupMsgReject;Ljava/lang/String;JLlove/forte/simbot/qguild/event/GroupRobotManagementData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GroupMsgReject; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; - public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; - public fun getData ()Llove/forte/simbot/qguild/model/forum/Thread; + public fun getData ()Llove/forte/simbot/qguild/event/GroupRobotManagementData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public synthetic class love/forte/simbot/qguild/event/ForumThreadDelete$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumThreadDelete$$serializer; +public synthetic class love/forte/simbot/qguild/event/GroupMsgReject$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/GroupMsgReject$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumThreadDelete; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/GroupMsgReject; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumThreadDelete;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/GroupMsgReject;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ForumThreadDelete$Companion { +public final class love/forte/simbot/qguild/event/GroupMsgReject$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } -public abstract class love/forte/simbot/qguild/event/ForumThreadDispatch : love/forte/simbot/qguild/event/ForumDispatch { - public abstract fun getData ()Llove/forte/simbot/qguild/model/forum/Thread; -} - -public final class love/forte/simbot/qguild/event/ForumThreadUpdate : love/forte/simbot/qguild/event/ForumThreadDispatch { - public static final field Companion Llove/forte/simbot/qguild/event/ForumThreadUpdate$Companion; - public fun (JLlove/forte/simbot/qguild/model/forum/Thread;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/forum/Thread; - public final fun copy (JLlove/forte/simbot/qguild/model/forum/Thread;)Llove/forte/simbot/qguild/event/ForumThreadUpdate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/ForumThreadUpdate;JLlove/forte/simbot/qguild/model/forum/Thread;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/ForumThreadUpdate; +public final class love/forte/simbot/qguild/event/GroupRobotManagementData { + public static final field Companion Llove/forte/simbot/qguild/event/GroupRobotManagementData$Companion; + public fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Llove/forte/simbot/qguild/event/GroupRobotManagementData; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GroupRobotManagementData;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GroupRobotManagementData; public fun equals (Ljava/lang/Object;)Z - public synthetic fun getData ()Ljava/lang/Object; - public synthetic fun getData ()Llove/forte/simbot/qguild/model/forum/ForumSourceInfo; - public fun getData ()Llove/forte/simbot/qguild/model/forum/Thread; + public final fun getGroupOpenid ()Ljava/lang/String; + public final fun getOpMemberOpenid ()Ljava/lang/String; + public final fun getTimestamp ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } -public synthetic class love/forte/simbot/qguild/event/ForumThreadUpdate$$serializer : kotlinx/serialization/internal/GeneratedSerializer { - public static final field INSTANCE Llove/forte/simbot/qguild/event/ForumThreadUpdate$$serializer; +public synthetic class love/forte/simbot/qguild/event/GroupRobotManagementData$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/event/GroupRobotManagementData$$serializer; public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; - public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/ForumThreadUpdate; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/event/GroupRobotManagementData; public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V - public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/ForumThreadUpdate;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/event/GroupRobotManagementData;)V public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; } -public final class love/forte/simbot/qguild/event/ForumThreadUpdate$Companion { +public final class love/forte/simbot/qguild/event/GroupRobotManagementData$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public abstract class love/forte/simbot/qguild/event/GroupRobotManagementDispatch : love/forte/simbot/qguild/event/Signal$Dispatch { + public abstract fun getData ()Llove/forte/simbot/qguild/event/GroupRobotManagementData; +} + public final class love/forte/simbot/qguild/event/GuildCreate : love/forte/simbot/qguild/event/EventGuildDispatch { public static final field Companion Llove/forte/simbot/qguild/event/GuildCreate$Companion; - public fun (JLlove/forte/simbot/qguild/event/EventGuild;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/EventGuild; - public final fun copy (JLlove/forte/simbot/qguild/event/EventGuild;)Llove/forte/simbot/qguild/event/GuildCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildCreate;JLlove/forte/simbot/qguild/event/EventGuild;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildCreate; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/EventGuild; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;)Llove/forte/simbot/qguild/event/GuildCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildCreate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/event/EventGuild; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2411,13 +3366,16 @@ public final class love/forte/simbot/qguild/event/GuildCreate$Companion { public final class love/forte/simbot/qguild/event/GuildDelete : love/forte/simbot/qguild/event/EventGuildDispatch { public static final field Companion Llove/forte/simbot/qguild/event/GuildDelete$Companion; - public fun (JLlove/forte/simbot/qguild/event/EventGuild;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/EventGuild; - public final fun copy (JLlove/forte/simbot/qguild/event/EventGuild;)Llove/forte/simbot/qguild/event/GuildDelete; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildDelete;JLlove/forte/simbot/qguild/event/EventGuild;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildDelete; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/EventGuild; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;)Llove/forte/simbot/qguild/event/GuildDelete; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildDelete;Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildDelete; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/event/EventGuild; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2439,13 +3397,16 @@ public final class love/forte/simbot/qguild/event/GuildDelete$Companion { public final class love/forte/simbot/qguild/event/GuildMemberAdd : love/forte/simbot/qguild/event/Signal$Dispatch { public static final field Companion Llove/forte/simbot/qguild/event/GuildMemberAdd$Companion; - public fun (JLlove/forte/simbot/qguild/event/EventMember;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/EventMember; - public final fun copy (JLlove/forte/simbot/qguild/event/EventMember;)Llove/forte/simbot/qguild/event/GuildMemberAdd; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildMemberAdd;JLlove/forte/simbot/qguild/event/EventMember;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildMemberAdd; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/EventMember; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;)Llove/forte/simbot/qguild/event/GuildMemberAdd; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildMemberAdd;Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildMemberAdd; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/event/EventMember; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2467,13 +3428,16 @@ public final class love/forte/simbot/qguild/event/GuildMemberAdd$Companion { public final class love/forte/simbot/qguild/event/GuildMemberRemove : love/forte/simbot/qguild/event/Signal$Dispatch { public static final field Companion Llove/forte/simbot/qguild/event/GuildMemberRemove$Companion; - public fun (JLlove/forte/simbot/qguild/event/EventMember;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/EventMember; - public final fun copy (JLlove/forte/simbot/qguild/event/EventMember;)Llove/forte/simbot/qguild/event/GuildMemberRemove; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildMemberRemove;JLlove/forte/simbot/qguild/event/EventMember;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildMemberRemove; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/EventMember; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;)Llove/forte/simbot/qguild/event/GuildMemberRemove; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildMemberRemove;Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildMemberRemove; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/event/EventMember; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2495,13 +3459,16 @@ public final class love/forte/simbot/qguild/event/GuildMemberRemove$Companion { public final class love/forte/simbot/qguild/event/GuildMemberUpdate : love/forte/simbot/qguild/event/Signal$Dispatch { public static final field Companion Llove/forte/simbot/qguild/event/GuildMemberUpdate$Companion; - public fun (JLlove/forte/simbot/qguild/event/EventMember;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/EventMember; - public final fun copy (JLlove/forte/simbot/qguild/event/EventMember;)Llove/forte/simbot/qguild/event/GuildMemberUpdate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildMemberUpdate;JLlove/forte/simbot/qguild/event/EventMember;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildMemberUpdate; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/EventMember; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;)Llove/forte/simbot/qguild/event/GuildMemberUpdate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildMemberUpdate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventMember;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildMemberUpdate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/event/EventMember; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2523,13 +3490,16 @@ public final class love/forte/simbot/qguild/event/GuildMemberUpdate$Companion { public final class love/forte/simbot/qguild/event/GuildUpdate : love/forte/simbot/qguild/event/EventGuildDispatch { public static final field Companion Llove/forte/simbot/qguild/event/GuildUpdate$Companion; - public fun (JLlove/forte/simbot/qguild/event/EventGuild;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/EventGuild; - public final fun copy (JLlove/forte/simbot/qguild/event/EventGuild;)Llove/forte/simbot/qguild/event/GuildUpdate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildUpdate;JLlove/forte/simbot/qguild/event/EventGuild;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildUpdate; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/EventGuild; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;)Llove/forte/simbot/qguild/event/GuildUpdate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/GuildUpdate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/EventGuild;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/GuildUpdate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/event/EventGuild; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2585,13 +3555,16 @@ public final class love/forte/simbot/qguild/event/Intents$Companion { public final class love/forte/simbot/qguild/event/MessageAuditPass : love/forte/simbot/qguild/event/MessageAuditedDispatch { public static final field Companion Llove/forte/simbot/qguild/event/MessageAuditPass$Companion; - public fun (JLlove/forte/simbot/qguild/model/MessageAudited;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/MessageAudited; - public final fun copy (JLlove/forte/simbot/qguild/model/MessageAudited;)Llove/forte/simbot/qguild/event/MessageAuditPass; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/MessageAuditPass;JLlove/forte/simbot/qguild/model/MessageAudited;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/MessageAuditPass; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/MessageAudited;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/MessageAudited;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/MessageAudited; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/MessageAudited;)Llove/forte/simbot/qguild/event/MessageAuditPass; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/MessageAuditPass;Ljava/lang/String;JLlove/forte/simbot/qguild/model/MessageAudited;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/MessageAuditPass; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/model/MessageAudited; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2613,13 +3586,16 @@ public final class love/forte/simbot/qguild/event/MessageAuditPass$Companion { public final class love/forte/simbot/qguild/event/MessageAuditReject : love/forte/simbot/qguild/event/MessageAuditedDispatch { public static final field Companion Llove/forte/simbot/qguild/event/MessageAuditReject$Companion; - public fun (JLlove/forte/simbot/qguild/model/MessageAudited;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/MessageAudited; - public final fun copy (JLlove/forte/simbot/qguild/model/MessageAudited;)Llove/forte/simbot/qguild/event/MessageAuditReject; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/MessageAuditReject;JLlove/forte/simbot/qguild/model/MessageAudited;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/MessageAuditReject; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/MessageAudited;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/MessageAudited;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/MessageAudited; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/MessageAudited;)Llove/forte/simbot/qguild/event/MessageAuditReject; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/MessageAuditReject;Ljava/lang/String;JLlove/forte/simbot/qguild/model/MessageAudited;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/MessageAuditReject; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/model/MessageAudited; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2645,13 +3621,16 @@ public abstract class love/forte/simbot/qguild/event/MessageAuditedDispatch : lo public final class love/forte/simbot/qguild/event/MessageCreate : love/forte/simbot/qguild/event/MessageDispatch { public static final field Companion Llove/forte/simbot/qguild/event/MessageCreate$Companion; - public fun (JLlove/forte/simbot/qguild/model/Message;)V - public final fun component2 ()Llove/forte/simbot/qguild/model/Message; - public final fun copy (JLlove/forte/simbot/qguild/model/Message;)Llove/forte/simbot/qguild/event/MessageCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/MessageCreate;JLlove/forte/simbot/qguild/model/Message;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/MessageCreate; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/model/Message; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;)Llove/forte/simbot/qguild/event/MessageCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/MessageCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/model/Message;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/MessageCreate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/model/Message; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2673,13 +3652,16 @@ public final class love/forte/simbot/qguild/event/MessageCreate$Companion { public final class love/forte/simbot/qguild/event/MessageDelete : love/forte/simbot/qguild/event/Signal$Dispatch { public static final field Companion Llove/forte/simbot/qguild/event/MessageDelete$Companion; - public fun (JLkotlin/Unit;)V - public final fun component2 ()V - public final fun copy (JLkotlin/Unit;)Llove/forte/simbot/qguild/event/MessageDelete; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/MessageDelete;JLkotlin/Unit;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/MessageDelete; + public fun (Ljava/lang/String;JLkotlin/Unit;)V + public synthetic fun (Ljava/lang/String;JLkotlin/Unit;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()V + public final fun copy (Ljava/lang/String;JLkotlin/Unit;)Llove/forte/simbot/qguild/event/MessageDelete; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/MessageDelete;Ljava/lang/String;JLkotlin/Unit;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/MessageDelete; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Lkotlin/Unit; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2780,14 +3762,17 @@ public abstract class love/forte/simbot/qguild/event/OpenForumEventData : love/f public final class love/forte/simbot/qguild/event/OpenForumPostCreate : love/forte/simbot/qguild/event/OpenForumPostDispatch { public static final field Companion Llove/forte/simbot/qguild/event/OpenForumPostCreate$Companion; - public fun (JLlove/forte/simbot/qguild/event/OpenForumPostData;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/OpenForumPostData; - public final fun copy (JLlove/forte/simbot/qguild/event/OpenForumPostData;)Llove/forte/simbot/qguild/event/OpenForumPostCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumPostCreate;JLlove/forte/simbot/qguild/event/OpenForumPostData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumPostCreate; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumPostData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumPostData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/OpenForumPostData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumPostData;)Llove/forte/simbot/qguild/event/OpenForumPostCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumPostCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumPostData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumPostCreate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public synthetic fun getData ()Llove/forte/simbot/qguild/event/OpenForumEventData; public fun getData ()Llove/forte/simbot/qguild/event/OpenForumPostData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2840,14 +3825,17 @@ public final class love/forte/simbot/qguild/event/OpenForumPostData$Companion { public final class love/forte/simbot/qguild/event/OpenForumPostDelete : love/forte/simbot/qguild/event/OpenForumPostDispatch { public static final field Companion Llove/forte/simbot/qguild/event/OpenForumPostDelete$Companion; - public fun (JLlove/forte/simbot/qguild/event/OpenForumPostData;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/OpenForumPostData; - public final fun copy (JLlove/forte/simbot/qguild/event/OpenForumPostData;)Llove/forte/simbot/qguild/event/OpenForumPostDelete; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumPostDelete;JLlove/forte/simbot/qguild/event/OpenForumPostData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumPostDelete; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumPostData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumPostData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/OpenForumPostData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumPostData;)Llove/forte/simbot/qguild/event/OpenForumPostDelete; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumPostDelete;Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumPostData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumPostDelete; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public synthetic fun getData ()Llove/forte/simbot/qguild/event/OpenForumEventData; public fun getData ()Llove/forte/simbot/qguild/event/OpenForumPostData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2873,14 +3861,17 @@ public abstract class love/forte/simbot/qguild/event/OpenForumPostDispatch : lov public final class love/forte/simbot/qguild/event/OpenForumReplyCreate : love/forte/simbot/qguild/event/OpenForumReplyDispatch { public static final field Companion Llove/forte/simbot/qguild/event/OpenForumReplyCreate$Companion; - public fun (JLlove/forte/simbot/qguild/event/OpenForumReplyData;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/OpenForumReplyData; - public final fun copy (JLlove/forte/simbot/qguild/event/OpenForumReplyData;)Llove/forte/simbot/qguild/event/OpenForumReplyCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumReplyCreate;JLlove/forte/simbot/qguild/event/OpenForumReplyData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumReplyCreate; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumReplyData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumReplyData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/OpenForumReplyData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumReplyData;)Llove/forte/simbot/qguild/event/OpenForumReplyCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumReplyCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumReplyData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumReplyCreate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public synthetic fun getData ()Llove/forte/simbot/qguild/event/OpenForumEventData; public fun getData ()Llove/forte/simbot/qguild/event/OpenForumReplyData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2933,14 +3924,17 @@ public final class love/forte/simbot/qguild/event/OpenForumReplyData$Companion { public final class love/forte/simbot/qguild/event/OpenForumReplyDelete : love/forte/simbot/qguild/event/OpenForumReplyDispatch { public static final field Companion Llove/forte/simbot/qguild/event/OpenForumReplyDelete$Companion; - public fun (JLlove/forte/simbot/qguild/event/OpenForumReplyData;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/OpenForumReplyData; - public final fun copy (JLlove/forte/simbot/qguild/event/OpenForumReplyData;)Llove/forte/simbot/qguild/event/OpenForumReplyDelete; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumReplyDelete;JLlove/forte/simbot/qguild/event/OpenForumReplyData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumReplyDelete; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumReplyData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumReplyData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/OpenForumReplyData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumReplyData;)Llove/forte/simbot/qguild/event/OpenForumReplyDelete; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumReplyDelete;Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumReplyData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumReplyDelete; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public synthetic fun getData ()Llove/forte/simbot/qguild/event/OpenForumEventData; public fun getData ()Llove/forte/simbot/qguild/event/OpenForumReplyData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2966,14 +3960,17 @@ public abstract class love/forte/simbot/qguild/event/OpenForumReplyDispatch : lo public final class love/forte/simbot/qguild/event/OpenForumThreadCreate : love/forte/simbot/qguild/event/OpenForumThreadDispatch { public static final field Companion Llove/forte/simbot/qguild/event/OpenForumThreadCreate$Companion; - public fun (JLlove/forte/simbot/qguild/event/OpenForumThreadData;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/OpenForumThreadData; - public final fun copy (JLlove/forte/simbot/qguild/event/OpenForumThreadData;)Llove/forte/simbot/qguild/event/OpenForumThreadCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumThreadCreate;JLlove/forte/simbot/qguild/event/OpenForumThreadData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumThreadCreate; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/OpenForumThreadData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;)Llove/forte/simbot/qguild/event/OpenForumThreadCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumThreadCreate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumThreadCreate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public synthetic fun getData ()Llove/forte/simbot/qguild/event/OpenForumEventData; public fun getData ()Llove/forte/simbot/qguild/event/OpenForumThreadData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -3026,14 +4023,17 @@ public final class love/forte/simbot/qguild/event/OpenForumThreadData$Companion public final class love/forte/simbot/qguild/event/OpenForumThreadDelete : love/forte/simbot/qguild/event/OpenForumThreadDispatch { public static final field Companion Llove/forte/simbot/qguild/event/OpenForumThreadDelete$Companion; - public fun (JLlove/forte/simbot/qguild/event/OpenForumThreadData;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/OpenForumThreadData; - public final fun copy (JLlove/forte/simbot/qguild/event/OpenForumThreadData;)Llove/forte/simbot/qguild/event/OpenForumThreadDelete; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumThreadDelete;JLlove/forte/simbot/qguild/event/OpenForumThreadData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumThreadDelete; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/OpenForumThreadData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;)Llove/forte/simbot/qguild/event/OpenForumThreadDelete; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumThreadDelete;Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumThreadDelete; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public synthetic fun getData ()Llove/forte/simbot/qguild/event/OpenForumEventData; public fun getData ()Llove/forte/simbot/qguild/event/OpenForumThreadData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -3059,14 +4059,17 @@ public abstract class love/forte/simbot/qguild/event/OpenForumThreadDispatch : l public final class love/forte/simbot/qguild/event/OpenForumThreadUpdate : love/forte/simbot/qguild/event/OpenForumThreadDispatch { public static final field Companion Llove/forte/simbot/qguild/event/OpenForumThreadUpdate$Companion; - public fun (JLlove/forte/simbot/qguild/event/OpenForumThreadData;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/OpenForumThreadData; - public final fun copy (JLlove/forte/simbot/qguild/event/OpenForumThreadData;)Llove/forte/simbot/qguild/event/OpenForumThreadUpdate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumThreadUpdate;JLlove/forte/simbot/qguild/event/OpenForumThreadData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumThreadUpdate; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/OpenForumThreadData; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;)Llove/forte/simbot/qguild/event/OpenForumThreadUpdate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/OpenForumThreadUpdate;Ljava/lang/String;JLlove/forte/simbot/qguild/event/OpenForumThreadData;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/OpenForumThreadUpdate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public synthetic fun getData ()Llove/forte/simbot/qguild/event/OpenForumEventData; public fun getData ()Llove/forte/simbot/qguild/event/OpenForumThreadData; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -3088,13 +4091,16 @@ public final class love/forte/simbot/qguild/event/OpenForumThreadUpdate$Companio public final class love/forte/simbot/qguild/event/PublicMessageDeleteCreate : love/forte/simbot/qguild/event/Signal$Dispatch { public static final field Companion Llove/forte/simbot/qguild/event/PublicMessageDeleteCreate$Companion; - public fun (JLkotlin/Unit;)V - public final fun component2 ()V - public final fun copy (JLkotlin/Unit;)Llove/forte/simbot/qguild/event/PublicMessageDeleteCreate; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/PublicMessageDeleteCreate;JLkotlin/Unit;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/PublicMessageDeleteCreate; + public fun (Ljava/lang/String;JLkotlin/Unit;)V + public synthetic fun (Ljava/lang/String;JLkotlin/Unit;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()V + public final fun copy (Ljava/lang/String;JLkotlin/Unit;)Llove/forte/simbot/qguild/event/PublicMessageDeleteCreate; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/PublicMessageDeleteCreate;Ljava/lang/String;JLkotlin/Unit;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/PublicMessageDeleteCreate; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Lkotlin/Unit; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -3116,13 +4122,16 @@ public final class love/forte/simbot/qguild/event/PublicMessageDeleteCreate$Comp public final class love/forte/simbot/qguild/event/Ready : love/forte/simbot/qguild/event/Signal$Dispatch { public static final field Companion Llove/forte/simbot/qguild/event/Ready$Companion; - public fun (JLlove/forte/simbot/qguild/event/Ready$Data;)V - public final fun component2 ()Llove/forte/simbot/qguild/event/Ready$Data; - public final fun copy (JLlove/forte/simbot/qguild/event/Ready$Data;)Llove/forte/simbot/qguild/event/Ready; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/Ready;JLlove/forte/simbot/qguild/event/Ready$Data;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/Ready; + public fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/Ready$Data;)V + public synthetic fun (Ljava/lang/String;JLlove/forte/simbot/qguild/event/Ready$Data;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Llove/forte/simbot/qguild/event/Ready$Data; + public final fun copy (Ljava/lang/String;JLlove/forte/simbot/qguild/event/Ready$Data;)Llove/forte/simbot/qguild/event/Ready; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/Ready;Ljava/lang/String;JLlove/forte/simbot/qguild/event/Ready$Data;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/Ready; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Llove/forte/simbot/qguild/event/Ready$Data; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -3183,13 +4192,16 @@ public abstract interface class love/forte/simbot/qguild/event/ReceivedSignal { public final class love/forte/simbot/qguild/event/Resumed : love/forte/simbot/qguild/event/Signal$Dispatch { public static final field Companion Llove/forte/simbot/qguild/event/Resumed$Companion; - public fun (JLjava/lang/String;)V - public final fun component2 ()Ljava/lang/String; - public final fun copy (JLjava/lang/String;)Llove/forte/simbot/qguild/event/Resumed; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/Resumed;JLjava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/Resumed; + public fun (Ljava/lang/String;JLjava/lang/String;)V + public synthetic fun (Ljava/lang/String;JLjava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;JLjava/lang/String;)Llove/forte/simbot/qguild/event/Resumed; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/Resumed;Ljava/lang/String;JLjava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/Resumed; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Ljava/lang/String; + public fun getId ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -3253,6 +4265,7 @@ public abstract class love/forte/simbot/qguild/event/Signal$Dispatch : love/fort public static final field DISPATCH_CLASS_DISCRIMINATOR Ljava/lang/String; public synthetic fun (ILlove/forte/simbot/qguild/event/Opcode;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V public abstract fun getData ()Ljava/lang/Object; + public abstract fun getId ()Ljava/lang/String; protected abstract fun getS ()J public final fun getSeq ()J public static final synthetic fun write$Self (Llove/forte/simbot/qguild/event/Signal$Dispatch;Lkotlinx/serialization/encoding/CompositeEncoder;Lkotlinx/serialization/descriptors/SerialDescriptor;)V @@ -3265,13 +4278,15 @@ public final class love/forte/simbot/qguild/event/Signal$Dispatch$Companion { } public final class love/forte/simbot/qguild/event/Signal$Dispatch$Unknown : love/forte/simbot/qguild/event/Signal$Dispatch { - public final fun component2 ()Lkotlinx/serialization/json/JsonElement; - public final fun component3 ()Ljava/lang/String; - public final fun copy (JLkotlinx/serialization/json/JsonElement;Ljava/lang/String;)Llove/forte/simbot/qguild/event/Signal$Dispatch$Unknown; - public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/Signal$Dispatch$Unknown;JLkotlinx/serialization/json/JsonElement;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/Signal$Dispatch$Unknown; + public final fun component1 ()Ljava/lang/String; + public final fun component3 ()Lkotlinx/serialization/json/JsonElement; + public final fun component4 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;JLkotlinx/serialization/json/JsonElement;Ljava/lang/String;)Llove/forte/simbot/qguild/event/Signal$Dispatch$Unknown; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/event/Signal$Dispatch$Unknown;Ljava/lang/String;JLkotlinx/serialization/json/JsonElement;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/event/Signal$Dispatch$Unknown; public fun equals (Ljava/lang/Object;)Z public synthetic fun getData ()Ljava/lang/Object; public fun getData ()Lkotlinx/serialization/json/JsonElement; + public fun getId ()Ljava/lang/String; public final fun getRaw ()Ljava/lang/String; public fun hashCode ()I public fun toString ()Ljava/lang/String; @@ -4180,6 +5195,7 @@ public final class love/forte/simbot/qguild/model/Message$Embed$Thumbnail$Compan public final class love/forte/simbot/qguild/model/Message$Markdown { public static final field Companion Llove/forte/simbot/qguild/model/Message$Markdown$Companion; + public fun ()V public fun (Ljava/lang/Integer;Ljava/lang/String;Llove/forte/simbot/qguild/model/Message$Markdown$Params;Ljava/lang/String;)V public synthetic fun (Ljava/lang/Integer;Ljava/lang/String;Llove/forte/simbot/qguild/model/Message$Markdown$Params;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Ljava/lang/Integer; @@ -4188,6 +5204,11 @@ public final class love/forte/simbot/qguild/model/Message$Markdown { public final fun component4 ()Ljava/lang/String; public final fun copy (Ljava/lang/Integer;Ljava/lang/String;Llove/forte/simbot/qguild/model/Message$Markdown$Params;Ljava/lang/String;)Llove/forte/simbot/qguild/model/Message$Markdown; public static synthetic fun copy$default (Llove/forte/simbot/qguild/model/Message$Markdown;Ljava/lang/Integer;Ljava/lang/String;Llove/forte/simbot/qguild/model/Message$Markdown$Params;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/model/Message$Markdown; + public static final fun createByContent (Ljava/lang/String;)Llove/forte/simbot/qguild/model/Message$Markdown; + public static final fun createByCustomTemplateId (Ljava/lang/String;)Llove/forte/simbot/qguild/model/Message$Markdown; + public static final fun createByCustomTemplateId (Ljava/lang/String;Llove/forte/simbot/qguild/model/Message$Markdown$Params;)Llove/forte/simbot/qguild/model/Message$Markdown; + public static final fun createByTemplateId (I)Llove/forte/simbot/qguild/model/Message$Markdown; + public static final fun createByTemplateId (ILlove/forte/simbot/qguild/model/Message$Markdown$Params;)Llove/forte/simbot/qguild/model/Message$Markdown; public fun equals (Ljava/lang/Object;)Z public final fun getContent ()Ljava/lang/String; public final fun getCustomTemplateId ()Ljava/lang/String; @@ -4209,6 +5230,13 @@ public synthetic class love/forte/simbot/qguild/model/Message$Markdown$$serializ } public final class love/forte/simbot/qguild/model/Message$Markdown$Companion { + public final fun createByContent (Ljava/lang/String;)Llove/forte/simbot/qguild/model/Message$Markdown; + public final fun createByCustomTemplateId (Ljava/lang/String;)Llove/forte/simbot/qguild/model/Message$Markdown; + public final fun createByCustomTemplateId (Ljava/lang/String;Llove/forte/simbot/qguild/model/Message$Markdown$Params;)Llove/forte/simbot/qguild/model/Message$Markdown; + public static synthetic fun createByCustomTemplateId$default (Llove/forte/simbot/qguild/model/Message$Markdown$Companion;Ljava/lang/String;Llove/forte/simbot/qguild/model/Message$Markdown$Params;ILjava/lang/Object;)Llove/forte/simbot/qguild/model/Message$Markdown; + public final fun createByTemplateId (I)Llove/forte/simbot/qguild/model/Message$Markdown; + public final fun createByTemplateId (ILlove/forte/simbot/qguild/model/Message$Markdown$Params;)Llove/forte/simbot/qguild/model/Message$Markdown; + public static synthetic fun createByTemplateId$default (Llove/forte/simbot/qguild/model/Message$Markdown$Companion;ILlove/forte/simbot/qguild/model/Message$Markdown$Params;ILjava/lang/Object;)Llove/forte/simbot/qguild/model/Message$Markdown; public final fun serializer ()Lkotlinx/serialization/KSerializer; } @@ -4311,6 +5339,180 @@ public final class love/forte/simbot/qguild/model/MessageAudited$Companion { public final fun serializer ()Lkotlinx/serialization/KSerializer; } +public final class love/forte/simbot/qguild/model/MessageKeyboard { + public static final field Companion Llove/forte/simbot/qguild/model/MessageKeyboard$Companion; + public fun ()V + public fun (Ljava/lang/String;Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData;Llove/forte/simbot/qguild/model/MessageKeyboard$Action;)V + public synthetic fun (Ljava/lang/String;Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData;Llove/forte/simbot/qguild/model/MessageKeyboard$Action;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData; + public final fun component3 ()Llove/forte/simbot/qguild/model/MessageKeyboard$Action; + public final fun copy (Ljava/lang/String;Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData;Llove/forte/simbot/qguild/model/MessageKeyboard$Action;)Llove/forte/simbot/qguild/model/MessageKeyboard; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/model/MessageKeyboard;Ljava/lang/String;Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData;Llove/forte/simbot/qguild/model/MessageKeyboard$Action;ILjava/lang/Object;)Llove/forte/simbot/qguild/model/MessageKeyboard; + public static final fun create (Ljava/lang/String;)Llove/forte/simbot/qguild/model/MessageKeyboard; + public fun equals (Ljava/lang/Object;)Z + public final fun getAction ()Llove/forte/simbot/qguild/model/MessageKeyboard$Action; + public final fun getId ()Ljava/lang/String; + public final fun getRenderData ()Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/model/MessageKeyboard$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/model/MessageKeyboard$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/model/MessageKeyboard; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/model/MessageKeyboard;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/MessageKeyboard$Action { + public static final field Companion Llove/forte/simbot/qguild/model/MessageKeyboard$Action$Companion; + public fun (Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;)V + public synthetic fun (Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()Ljava/lang/Boolean; + public final fun component4 ()Ljava/lang/Boolean; + public final fun component5 ()Ljava/lang/Integer; + public final fun component6 ()Ljava/lang/String; + public final fun copy (Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;)Llove/forte/simbot/qguild/model/MessageKeyboard$Action; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/model/MessageKeyboard$Action;Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/model/MessageKeyboard$Action; + public fun equals (Ljava/lang/Object;)Z + public final fun getAnchor ()Ljava/lang/Integer; + public final fun getData ()Ljava/lang/String; + public final fun getEnter ()Ljava/lang/Boolean; + public final fun getPermission ()Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission; + public final fun getReply ()Ljava/lang/Boolean; + public final fun getUnsupportTips ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/model/MessageKeyboard$Action$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/model/MessageKeyboard$Action$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/model/MessageKeyboard$Action; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/model/MessageKeyboard$Action;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/MessageKeyboard$Action$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/MessageKeyboard$ActionPermission { + public static final field Companion Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission$Companion; + public fun (ILjava/util/List;Ljava/util/List;)V + public synthetic fun (ILjava/util/List;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()I + public final fun component2 ()Ljava/util/List; + public final fun component3 ()Ljava/util/List; + public final fun copy (ILjava/util/List;Ljava/util/List;)Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission;ILjava/util/List;Ljava/util/List;ILjava/lang/Object;)Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission; + public fun equals (Ljava/lang/Object;)Z + public final fun getSpecifyRoleIds ()Ljava/util/List; + public final fun getSpecifyUserIds ()Ljava/util/List; + public final fun getType ()I + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/model/MessageKeyboard$ActionPermission$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/model/MessageKeyboard$ActionPermission;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/MessageKeyboard$ActionPermission$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/MessageKeyboard$Companion { + public final fun create (Ljava/lang/String;)Llove/forte/simbot/qguild/model/MessageKeyboard; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/MessageKeyboard$RenderData { + public static final field Companion Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData$Companion; + public fun (Ljava/lang/String;Ljava/lang/String;I)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()I + public final fun copy (Ljava/lang/String;Ljava/lang/String;I)Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData;Ljava/lang/String;Ljava/lang/String;IILjava/lang/Object;)Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData; + public fun equals (Ljava/lang/Object;)Z + public final fun getLabel ()Ljava/lang/String; + public final fun getStyle ()I + public final fun getVisitedLabel ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/model/MessageKeyboard$RenderData$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/model/MessageKeyboard$RenderData;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/MessageKeyboard$RenderData$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/MessageMedia { + public static final field Companion Llove/forte/simbot/qguild/model/MessageMedia$Companion; + public fun (Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V + public synthetic fun (Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public final fun component1 ()Ljava/lang/String; + public final fun component2 ()Ljava/lang/String; + public final fun component3 ()I + public final fun component4 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)Llove/forte/simbot/qguild/model/MessageMedia; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/model/MessageMedia;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/model/MessageMedia; + public fun equals (Ljava/lang/Object;)Z + public final fun getFileInfo ()Ljava/lang/String; + public final fun getFileUuid ()Ljava/lang/String; + public final fun getId ()Ljava/lang/String; + public final fun getTtl ()I + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/model/MessageMedia$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/model/MessageMedia$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/model/MessageMedia; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/model/MessageMedia;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/MessageMedia$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/MessageMediaKt { + public static final fun forSend (Llove/forte/simbot/qguild/model/MessageMedia;)Llove/forte/simbot/qguild/model/SendMessageMedia; +} + public final class love/forte/simbot/qguild/model/MessageMember : love/forte/simbot/qguild/model/Member { public static final field Companion Llove/forte/simbot/qguild/model/MessageMember$Companion; public fun ()V @@ -4583,6 +5785,33 @@ public final class love/forte/simbot/qguild/model/Schedule$RemindTypes { public static final field NO_REMIND Ljava/lang/String; } +public final class love/forte/simbot/qguild/model/SendMessageMedia { + public static final field Companion Llove/forte/simbot/qguild/model/SendMessageMedia$Companion; + public fun (Ljava/lang/String;)V + public final fun component1 ()Ljava/lang/String; + public final fun copy (Ljava/lang/String;)Llove/forte/simbot/qguild/model/SendMessageMedia; + public static synthetic fun copy$default (Llove/forte/simbot/qguild/model/SendMessageMedia;Ljava/lang/String;ILjava/lang/Object;)Llove/forte/simbot/qguild/model/SendMessageMedia; + public fun equals (Ljava/lang/Object;)Z + public final fun getFileInfo ()Ljava/lang/String; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/qguild/model/SendMessageMedia$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/qguild/model/SendMessageMedia$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/qguild/model/SendMessageMedia; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/qguild/model/SendMessageMedia;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/qguild/model/SendMessageMedia$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + public final class love/forte/simbot/qguild/model/SimpleChannel : love/forte/simbot/qguild/model/Channel { public static final field Companion Llove/forte/simbot/qguild/model/SimpleChannel$Companion; public synthetic fun (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/ChannelType;Llove/forte/simbot/qguild/model/ChannelSubType;ILjava/lang/String;Ljava/lang/String;Llove/forte/simbot/qguild/model/PrivateType;Llove/forte/simbot/qguild/model/SpeakPermission;Ljava/lang/String;Llove/forte/simbot/qguild/model/Permissions;ILkotlin/jvm/internal/DefaultConstructorMarker;)V diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/annotations.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/annotations.kt index a641a7e1..30c84386 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/annotations.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/annotations.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023. ForteScarlet. + * Copyright (c) 2023-2024. ForteScarlet. * * This file is part of simbot-component-qq-guild. * @@ -20,10 +20,11 @@ package love.forte.simbot.qguild /** * 标记一个类型为作为QQ频道中定义的对象模型。 * - * 这些类型对于使用者来讲应当仅作为API响应的**反序列化**结果使用, - * 避免直接构造它们。 + * 这些类型对使用者来讲应当仅作为API交互时的**序列化**内容使用, + * 尽量避免直接使用它们的构造函数,避免因不兼容变更而产生异常。 * - * [ApiModel] 标记的类型可能会随着官方文档的更新而更新,**不保证**未来的更新不会出现破坏性。 + * [ApiModel] 标记的类型可能会随着官方文档的更新而更新, + * **不保证**未来的更新不会出现破坏性。 * * _此注解目前的作用仅用于源码标记_ */ diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/ApiRequests.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/ApiRequests.kt index 1a9bebf3..29162f98 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/ApiRequests.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/ApiRequests.kt @@ -43,20 +43,30 @@ import kotlin.contracts.InvocationKind import kotlin.contracts.contract import kotlin.jvm.JvmMultifileClass import kotlin.jvm.JvmName +import kotlin.jvm.JvmOverloads import kotlin.jvm.JvmSynthetic +/** + * 格式值:"BOT_APPID", 机器人 AppID + */ +public const val X_UNION_APPID_HEADER: String = "X-Union-Appid" + /** * 使用 [client] 向当前目标 API [QQGuildApi] 发起请求。 * + * see [鉴权方式](https://bot.q.qq.com/wiki/develop/api-v2/dev-prepare/interface-framework/api-use.html#鉴权方式) + * * @param server 如果不为 null 则会取 [server] 中的 [Url.protocol]、[Url.hostWithPort] * 替换 [QQGuildApi.url] 中提供的值。 * */ @JvmSynthetic +@JvmOverloads // 二进制兼容 public suspend fun QQGuildApi.request( client: HttpClient, - token: String, - server: Url? = null + token: String? = null, + server: Url? = null, + appId: String? = null, ): HttpResponse { val api = this @@ -64,7 +74,9 @@ public suspend fun QQGuildApi.request( method = api.method headers { - this[HttpHeaders.Authorization] = token + token?.also { this[HttpHeaders.Authorization] = it } + appId?.also { this[X_UNION_APPID_HEADER] = it } + with(api.headers) { if (!isEmpty()) { appendAll(api.headers) @@ -127,15 +139,21 @@ public suspend fun QQGuildApi.request( @OptIn(ExperimentalContracts::class) public suspend inline fun QQGuildApi.requestText( client: HttpClient, - token: String, - server: Url = QQGuild.URL, + token: String?, + server: Url? = QQGuild.URL, + appId: String? = null, useResp: (HttpResponse) -> Unit = {} ): String { contract { callsInPlace(useResp, InvocationKind.EXACTLY_ONCE) } - val resp = request(client, token, server) + val resp = request( + client = client, + token = token, + server = server, + appId = appId + ) useResp(resp) val text = resp.bodyAsText() @@ -175,14 +193,16 @@ public suspend inline fun QQGuildApi.requestText( * @see ErrInfo */ @JvmSynthetic +@JvmOverloads public suspend fun QQGuildApi.requestData( client: HttpClient, - token: String, - server: Url = QQGuild.URL, + token: String?, + server: Url? = QQGuild.URL, decoder: Json = QQGuild.DefaultJson, + appId: String? = null, ): R { val resp: HttpResponse - val text = requestText(client, token, server) { resp = it } + val text = requestText(client, token, server, appId) { resp = it } checkStatus(text, QQGuild.DefaultJson, resp.status, resp) diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/app/GetAppAccessTokenApi.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/app/GetAppAccessTokenApi.kt new file mode 100644 index 00000000..24b2d0e4 --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/app/GetAppAccessTokenApi.kt @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.api.app + +import io.ktor.http.* +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import love.forte.simbot.qguild.ApiModel +import love.forte.simbot.qguild.api.PostQQGuildApi +import kotlin.jvm.JvmField +import kotlin.jvm.JvmStatic + + +/** + * [获取调用凭证](https://bot.q.qq.com/wiki/develop/api-v2/dev-prepare/interface-framework/api-use.html#获取调用凭证) + * + * 这个API似乎是一个特殊的API,它有自己的HTTP URL: `https://bots.qq.com/app/getAppAccessToken`, + * 使用时需要专门处理。 + * + * @author ForteScarlet + */ +public class GetAppAccessTokenApi private constructor( + override val body: Body +) : PostQQGuildApi() { + public companion object Factory { + public const val HTTP_URL_STRING: String = "https://bots.qq.com" + + @JvmField + public val httpUrl: Url = Url(HTTP_URL_STRING) + + private val PATH = arrayOf("app", "getAppAccessToken") + + /** + * Create [GetAppAccessTokenApi]. + */ + @JvmStatic + public fun create( + appId: String, + clientSecret: String + ): GetAppAccessTokenApi = GetAppAccessTokenApi(Body(appId, clientSecret)) + } + + + override val resultDeserializationStrategy: DeserializationStrategy + get() = AppAccessToken.serializer() + + override val path: Array + get() = PATH + + override fun createBody(): Any = body + + override val url: Url = URLBuilder(httpUrl).apply { + appendEncodedPathSegments(components = PATH) + }.build() + + @Serializable + public data class Body( + val appId: String, + val clientSecret: String + ) +} + +/** + * Result of [GetAppAccessTokenApi] + * @property accessToken 获取到的凭证。 + * @property expiresIn 凭证有效时间,单位:秒。目前是7200秒之内的值。 + */ +@ApiModel +@Serializable +public data class AppAccessToken( + @SerialName("access_token") + val accessToken: String, + @SerialName("expires_in") + val expiresIn: Int, +) diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/files/UploadGroupFilesApi.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/files/UploadGroupFilesApi.kt new file mode 100644 index 00000000..7ec15fad --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/files/UploadGroupFilesApi.kt @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.api.files + +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import love.forte.simbot.qguild.api.PostQQGuildApi +import love.forte.simbot.qguild.api.SimplePostApiDescription +import love.forte.simbot.qguild.model.MessageMedia +import kotlin.jvm.JvmOverloads +import kotlin.jvm.JvmStatic + + +/** + * [富媒体消息-群聊](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/send-receive/rich-media.html#用于群聊) + * + * @author ForteScarlet + */ +public class UploadGroupFilesApi private constructor( + openid: String, + private val _body: Body +) : PostQQGuildApi() { + public companion object Factory : SimplePostApiDescription( + "/v2/groups/{group_openid}/files" + ) { + public const val FILE_TYPE_IMAGE: Int = 1 + public const val FILE_TYPE_VIDEO: Int = 2 + public const val FILE_TYPE_AUDIO: Int = 3 + public const val FILE_TYPE_FILE: Int = 4 + + /** + * Create [UploadGroupFilesApi]. + * + * @param openid 群聊的 openid + */ + @JvmStatic + public fun create(openid: String, body: Body): UploadGroupFilesApi = + UploadGroupFilesApi(openid, body) + + /** + * Create [UploadGroupFilesApi]. + * + * @param openid 群聊的 openid + * @param fileType 媒体类型:1 图片,2 视频,3 语音,4 文件(暂不开放) + * 资源格式要求: + * 图片:png/jpg,视频:mp4,语音:silk + * @param url 需要发送媒体资源的url + * @param srvSendMsg 设置 true 会直接发送消息到目标端,且会占用主动消息频次 + */ + @JvmStatic + @JvmOverloads + public fun create( + openid: String, + fileType: Int, + url: String, + srvSendMsg: Boolean = false + ): UploadGroupFilesApi = + create( + openid, + Body( + fileType = fileType, + url = url, + srvSendMsg = srvSendMsg + ) + ) + + } + + override val resultDeserializationStrategy: DeserializationStrategy + get() = MessageMedia.serializer() + + override val path: Array = arrayOf("v2", "groups", openid, "files") + + override fun createBody(): Any = _body + + /** + * @property fileType 媒体类型:1 图片,2 视频,3 语音,4 文件(暂不开放) + * 资源格式要求: + * 图片:png/jpg,视频:mp4,语音:silk + * @property url 需要发送媒体资源的url + * @property srvSendMsg 设置 true 会直接发送消息到目标端,且会占用主动消息频次 + */ + @Serializable + public data class Body( + @SerialName("file_type") + val fileType: Int, + val url: String, + @SerialName("srv_send_msg") + val srvSendMsg: Boolean, + ) +} diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/files/UploadUserFilesApi.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/files/UploadUserFilesApi.kt new file mode 100644 index 00000000..dad83d32 --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/files/UploadUserFilesApi.kt @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.api.files + +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import love.forte.simbot.qguild.api.PostQQGuildApi +import love.forte.simbot.qguild.api.SimplePostApiDescription +import love.forte.simbot.qguild.model.MessageMedia +import kotlin.jvm.JvmOverloads +import kotlin.jvm.JvmStatic + + +/** + * [富媒体消息-单聊](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/send-receive/rich-media.html#用于单聊) + * + * @author ForteScarlet + */ +public class UploadUserFilesApi private constructor( + openid: String, + private val _body: Body +) : PostQQGuildApi() { + public companion object Factory : SimplePostApiDescription( + "/v2/users/{openid}/files" + ) { + public const val FILE_TYPE_IMAGE: Int = 1 + public const val FILE_TYPE_VIDEO: Int = 2 + public const val FILE_TYPE_AUDIO: Int = 3 + public const val FILE_TYPE_FILE: Int = 4 + + /** + * Create [UploadUserFilesApi]. + * + * @param openid QQ 用户的 openid,可在各类事件中获得。 + */ + @JvmStatic + public fun create(openid: String, body: Body): UploadUserFilesApi = + UploadUserFilesApi(openid, body) + + /** + * Create [UploadUserFilesApi]. + * + * @param openid QQ 用户的 openid,可在各类事件中获得。 + * @param fileType 媒体类型:1 图片,2 视频,3 语音,4 文件(暂不开放) + * 资源格式要求: + * 图片:png/jpg,视频:mp4,语音:silk + * @param url 需要发送媒体资源的url + * @param srvSendMsg 设置 true 会直接发送消息到目标端,且会占用主动消息频次 + */ + @JvmStatic + @JvmOverloads + public fun create( + openid: String, + fileType: Int, + url: String, + srvSendMsg: Boolean = false + ): UploadUserFilesApi = + create( + openid, + Body( + fileType = fileType, + url = url, + srvSendMsg = srvSendMsg + ) + ) + + } + + override val resultDeserializationStrategy: DeserializationStrategy + get() = MessageMedia.serializer() + + override val path: Array = arrayOf("v2", "users", openid, "files") + + override fun createBody(): Any = _body + + /** + * @property fileType 媒体类型:1 图片,2 视频,3 语音,4 文件(暂不开放) + * 资源格式要求: + * 图片:png/jpg,视频:mp4,语音:silk + * @property url 需要发送媒体资源的url + * @property srvSendMsg 设置 true 会直接发送消息到目标端,且会占用主动消息频次 + */ + @Serializable + public data class Body( + @SerialName("file_type") + val fileType: Int, + val url: String, + @SerialName("srv_send_msg") + val srvSendMsg: Boolean, + ) +} diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/GroupAndC2CSendBody.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/GroupAndC2CSendBody.kt new file mode 100644 index 00000000..8c14c8e5 --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/GroupAndC2CSendBody.kt @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.api.message + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import love.forte.simbot.qguild.QGInternalApi +import love.forte.simbot.qguild.api.message.group.GroupMessageSendApi +import love.forte.simbot.qguild.api.message.user.UserMessageSendApi +import love.forte.simbot.qguild.model.Message +import love.forte.simbot.qguild.model.MessageKeyboard +import love.forte.simbot.qguild.model.MessageMedia +import kotlin.jvm.JvmStatic + + +/** + * 用于 [GroupMessageSendApi] 和 [UserMessageSendApi] + * 进行消息发送的数据体。 + * + * @property content 文本内容 + * @property msgType 消息类型: 0 文本,2 是 markdown,3 ark 消息,4 embed,7 media 富媒体 + * @property markdown + * @property keyboard + * @property media + * @property ark + * @property messageReference + * @property eventId + * @property msgId + * @property msgSeq + * @author ForteScarlet + */ +@Serializable +public open class GroupAndC2CSendBody internal constructor( + public open var content: String, + @SerialName("msg_type") + public open var msgType: Int, +) { + public open var markdown: Message.Markdown? = null + public open var keyboard: MessageKeyboard? = null + public open var media: MessageMedia? = null + public open var ark: Message.Ark? = null + + @SerialName("message_reference") + @IgnoreWhenUseFormData + public open var messageReference: Message.Reference? = null + + @SerialName("event_id") + public open var eventId: String? = null + + @SerialName("msg_id") + public open var msgId: String? = null + + @SerialName("msg_seq") + public open var msgSeq: Int? = null + + public companion object { + public const val MSG_TYPE_TEXT: Int = 0 + public const val MSG_TYPE_MARKDOWN: Int = 2 + public const val MSG_TYPE_ARK: Int = 3 + public const val MSG_TYPE_EMBED: Int = 4 + public const val MSG_TYPE_MEDIA: Int = 7 + + /** + * Create [GroupAndC2CSendBody] + */ + @JvmStatic + public fun create(content: String, msgType: Int): GroupAndC2CSendBody = + GroupAndC2CSendBody(content, msgType) + + /** + * Create [GroupAndC2CSendBody] + */ + public inline fun create( + content: String, + msgType: Int, + block: GroupAndC2CSendBody.() -> Unit + ): GroupAndC2CSendBody = + create(content, msgType).also(block) + } + + override fun toString(): String { + return "GroupAndC2CSendBody(content='$content', msgType=$msgType, markdown=$markdown, keyboard=$keyboard, media=$media, ark=$ark, messageReference=$messageReference, eventId=$eventId, msgId=$msgId, msgSeq=$msgSeq)" + } +} + +@QGInternalApi +public fun GroupAndC2CSendBody.isEmpty(): Boolean = + content.isEmpty() + && markdown == null + && keyboard == null + && media == null + && ark == null + && messageReference == null + && eventId == null + && msgId == null + && msgSeq == null diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/MessageSendApi.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/MessageSendApi.kt index 1fa1b967..c78549c6 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/MessageSendApi.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/MessageSendApi.kt @@ -189,7 +189,7 @@ public class MessageSendApi private constructor( * 选填,引用消息 */ @SerialName("message_reference") - @IgnoreWhenUseImageFormData // TODO 疑似不支持使用form转json发送,暂时忽略 + @IgnoreWhenUseFormData // TODO 疑似不支持使用form转json发送,暂时忽略 public val messageReference: Message.Reference?, /** * 选填,图片url地址,平台会转存该图片,用于下发图片消息 @@ -482,14 +482,14 @@ public expect fun FormBuilder.resolveOther(fileImage: Any?) @OptIn(ExperimentalSerializationApi::class) -private class FormDataDecoder( +internal class FormDataDecoder( override val serializersModule: SerializersModule, private val json: Json, private val formBuilder: FormBuilder, ) : Encoder, CompositeEncoder { private inline fun check(descriptor: SerialDescriptor, index: Int, block: () -> Unit) { - if (descriptor.getElementAnnotations(index).any { it is IgnoreWhenUseImageFormData }) { + if (descriptor.getElementAnnotations(index).any { it is IgnoreWhenUseFormData }) { return } @@ -644,4 +644,4 @@ private class FormDataDecoder( @OptIn(ExperimentalSerializationApi::class) @MetaSerializable @Target(AnnotationTarget.PROPERTY) -private annotation class IgnoreWhenUseImageFormData +internal annotation class IgnoreWhenUseFormData diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/group/GroupMessageSendApi.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/group/GroupMessageSendApi.kt new file mode 100644 index 00000000..58bfabc6 --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/group/GroupMessageSendApi.kt @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.api.message.group + +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.Serializable +import love.forte.simbot.qguild.api.PostQQGuildApi +import love.forte.simbot.qguild.api.SimplePostApiDescription +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody +import love.forte.simbot.qguild.model.MessageKeyboard +import kotlin.jvm.JvmOverloads +import kotlin.jvm.JvmStatic + + +/** + * [发送消息到群](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/send-receive/send.html#群聊) + * + * @author ForteScarlet + */ +public class GroupMessageSendApi private constructor( + groupId: String, + private val _body: GroupAndC2CSendBody, // TencentMessageForSending || MultiPartFormDataContent +) : PostQQGuildApi() { + public companion object Factory : SimplePostApiDescription( + "/v2/groups/{group_openid}/messages" + ) { + public const val MSG_TYPE_TEXT: Int = GroupAndC2CSendBody.MSG_TYPE_TEXT + public const val MSG_TYPE_MARKDOWN: Int = GroupAndC2CSendBody.MSG_TYPE_MARKDOWN + public const val MSG_TYPE_ARK: Int = GroupAndC2CSendBody.MSG_TYPE_ARK + public const val MSG_TYPE_EMBED: Int = GroupAndC2CSendBody.MSG_TYPE_EMBED + public const val MSG_TYPE_MEDIA: Int = GroupAndC2CSendBody.MSG_TYPE_MEDIA + + /** + * Create a [GroupMessageSendApi]. + */ + @JvmStatic + public fun create(groupId: String, body: GroupAndC2CSendBody): GroupMessageSendApi = + GroupMessageSendApi(groupId, body) + + /** + * Create a [GroupMessageSendApi]. + * + * @param msgType 消息类型: 0 文本,2 是 markdown,3 ark 消息,4 embed,7 media 富媒体 + * 由于此处仅提供 content, 因此类型应当是 `0` 或 `2`。 + */ + @JvmStatic + public fun create(groupId: String, content: String, msgType: Int): GroupMessageSendApi = + create(groupId, GroupAndC2CSendBody.create(content = content, msgType = msgType)) + + /** + * Create a [GroupMessageSendApi]. + * + * @param text 文本消息内容 + */ + @JvmStatic + public fun createText(groupId: String, text: String): GroupMessageSendApi = + create(groupId, GroupAndC2CSendBody.create(content = text, msgType = MSG_TYPE_TEXT)) + + /** + * Create a [GroupMessageSendApi]. + * + * @param markdown markdown消息内容 + */ + @JvmStatic + @JvmOverloads + public fun createMarkdown( + groupId: String, + markdown: String, + keyboard: MessageKeyboard? = null + ): GroupMessageSendApi = + create( + groupId, + GroupAndC2CSendBody.create(content = markdown, msgType = MSG_TYPE_MARKDOWN) { + this.keyboard = keyboard + } + ) + + } + + override val resultDeserializationStrategy: DeserializationStrategy + get() = GroupMessageSendResult.serializer() + + override val path: Array = arrayOf("v2", "groups", groupId, "messages") + + override fun createBody(): Any = _body +} + +/** + * The result of [GroupMessageSendApi] + */ +@Serializable +public data class GroupMessageSendResult( + val id: String, + val timestamp: String, +) diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/user/UserMessageSendApi.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/user/UserMessageSendApi.kt new file mode 100644 index 00000000..7ecf5bea --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/api/message/user/UserMessageSendApi.kt @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.api.message.user + +import kotlinx.serialization.DeserializationStrategy +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import love.forte.simbot.qguild.ApiModel +import love.forte.simbot.qguild.api.PostQQGuildApi +import love.forte.simbot.qguild.api.SimplePostApiDescription +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody +import love.forte.simbot.qguild.api.message.IgnoreWhenUseFormData +import love.forte.simbot.qguild.model.Message +import love.forte.simbot.qguild.model.MessageKeyboard +import love.forte.simbot.qguild.model.SendMessageMedia +import kotlin.jvm.JvmOverloads +import kotlin.jvm.JvmStatic + + +/** + * [发送消息-单聊](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/send-receive/send.html#单聊) + * + * 单独发动消息给用户。 + * + * @author ForteScarlet + */ +public class UserMessageSendApi private constructor( + openid: String, + private val _body: GroupAndC2CSendBody, +) : PostQQGuildApi() { + public companion object Factory : SimplePostApiDescription( + "/v2/users/{openid}/messages" + ) { + public const val MSG_TYPE_TEXT: Int = GroupAndC2CSendBody.MSG_TYPE_TEXT + public const val MSG_TYPE_MARKDOWN: Int = GroupAndC2CSendBody.MSG_TYPE_MARKDOWN + public const val MSG_TYPE_ARK: Int = GroupAndC2CSendBody.MSG_TYPE_ARK + public const val MSG_TYPE_EMBED: Int = GroupAndC2CSendBody.MSG_TYPE_EMBED + public const val MSG_TYPE_MEDIA: Int = GroupAndC2CSendBody.MSG_TYPE_MEDIA + + /** + * Create a [UserMessageSendApi]. + */ + @JvmStatic + public fun create(openid: String, body: GroupAndC2CSendBody): UserMessageSendApi = + UserMessageSendApi(openid, body) + + /** + * Create a [UserMessageSendApi]. + * + * @param msgType 消息类型: 0 文本,2 是 markdown,3 ark 消息,4 embed,7 media 富媒体 + * 由于此处仅提供 content, 因此类型应当是 `0` 或 `2`。 + */ + @JvmStatic + public fun create(openid: String, content: String, msgType: Int): UserMessageSendApi = + create( + openid, + GroupAndC2CSendBody.create( + content = content, + msgType = msgType + ) + ) + + /** + * Create a [UserMessageSendApi]. + * + * @param text 文本消息内容 + */ + @JvmStatic + public fun createText(openid: String, text: String): UserMessageSendApi = + create( + openid, + GroupAndC2CSendBody.create(content = text, msgType = MSG_TYPE_TEXT) + ) + + /** + * Create a [UserMessageSendApi]. + * + * @param markdown markdown消息内容 + */ + @JvmStatic + @JvmOverloads + public fun createMarkdown( + openid: String, + markdown: String, + keyboard: MessageKeyboard? = null + ): UserMessageSendApi = + create( + openid, + GroupAndC2CSendBody.create( + content = markdown, + msgType = MSG_TYPE_MARKDOWN, + ) { + this.keyboard = keyboard + } + ) + } + + override val resultDeserializationStrategy: DeserializationStrategy + get() = UserMessageSendResult.serializer() + + override val path: Array = arrayOf("v2", "users", openid, "messages") + + override fun createBody(): Any = _body + + /** + * @property content 文本内容 + * @property msgType 消息类型: 0 文本,2 是 markdown,3 ark 消息,4 embed,7 media 富媒体 + * @property markdown + * @property keyboard + * @property media + * @property ark + * @property messageReference + * @property eventId + * @property msgId + * @property msgSeq + */ + @ApiModel + @Serializable + public class Body( + public val content: String, + @SerialName("msg_type") + public val msgType: Int, + ) { + public var markdown: Message.Markdown? = null + public var keyboard: MessageKeyboard? = null + public var media: SendMessageMedia? = null + public var ark: Message.Ark? = null + + @SerialName("message_reference") + @IgnoreWhenUseFormData + public var messageReference: Message.Reference? = null + + @SerialName("event_id") + public var eventId: String? = null + + @SerialName("msg_id") + public var msgId: String? = null + + @SerialName("msg_seq") + public var msgSeq: Int? = null + } +} + + +/** + * The result of [UserMessageSendApi] + */ +@Serializable +public data class UserMessageSendResult( + val id: String, + val timestamp: String, +) diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/EventIntents.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/EventIntents.kt index 8d8e3288..ff8ea951 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/EventIntents.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/EventIntents.kt @@ -311,6 +311,81 @@ public sealed class EventIntents { } + /** + * ``` + * GROUP_AND_C2C_EVENT (1 << 25) + * - C2C_MESSAGE_CREATE // 用户单聊发消息给机器人时候 + * - FRIEND_ADD // 用户添加使用机器人 + * - FRIEND_DEL // 用户删除机器人 + * - C2C_MSG_REJECT // 用户在机器人资料卡手动关闭"主动消息"推送 + * - C2C_MSG_RECEIVE // 用户在机器人资料卡手动开启"主动消息"推送开关 + * - GROUP_AT_MESSAGE_CREATE // 用户在群里@机器人时收到的消息 + * - GROUP_ADD_ROBOT // 机器人被添加到群聊 + * - GROUP_DEL_ROBOT // 机器人被移出群聊 + * - GROUP_MSG_REJECT // 群管理员主动在机器人资料页操作关闭通知 + * - GROUP_MSG_RECEIVE // 群管理员主动在机器人资料页操作开启通知 + * ``` + */ + public data object GroupAndC2CEvent : EventIntents() { + /** C2C群聊相关事件 `intents` */ + @get:JvmStatic + @get:JvmName("getIntents") + public val intents: Intents = Intents(1 shl 25) + + override val intentsValue: Int + get() = intents.value + + /** + * 用户单聊发消息给机器人时候 + */ + public const val C2C_MESSAGE_CREATE_TYPE: String = "C2C_MESSAGE_CREATE" + + /** + * 用户添加使用机器人 + */ + public const val FRIEND_ADD_TYPE: String = "FRIEND_ADD" + + /** + * 用户删除机器人 + */ + public const val FRIEND_DEL_TYPE: String = "FRIEND_DEL" + + /** + * 用户在机器人资料卡手动关闭"主动消息"推送 + */ + public const val C2C_MSG_REJECT_TYPE: String = "C2C_MSG_REJECT" + + /** + * 用户在机器人资料卡手动开启"主动消息"推送开关 + */ + public const val C2C_MSG_RECEIVE_TYPE: String = "C2C_MSG_RECEIVE" + + /** + * 用户在群里@机器人时收到的消息 + */ + public const val GROUP_AT_MESSAGE_CREATE_TYPE: String = "GROUP_AT_MESSAGE_CREATE" + + /** + * 机器人被添加到群聊 + */ + public const val GROUP_ADD_ROBOT_TYPE: String = "GROUP_ADD_ROBOT" + + /** + * 机器人被移出群聊 + */ + public const val GROUP_DEL_ROBOT_TYPE: String = "GROUP_DEL_ROBOT" + + /** + * 群管理员主动在机器人资料页操作关闭通知 + */ + public const val GROUP_MSG_REJECT_TYPE: String = "GROUP_MSG_REJECT" + + /** + * 群管理员主动在机器人资料页操作开启通知 + */ + public const val GROUP_MSG_RECEIVE_TYPE: String = "GROUP_MSG_RECEIVE" + } + /** * ``` * INTERACTION (1 << 26) @@ -493,6 +568,7 @@ public val EventIntentsInstances: Array = arrayOf( DirectMessage, OpenForumsEvent, AudioOrLiveChannelMember, + GroupAndC2CEvent, Interaction, MessageAudit, ForumsEvent, @@ -505,7 +581,11 @@ public val EventIntentsInstances: Array = arrayOf( */ @Serializable @SerialName(READY_TYPE) -public data class Ready(override val s: Long, @SerialName("d") override val data: Data) : Signal.Dispatch() { +public data class Ready( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Data +) : Signal.Dispatch() { /** * [Ready] 的事件内容 */ @@ -526,5 +606,9 @@ public data class Ready(override val s: Long, @SerialName("d") override val data */ @Serializable @SerialName(RESUMED_TYPE) -public data class Resumed(override val s: Long, @SerialName("d") override val data: String) : Signal.Dispatch() +public data class Resumed( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: String +) : Signal.Dispatch() diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/Signal.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/Signal.kt index 75f54832..b2922a1c 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/Signal.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/Signal.kt @@ -76,7 +76,8 @@ public sealed class Signal(@Serializable(Opcode.SerializerByCode::class) publ /** * - * @property token 创建机器人的时候分配的,格式为 `Bot {appid}.{app_token}` + * @property token 创建机器人的时候分配的, + * 格式为 `QQBot {ACCESS_TOKEN}` * @property intents 此次连接所需要接收的事件,具体可参考 [Intents] * @property shard 该参数是用来进行水平分片的。该参数是个拥有两个元素的数组。 * 例如:`[0,4]`,代表分为四个片,当前链接是第 0 个片,业务稍后应该继续建立 shard 为 `[1,4]`, `[2,4]`, `[3,4]` 的链接,才能完整接收事件。更多详细的内容可以参考 [Shard]。 @@ -164,6 +165,8 @@ public sealed class Signal(@Serializable(Opcode.SerializerByCode::class) publ */ protected abstract val s: Long + public abstract val id: String? + /** * 事件序列 */ @@ -211,6 +214,7 @@ public sealed class Signal(@Serializable(Opcode.SerializerByCode::class) publ * */ public data class Unknown @QGInternalApi constructor( + override val id: String? = null, override val s: Long, override val data: JsonElement, val raw: String diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/c2cManagements.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/c2cManagements.kt new file mode 100644 index 00000000..16353f19 --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/c2cManagements.kt @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.event + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + + +/** + * [C2CManagementDispatch] 的事件数据 + * @property timestamp 添加时间戳 + * @property openid 用户openid + */ +@Serializable +public data class C2CManagementData( + val timestamp: String, + val openid: String, +) + +/** + * 用户模块-用户管理相关事件。 + * [data] 类型为 [C2CManagementData] + */ +public sealed class C2CManagementDispatch : Signal.Dispatch() { + abstract override val data: C2CManagementData +} + +/** + * [用户添加机器人](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/user/manage/event.html#用户添加机器人) + * + * 触发场景 用户添加机器人'好友'到消息列表 + */ +@Serializable +@SerialName(EventIntents.GroupAndC2CEvent.FRIEND_ADD_TYPE) +public data class FriendAdd( + override val id: String? = null, + override val s: Long, + @SerialName("d") + override val data: C2CManagementData +) : C2CManagementDispatch() + +/** + * [用户删除机器人](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/user/manage/event.html#用户删除机器人) + * + * 触发场景 用户删除机器人'好友' + */ +@Serializable +@SerialName(EventIntents.GroupAndC2CEvent.FRIEND_DEL_TYPE) +public data class FriendDel( + override val id: String? = null, + override val s: Long, + @SerialName("d") + override val data: C2CManagementData +) : C2CManagementDispatch() + +/** + * [拒绝机器人主动消息](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/user/manage/event.html#拒绝机器人主动消息) + * + * 触发场景 用户在机器人资料卡手动关闭"主动消息"推送 + */ +@Serializable +@SerialName(EventIntents.GroupAndC2CEvent.C2C_MSG_REJECT_TYPE) +public data class C2CMsgReject( + override val id: String? = null, + override val s: Long, + @SerialName("d") + override val data: C2CManagementData +) : C2CManagementDispatch() + +/** + * [允许机器人主动消息](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/user/manage/event.html#允许机器人主动消息) + * + * 触发场景 用户在机器人资料卡手动开启"主动消息"推送开关 + */ +@Serializable +@SerialName(EventIntents.GroupAndC2CEvent.C2C_MSG_RECEIVE_TYPE) +public data class C2CMsgReceive( + override val id: String? = null, + override val s: Long, + @SerialName("d") + override val data: C2CManagementData +) : C2CManagementDispatch() diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/c2cMessages.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/c2cMessages.kt new file mode 100644 index 00000000..fff4af9a --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/c2cMessages.kt @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.event + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import love.forte.simbot.qguild.model.Message + +/** + * [单聊消息](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/send-receive/event.html#单聊消息) + * + * 触发场景 用户在单聊发送消息给机器人 + */ +@Serializable +@SerialName(EventIntents.GroupAndC2CEvent.C2C_MESSAGE_CREATE_TYPE) +public data class C2CMessageCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") + override val data: Data, +) : Signal.Dispatch() { + + /** + * The data of [C2CMessageCreate.data]. + * + * @property id 平台方消息ID,可以用于被动消息发送 + * @property author 发送者 + * @property content 文本消息内容 + * @property timestamp 消息生产时间(RFC3339) + * @property attachments 富媒体文件附件,文件类型:"图片,语音,视频,文件" + * `{"content_type": "", "filename": "", "height": "", "width": "", "size": "", "url": ""}` + * + */ + @Serializable + public data class Data( + public val id: String, + public val author: Author, + public val content: String, + public val timestamp: String, + public val attachments: List = emptyList(), + ) + + /** + * The [Data.author]. + */ + @Serializable + public data class Author( + @SerialName("user_openid") + val userOpenid: String, + ) +} + +/** + * [群聊@机器人](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/send-receive/event.html#群聊-机器人) + * + * 触发场景 用户在群聊@机器人发送消息 + */ +@Serializable +@SerialName(EventIntents.GroupAndC2CEvent.GROUP_AT_MESSAGE_CREATE_TYPE) +public data class GroupAtMessageCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") + override val data: Data, +) : Signal.Dispatch() { + /** + * The data of [GroupAtMessageCreate.data] + * + * @property id 平台方消息 ID,可以用于被动消息发送 + * @property author 发送者 + * @property content 消息内容 + * @property timestamp 消息生产时间(RFC3339) + * @property groupOpenid 群聊的 openid + * @property attachments 富媒体文件附件,文件类型:"图片,语音,视频,文件" + * `{"content_type": "", "filename": "", "height": "", "width": "", "size": "", "url": ""}` + */ + @Serializable + public data class Data( + val id: String, + val author: Author, + val content: String, + val timestamp: String, + @SerialName("group_openid") + val groupOpenid: String, + val attachments: List = emptyList(), + ) + + /** + * The [Data.author] + * + * @property memberOpenid 用户在本群的 member_openid + */ + @Serializable + public data class Author( + @SerialName("member_openid") + val memberOpenid: String, + ) +} + + diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/channels.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/channels.kt index 15c5071a..8a1894e1 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/channels.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/channels.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023. ForteScarlet. + * Copyright (c) 2023-2024. ForteScarlet. * * This file is part of simbot-component-qq-guild. * @@ -20,7 +20,9 @@ package love.forte.simbot.qguild.event import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import love.forte.simbot.qguild.ApiModel -import love.forte.simbot.qguild.model.* +import love.forte.simbot.qguild.model.Channel +import love.forte.simbot.qguild.model.ChannelSubType +import love.forte.simbot.qguild.model.ChannelType /** * channel相关的事件类型。[data] 类型为 [EventChannel]。 @@ -41,8 +43,11 @@ public sealed class ChannelDispatch : Signal.Dispatch() { */ @Serializable @SerialName(EventIntents.Guilds.CHANNEL_CREATE_TYPE) -public data class ChannelCreate(override val s: Long, @SerialName("d") override val data: EventChannel) : - ChannelDispatch() +public data class ChannelCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: EventChannel +) : ChannelDispatch() /** * 子频道事件 [CHANNEL_UPDATE](https://bot.q.qq.com/wiki/develop/api/gateway/channel.html#channel-update) @@ -52,8 +57,11 @@ public data class ChannelCreate(override val s: Long, @SerialName("d") override */ @Serializable @SerialName(EventIntents.Guilds.CHANNEL_UPDATE_TYPE) -public data class ChannelUpdate(override val s: Long, @SerialName("d") override val data: EventChannel) : - ChannelDispatch() +public data class ChannelUpdate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: EventChannel +) : ChannelDispatch() /** * 子频道事件 [CHANNEL_DELETE](https://bot.q.qq.com/wiki/develop/api/gateway/channel.html#channel-delete) @@ -63,8 +71,11 @@ public data class ChannelUpdate(override val s: Long, @SerialName("d") override */ @Serializable @SerialName(EventIntents.Guilds.CHANNEL_DELETE_TYPE) -public data class ChannelDelete(override val s: Long, @SerialName("d") override val data: EventChannel) : - ChannelDispatch() +public data class ChannelDelete( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: EventChannel +) : ChannelDispatch() /** diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/forums.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/forums.kt index 33352300..b3bda947 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/forums.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/forums.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023. ForteScarlet. + * Copyright (c) 2023-2024. ForteScarlet. * * This file is part of simbot-component-qq-guild. * @@ -92,7 +92,11 @@ public sealed class ForumThreadDispatch : ForumDispatch() { */ @Serializable @SerialName(EventIntents.ForumsEvent.FORUM_THREAD_CREATE_TYPE) -public data class ForumThreadCreate(override val s: Long, @SerialName("d") override val data: Thread) : ForumThreadDispatch() +public data class ForumThreadCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Thread +) : ForumThreadDispatch() /** * 主题更新事件。 @@ -102,7 +106,11 @@ public data class ForumThreadCreate(override val s: Long, @SerialName("d") overr */ @Serializable @SerialName(EventIntents.ForumsEvent.FORUM_THREAD_UPDATE_TYPE) -public data class ForumThreadUpdate(override val s: Long, @SerialName("d") override val data: Thread) : ForumThreadDispatch() +public data class ForumThreadUpdate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Thread +) : ForumThreadDispatch() /** * 主题删除事件。 @@ -112,7 +120,11 @@ public data class ForumThreadUpdate(override val s: Long, @SerialName("d") overr */ @Serializable @SerialName(EventIntents.ForumsEvent.FORUM_THREAD_DELETE_TYPE) -public data class ForumThreadDelete(override val s: Long, @SerialName("d") override val data: Thread) : ForumThreadDispatch() +public data class ForumThreadDelete( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Thread +) : ForumThreadDispatch() /** @@ -135,7 +147,11 @@ public sealed class ForumPostDispatch : ForumDispatch() { */ @Serializable @SerialName(EventIntents.ForumsEvent.FORUM_POST_CREATE_TYPE) -public data class ForumPostCreate(override val s: Long, @SerialName("d") override val data: Post) : ForumPostDispatch() +public data class ForumPostCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Post +) : ForumPostDispatch() /** * 帖子删除事件 @@ -145,7 +161,11 @@ public data class ForumPostCreate(override val s: Long, @SerialName("d") overrid */ @Serializable @SerialName(EventIntents.ForumsEvent.FORUM_POST_DELETE_TYPE) -public data class ForumPostDelete(override val s: Long, @SerialName("d") override val data: Post) : ForumPostDispatch() +public data class ForumPostDelete( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Post +) : ForumPostDispatch() /** @@ -168,7 +188,11 @@ public sealed class ForumReplyDispatch : ForumDispatch() { */ @Serializable @SerialName(EventIntents.ForumsEvent.FORUM_REPLY_CREATE_TYPE) -public data class ForumReplyCreate(override val s: Long, @SerialName("d") override val data: Reply) : ForumReplyDispatch() +public data class ForumReplyCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Reply +) : ForumReplyDispatch() /** * 回复删除事件 @@ -178,7 +202,11 @@ public data class ForumReplyCreate(override val s: Long, @SerialName("d") overri */ @Serializable @SerialName(EventIntents.ForumsEvent.FORUM_REPLY_DELETE_TYPE) -public data class ForumReplyDelete(override val s: Long, @SerialName("d") override val data: Reply) : ForumReplyDispatch() +public data class ForumReplyDelete( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Reply +) : ForumReplyDispatch() /** * 帖子审核事件 @@ -187,4 +215,8 @@ public data class ForumReplyDelete(override val s: Long, @SerialName("d") overri */ @Serializable @SerialName(EventIntents.ForumsEvent.FORUM_PUBLISH_AUDIT_RESULT_TYPE) -public data class ForumPublishAuditResult(override val s: Long, @SerialName("d") override val data: AuditResult) : ForumDispatch() +public data class ForumPublishAuditResult( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: AuditResult +) : ForumDispatch() diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/groupManagements.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/groupManagements.kt new file mode 100644 index 00000000..54ee95e7 --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/groupManagements.kt @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.event + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** + * @property timestamp 加入的时间戳 + * @property groupOpenid 加入群的群openid + * @property opMemberOpenid 操作添加机器人进群的群成员openid + */ +@Serializable +public data class GroupRobotManagementData( + val timestamp: String, + @SerialName("group_openid") + val groupOpenid: String, + @SerialName("op_member_openid") + val opMemberOpenid: String, +) + +/** + * 群聊模块-群管理相关事件。 + * [data] 类型为 [GroupRobotManagementData] + */ +public sealed class GroupRobotManagementDispatch : Signal.Dispatch() { + abstract override val data: GroupRobotManagementData +} + +/** + * [机器人加入群聊](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/group/manage/event.html#机器人加入群聊) + * + * 触发场景 机器人被添加到群聊 + */ +@Serializable +@SerialName(EventIntents.GroupAndC2CEvent.GROUP_ADD_ROBOT_TYPE) +public data class GroupAddRobot( + override val id: String? = null, + override val s: Long, + @SerialName("d") + override val data: GroupRobotManagementData +) : GroupRobotManagementDispatch() + +/** + * [机器人退出群聊](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/group/manage/event.html#机器人退出群聊) + * + * 触发场景 机器人被移出群聊 + */ +@Serializable +@SerialName(EventIntents.GroupAndC2CEvent.GROUP_DEL_ROBOT_TYPE) +public data class GroupDelRobot( + override val id: String? = null, + override val s: Long, + @SerialName("d") + override val data: GroupRobotManagementData +) : GroupRobotManagementDispatch() + +/** + * [群聊拒绝机器人主动消息](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/group/manage/event.html#群聊拒绝机器人主动消息) + * + * 触发场景 群管理员主动在机器人资料页操作关闭通知 + */ +@Serializable +@SerialName(EventIntents.GroupAndC2CEvent.GROUP_MSG_REJECT_TYPE) +public data class GroupMsgReject( + override val id: String? = null, + override val s: Long, + @SerialName("d") + override val data: GroupRobotManagementData +) : GroupRobotManagementDispatch() + +/** + * [群聊接受机器人主动消息](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/group/manage/event.html#群聊接受机器人主动消息) + * + * 触发场景 群管理员主动在机器人资料页操作开启通知 + */ +@Serializable +@SerialName(EventIntents.GroupAndC2CEvent.GROUP_MSG_RECEIVE_TYPE) +public data class GroupMsgReceive( + override val id: String? = null, + override val s: Long, + @SerialName("d") + override val data: GroupRobotManagementData +) : GroupRobotManagementDispatch() diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/guilds.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/guilds.kt index 19ef5db2..3caeb9ee 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/guilds.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/guilds.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023. ForteScarlet. + * Copyright (c) 2023-2024. ForteScarlet. * * This file is part of simbot-component-qq-guild. * @@ -41,7 +41,11 @@ public sealed class EventGuildDispatch : Signal.Dispatch() { */ @Serializable @SerialName(EventIntents.Guilds.GUILD_CREATE_TYPE) -public data class GuildCreate(override val s: Long, @SerialName("d") override val data: EventGuild) : EventGuildDispatch() +public data class GuildCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: EventGuild +) : EventGuildDispatch() /** * @@ -53,7 +57,11 @@ public data class GuildCreate(override val s: Long, @SerialName("d") override va */ @Serializable @SerialName(EventIntents.Guilds.GUILD_UPDATE_TYPE) -public data class GuildUpdate(override val s: Long, @SerialName("d") override val data: EventGuild) : EventGuildDispatch() +public data class GuildUpdate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: EventGuild +) : EventGuildDispatch() /** * @@ -66,7 +74,11 @@ public data class GuildUpdate(override val s: Long, @SerialName("d") override va */ @Serializable @SerialName(EventIntents.Guilds.GUILD_DELETE_TYPE) -public data class GuildDelete(override val s: Long, @SerialName("d") override val data: EventGuild) : EventGuildDispatch() +public data class GuildDelete( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: EventGuild +) : EventGuildDispatch() /** diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/members.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/members.kt index 0d598e92..4114a455 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/members.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/members.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023. ForteScarlet. + * Copyright (c) 2023-2024. ForteScarlet. * * This file is part of simbot-component-qq-guild. * @@ -31,7 +31,11 @@ import love.forte.simbot.qguild.time.ZERO_ISO_INSTANT */ @Serializable @SerialName(EventIntents.GuildMembers.GUILD_MEMBER_ADD_TYPE) -public data class GuildMemberAdd(override val s: Long, @SerialName("d") override val data: EventMember) : Signal.Dispatch() +public data class GuildMemberAdd( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: EventMember +) : Signal.Dispatch() /** * [`GUILD_MEMBER_UPDATE`](https://bot.q.qq.com/wiki/develop/api/gateway/guild_member.html#guild-member-update) @@ -40,7 +44,11 @@ public data class GuildMemberAdd(override val s: Long, @SerialName("d") override */ @Serializable @SerialName(EventIntents.GuildMembers.GUILD_MEMBER_UPDATE_TYPE) -public data class GuildMemberUpdate(override val s: Long, @SerialName("d") override val data: EventMember) : Signal.Dispatch() +public data class GuildMemberUpdate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: EventMember +) : Signal.Dispatch() /** * [`GUILD_MEMBER_REMOVE`](https://bot.q.qq.com/wiki/develop/api/gateway/guild_member.html#guild-member-remove) @@ -49,7 +57,11 @@ public data class GuildMemberUpdate(override val s: Long, @SerialName("d") overr */ @Serializable @SerialName(EventIntents.GuildMembers.GUILD_MEMBER_REMOVE_TYPE) -public data class GuildMemberRemove(override val s: Long, @SerialName("d") override val data: EventMember) : Signal.Dispatch() +public data class GuildMemberRemove( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: EventMember +) : Signal.Dispatch() /** @@ -67,7 +79,7 @@ public data class EventMember( /** * 用户的频道基础信息 */ - override val user: User, + override val user: User, /** * 用户的昵称 */ diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/messages.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/messages.kt index 3d3c39ff..a7bce237 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/messages.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/messages.kt @@ -44,7 +44,11 @@ public sealed class MessageDispatch : Signal.Dispatch() { */ @Serializable @SerialName(EventIntents.PublicGuildMessages.AT_MESSAGE_CREATE_TYPE) -public data class AtMessageCreate(override val s: Long, @SerialName("d") override val data: Message) : MessageDispatch() +public data class AtMessageCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Message +) : MessageDispatch() /** * 消息事件 @@ -54,6 +58,7 @@ public data class AtMessageCreate(override val s: Long, @SerialName("d") overrid @Serializable @SerialName(EventIntents.PublicGuildMessages.PUBLIC_MESSAGE_DELETE_TYPE) public data class PublicMessageDeleteCreate( + override val id: String? = null, override val s: Long, @SerialName("d") override val data: Unit /* TODO 文档没找到描述。 */ ) : @@ -69,7 +74,11 @@ public data class PublicMessageDeleteCreate( */ @Serializable @SerialName(EventIntents.DirectMessage.DIRECT_MESSAGE_CREATE_TYPE) -public data class DirectMessageCreate(override val s: Long, @SerialName("d") override val data: Message) : +public data class DirectMessageCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Message +) : MessageDispatch() /** @@ -87,7 +96,11 @@ public sealed class MessageAuditedDispatch : Signal.Dispatch() { */ @Serializable @SerialName(EventIntents.GuildMessages.MESSAGE_CREATE_TYPE) -public data class MessageCreate(override val s: Long, @SerialName("d") override val data: Message) : MessageDispatch() +public data class MessageCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: Message +) : MessageDispatch() /** * 删除(撤回)消息事件 @@ -95,6 +108,7 @@ public data class MessageCreate(override val s: Long, @SerialName("d") override @Serializable @SerialName(EventIntents.GuildMessages.MESSAGE_DELETE_TYPE) public data class MessageDelete( + override val id: String? = null, override val s: Long, @SerialName("d") override val data: Unit /* TODO 文档没找到描述。 */ ) : Signal.Dispatch() @@ -110,8 +124,11 @@ public data class MessageDelete( */ @Serializable @SerialName(EventIntents.MessageAudit.MESSAGE_AUDIT_PASS_TYPE) -public data class MessageAuditPass(override val s: Long, @SerialName("d") override val data: MessageAudited) : - MessageAuditedDispatch() +public data class MessageAuditPass( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: MessageAudited +) : MessageAuditedDispatch() /** * 消息审核事件 @@ -123,5 +140,8 @@ public data class MessageAuditPass(override val s: Long, @SerialName("d") overri */ @Serializable @SerialName(EventIntents.MessageAudit.MESSAGE_AUDIT_REJECT_TYPE) -public data class MessageAuditReject(override val s: Long, @SerialName("d") override val data: MessageAudited) : - MessageAuditedDispatch() +public data class MessageAuditReject( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: MessageAudited +) : MessageAuditedDispatch() diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/openForums.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/openForums.kt index dc79131d..7ddd3527 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/openForums.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/event/openForums.kt @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023. ForteScarlet. + * Copyright (c) 2023-2024. ForteScarlet. * * This file is part of simbot-component-qq-guild. * @@ -118,7 +118,11 @@ public sealed class OpenForumThreadDispatch : OpenForumDispatch() { */ @Serializable @SerialName(EventIntents.OpenForumsEvent.OPEN_FORUM_THREAD_CREATE_TYPE) -public data class OpenForumThreadCreate(override val s: Long, @SerialName("d") override val data: OpenForumThreadData) : OpenForumThreadDispatch() +public data class OpenForumThreadCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: OpenForumThreadData +) : OpenForumThreadDispatch() /** @@ -128,7 +132,11 @@ public data class OpenForumThreadCreate(override val s: Long, @SerialName("d") o */ @Serializable @SerialName(EventIntents.OpenForumsEvent.OPEN_FORUM_THREAD_UPDATE_TYPE) -public data class OpenForumThreadUpdate(override val s: Long, @SerialName("d") override val data: OpenForumThreadData) : OpenForumThreadDispatch() +public data class OpenForumThreadUpdate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: OpenForumThreadData +) : OpenForumThreadDispatch() /** @@ -138,7 +146,11 @@ public data class OpenForumThreadUpdate(override val s: Long, @SerialName("d") o */ @Serializable @SerialName(EventIntents.OpenForumsEvent.OPEN_FORUM_THREAD_DELETE_TYPE) -public data class OpenForumThreadDelete(override val s: Long, @SerialName("d") override val data: OpenForumThreadData) : OpenForumThreadDispatch() +public data class OpenForumThreadDelete( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: OpenForumThreadData +) : OpenForumThreadDispatch() /** @@ -174,7 +186,11 @@ public sealed class OpenForumPostDispatch : OpenForumDispatch() { */ @Serializable @SerialName(EventIntents.OpenForumsEvent.OPEN_FORUM_POST_CREATE_TYPE) -public data class OpenForumPostCreate(override val s: Long, @SerialName("d") override val data: OpenForumPostData) : OpenForumPostDispatch() +public data class OpenForumPostCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: OpenForumPostData +) : OpenForumPostDispatch() /** @@ -184,7 +200,11 @@ public data class OpenForumPostCreate(override val s: Long, @SerialName("d") ove */ @Serializable @SerialName(EventIntents.OpenForumsEvent.OPEN_FORUM_POST_DELETE_TYPE) -public data class OpenForumPostDelete(override val s: Long, @SerialName("d") override val data: OpenForumPostData) : OpenForumPostDispatch() +public data class OpenForumPostDelete( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: OpenForumPostData +) : OpenForumPostDispatch() /** @@ -219,7 +239,11 @@ public sealed class OpenForumReplyDispatch : OpenForumDispatch() { */ @Serializable @SerialName(EventIntents.OpenForumsEvent.OPEN_FORUM_REPLY_CREATE_TYPE) -public data class OpenForumReplyCreate(override val s: Long, @SerialName("d") override val data: OpenForumReplyData) : OpenForumReplyDispatch() +public data class OpenForumReplyCreate( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: OpenForumReplyData +) : OpenForumReplyDispatch() /** @@ -229,7 +253,11 @@ public data class OpenForumReplyCreate(override val s: Long, @SerialName("d") ov */ @Serializable @SerialName(EventIntents.OpenForumsEvent.OPEN_FORUM_REPLY_DELETE_TYPE) -public data class OpenForumReplyDelete(override val s: Long, @SerialName("d") override val data: OpenForumReplyData) : OpenForumReplyDispatch() +public data class OpenForumReplyDelete( + override val id: String? = null, + override val s: Long, + @SerialName("d") override val data: OpenForumReplyData +) : OpenForumReplyDispatch() /** diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/model/Message.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/model/Message.kt index a674640e..82eb86d8 100644 --- a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/model/Message.kt +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/model/Message.kt @@ -26,6 +26,7 @@ import kotlinx.serialization.encoding.Encoder import love.forte.simbot.qguild.ApiModel import love.forte.simbot.qguild.message.EmbedBuilder import love.forte.simbot.qguild.time.ZERO_ISO_INSTANT +import kotlin.jvm.JvmOverloads import kotlin.jvm.JvmStatic import kotlin.jvm.JvmSynthetic @@ -313,17 +314,17 @@ public data class Message( /** * markdown 模板 id */ - @SerialName("template_id") val templateId: Int?, + @SerialName("template_id") val templateId: Int? = null, /** * markdown 自定义模板 id */ - @SerialName("custom_template_id") val customTemplateId: String?, + @SerialName("custom_template_id") val customTemplateId: String? = null, /** * markdown 模板模板参数 */ - val params: Params?, + val params: Params? = null, /** * 原生 markdown 内容,与上面三个参数互斥,参数都传值将报错。 @@ -350,6 +351,25 @@ public data class Message( */ val values: List ) + + public companion object { + @JvmStatic + public fun createByContent(content: String): Markdown { + return Markdown(content = content) + } + + @JvmStatic + @JvmOverloads + public fun createByTemplateId(templateId: Int, params: Params? = null): Markdown { + return Markdown(templateId = templateId, params = params) + } + + @JvmStatic + @JvmOverloads + public fun createByCustomTemplateId(customTemplateId: String, params: Params? = null): Markdown { + return Markdown(customTemplateId = customTemplateId, params = params) + } + } } } @@ -384,7 +404,6 @@ public data class MessageMember( } - internal object MessageAttachmentSerializer : KSerializer { private val serializer = MapSerializer(String.serializer(), String.serializer()) diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/model/MessageKeyboard.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/model/MessageKeyboard.kt new file mode 100644 index 00000000..45582b4d --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/model/MessageKeyboard.kt @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.model + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import love.forte.simbot.qguild.ApiModel +import kotlin.jvm.JvmStatic + + +/** + * [消息交互=>消息按钮](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/trans/msg-btn.html) + * + * @author ForteScarlet + */ +@ApiModel +@Serializable +public data class MessageKeyboard( + val id: String? = null, + @SerialName("render_data") + val renderData: RenderData? = null, + val action: Action? = null, +) { + public companion object { + /** + * Create a [MessageKeyboard] + */ + @JvmStatic + public fun create(id: String): MessageKeyboard = + MessageKeyboard(id = id) + } + + /** + * [MessageKeyboard.renderData]. + * 参考 [官方文档](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/trans/msg-btn.html) + */ + @ApiModel + @Serializable + public data class RenderData( + val label: String, + val visitedLabel: String, + val style: Int, + ) + + /** + * [Action.permission]. + * 参考 [官方文档](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/trans/msg-btn.html) + */ + @ApiModel + @Serializable + public data class ActionPermission( + val type: Int, + @SerialName("specify_user_ids") + val specifyUserIds: List? = null, + @SerialName("specify_role_ids") + val specifyRoleIds: List? = null, + ) + + /** + * [MessageKeyboard.action]. + * 参考 [官方文档](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/trans/msg-btn.html) + */ + @ApiModel + @Serializable + public data class Action( + val permission: ActionPermission? = null, + val data: String?, + val reply: Boolean? = null, + val enter: Boolean? = null, + val anchor: Int? = null, + @SerialName("unsupport_tips") + val unsupportTips: String, + ) +} diff --git a/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/model/MessageMedia.kt b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/model/MessageMedia.kt new file mode 100644 index 00000000..7c065cdf --- /dev/null +++ b/simbot-component-qq-guild-api/src/commonMain/kotlin/love/forte/simbot/qguild/model/MessageMedia.kt @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.qguild.model + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +import love.forte.simbot.qguild.ApiModel + + +/** + * [富媒体消息](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/send-receive/rich-media.html) + * + * @property fileUuid 文件 ID + * @property fileInfo 文件信息,用于发消息接口的 media 字段使用 + * @property ttl 有效期,表示剩余多少秒到期,到期后 file_info 失效,当等于 0 时,表示可长期使用 + * @property id 发送消息的唯一ID,当srv_send_msg设置为true时返回 + * + * @author ForteScarlet + */ +@ApiModel +@Serializable +public data class MessageMedia( + @SerialName("file_uuid") + val fileUuid: String, + @SerialName("file_info") + val fileInfo: String, + val ttl: Int, + val id: String? = null, +) + +/** + * [富媒体消息](https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/send-receive/rich-media.html) + * + * @property fileInfo 文件信息,用于发消息接口的 media 字段使用 + * + * @author ForteScarlet + */ +@ApiModel +@Serializable +public data class SendMessageMedia( + // TODO + @SerialName("file_info") + val fileInfo: String, +) + +/** + * [MessageMedia] to [SendMessageMedia] + */ +public fun MessageMedia.forSend(): SendMessageMedia = SendMessageMedia(fileInfo) diff --git a/simbot-component-qq-guild-api/src/jvmMain/java/module-info.java b/simbot-component-qq-guild-api/src/jvmMain/java/module-info.java index 25f67d3b..50f0b417 100644 --- a/simbot-component-qq-guild-api/src/jvmMain/java/module-info.java +++ b/simbot-component-qq-guild-api/src/jvmMain/java/module-info.java @@ -26,6 +26,8 @@ exports love.forte.simbot.qguild.model.forum; exports love.forte.simbot.qguild.time; exports love.forte.simbot.qguild.api; + exports love.forte.simbot.qguild.api.files; + exports love.forte.simbot.qguild.api.app; exports love.forte.simbot.qguild.api.announces; exports love.forte.simbot.qguild.api.apipermission; exports love.forte.simbot.qguild.api.channel; @@ -39,6 +41,8 @@ exports love.forte.simbot.qguild.api.message; exports love.forte.simbot.qguild.api.message.direct; exports love.forte.simbot.qguild.api.message.setting; + exports love.forte.simbot.qguild.api.message.group; + exports love.forte.simbot.qguild.api.message.user; exports love.forte.simbot.qguild.api.role; exports love.forte.simbot.qguild.api.user; } diff --git a/simbot-component-qq-guild-api/src/jvmMain/kotlin/love/forte/simbot/qguild/api/ApiRequests.jvm.kt b/simbot-component-qq-guild-api/src/jvmMain/kotlin/love/forte/simbot/qguild/api/ApiRequests.jvm.kt index 679797ae..b7c30fb9 100644 --- a/simbot-component-qq-guild-api/src/jvmMain/kotlin/love/forte/simbot/qguild/api/ApiRequests.jvm.kt +++ b/simbot-component-qq-guild-api/src/jvmMain/kotlin/love/forte/simbot/qguild/api/ApiRequests.jvm.kt @@ -69,10 +69,11 @@ public fun newJson( @JvmOverloads public fun QQGuildApi<*>.requestBlocking( client: HttpClient, - token: String, + token: String?, server: Url = QQGuild.URL, + appId: String? = null, ): HttpResponse = runInNoScopeBlocking { - request(client, token, server) + request(client = client, token = token, server = server, appId = appId) } /** @@ -83,10 +84,11 @@ public fun QQGuildApi<*>.requestBlocking( @JvmOverloads public fun QQGuildApi<*>.requestTextBlocking( client: HttpClient, - token: String, + token: String?, server: Url = QQGuild.URL, + appId: String? = null, ): String = runInNoScopeBlocking { - requestText(client, token, server) + requestText(client = client, token = token, server = server, appId = appId) } /** @@ -96,10 +98,11 @@ public fun QQGuildApi<*>.requestTextBlocking( @JvmOverloads public fun QQGuildApi.requestDataBlocking( client: HttpClient, - token: String, + token: String?, server: Url = QQGuild.URL, + appId: String? = null, ): R = runInNoScopeBlocking { - requestData(client, token, server) + requestData(client = client, token = token, server = server, appId = appId) } /** @@ -113,8 +116,9 @@ public fun QQGuildApi<*>.requestAsync( token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, + appId: String? = null, ): CompletableFuture = (scope ?: client).future { - request(client, token, server) + request(client = client, token = token, server = server, appId = appId) } /** @@ -128,8 +132,9 @@ public fun QQGuildApi<*>.requestTextAsync( token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, + appId: String? = null, ): CompletableFuture = (scope ?: client).future { - requestText(client, token, server) + requestText(client = client, token = token, server = server, appId = appId) } /** @@ -142,8 +147,9 @@ public fun QQGuildApi.requestDataAsync( token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, + appId: String? = null, ): CompletableFuture = (scope ?: client).future { - requestData(client, token, server) + requestData(client = client, token = token, server = server, appId = appId) } /** @@ -159,8 +165,9 @@ public fun QQGuildApi<*>.requestReserve( token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, + appId: String? = null, ): SuspendReserve = suspendReserve(scope = (scope ?: client), context = EmptyCoroutineContext) { - request(client, token, server) + request(client = client, token = token, server = server, appId = appId) } /** @@ -176,8 +183,9 @@ public fun QQGuildApi<*>.requestTextReserve( token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, + appId: String? = null, ): SuspendReserve = suspendReserve(scope = (scope ?: client), context = EmptyCoroutineContext) { - requestText(client, token, server) + requestText(client = client, token = token, server = server, appId = appId) } /** @@ -193,6 +201,7 @@ public fun QQGuildApi.requestDataReserve( token: String, server: Url = QQGuild.URL, scope: CoroutineScope? = null, + appId: String? = null, ): SuspendReserve = suspendReserve(scope = (scope ?: client), context = EmptyCoroutineContext) { - requestData(client, token, server) + requestData(client = client, token = token, server = server, appId = appId) } diff --git a/simbot-component-qq-guild-core/api/simbot-component-qq-guild-core.api b/simbot-component-qq-guild-core/api/simbot-component-qq-guild-core.api index 7eaa481d..40f2fa4b 100644 --- a/simbot-component-qq-guild-core/api/simbot-component-qq-guild-core.api +++ b/simbot-component-qq-guild-core/api/simbot-component-qq-guild-core.api @@ -72,11 +72,11 @@ public abstract interface class love/forte/simbot/component/qguild/QQGuildUsageB public abstract fun component (Llove/forte/simbot/common/function/ConfigurerFunction;)V } -public abstract interface class love/forte/simbot/component/qguild/bot/QGBot : love/forte/simbot/bot/Bot { +public abstract interface class love/forte/simbot/component/qguild/bot/QGBot : love/forte/simbot/ability/EventMentionAware, love/forte/simbot/bot/Bot { public abstract fun getAvatar ()Ljava/lang/String; public abstract fun getComponent ()Llove/forte/simbot/component/qguild/QQGuildComponent; public fun getContactRelation ()Llove/forte/simbot/bot/ContactRelation; - public fun getGroupRelation ()Llove/forte/simbot/bot/GroupRelation; + public abstract fun getGroupRelation ()Llove/forte/simbot/component/qguild/group/QGGroupRelation; public abstract fun getGuildRelation ()Llove/forte/simbot/component/qguild/guild/QGGuildRelation; public fun getId ()Llove/forte/simbot/common/id/ID; public fun getMe ()Llove/forte/simbot/qguild/model/User; @@ -89,6 +89,7 @@ public abstract interface class love/forte/simbot/component/qguild/bot/QGBot : l public abstract fun getSource ()Llove/forte/simbot/qguild/stdlib/Bot; public abstract fun getUserId ()Llove/forte/simbot/common/id/ID; public abstract fun isMe (Llove/forte/simbot/common/id/ID;)Z + public fun isMention (Llove/forte/simbot/event/Event;)Z public synthetic fun me (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract synthetic fun me (ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun me$suspendImpl (Llove/forte/simbot/component/qguild/bot/QGBot;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -105,6 +106,14 @@ public abstract interface class love/forte/simbot/component/qguild/bot/QGBot : l public fun sendToReserve (Llove/forte/simbot/common/id/ID;Llove/forte/simbot/message/Message;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public fun sendToReserve (Llove/forte/simbot/common/id/ID;Llove/forte/simbot/message/MessageContent;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; public abstract synthetic fun start (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract synthetic fun uploadGroupMedia (Llove/forte/simbot/common/id/ID;Ljava/lang/String;ILkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun uploadGroupMediaAsync (Llove/forte/simbot/common/id/ID;Ljava/lang/String;I)Ljava/util/concurrent/CompletableFuture; + public fun uploadGroupMediaBlocking (Llove/forte/simbot/common/id/ID;Ljava/lang/String;I)Llove/forte/simbot/component/qguild/message/QGMedia; + public fun uploadGroupMediaReserve (Llove/forte/simbot/common/id/ID;Ljava/lang/String;I)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public abstract synthetic fun uploadUserMedia (Llove/forte/simbot/common/id/ID;Ljava/lang/String;ILkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun uploadUserMediaAsync (Llove/forte/simbot/common/id/ID;Ljava/lang/String;I)Ljava/util/concurrent/CompletableFuture; + public fun uploadUserMediaBlocking (Llove/forte/simbot/common/id/ID;Ljava/lang/String;I)Llove/forte/simbot/component/qguild/message/QGMedia; + public fun uploadUserMediaReserve (Llove/forte/simbot/common/id/ID;Ljava/lang/String;I)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; } public abstract interface annotation class love/forte/simbot/component/qguild/bot/QGBotManagerConfigurationDsl : java/lang/annotation/Annotation { @@ -715,6 +724,59 @@ public abstract class love/forte/simbot/component/qguild/event/QGBotStartedEvent public fun getTime ()Llove/forte/simbot/common/time/Timestamp; } +public abstract class love/forte/simbot/component/qguild/event/QGC2CManagementEvent : love/forte/simbot/component/qguild/event/QGBotEvent, love/forte/simbot/event/ContactEvent { + public fun ()V + protected final fun computeId (Llove/forte/simbot/qguild/event/C2CManagementData;)Llove/forte/simbot/common/id/ID; + public abstract synthetic fun content (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public synthetic fun getContent ()Ljava/lang/Object; + public fun getContent ()Llove/forte/simbot/component/qguild/friend/QGFriend; + public synthetic fun getContent ()Llove/forte/simbot/definition/Actor; + public synthetic fun getContent ()Llove/forte/simbot/definition/Contact; + public fun getContentAsync ()Ljava/util/concurrent/CompletableFuture; + public fun getContentReserve ()Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public abstract fun getId ()Llove/forte/simbot/common/id/ID; + public fun getTime ()Llove/forte/simbot/common/time/Timestamp; +} + +public abstract class love/forte/simbot/component/qguild/event/QGC2CMessageCreateEvent : love/forte/simbot/component/qguild/event/QGBotEvent, love/forte/simbot/event/ContactMessageEvent { + public fun ()V + public abstract synthetic fun content (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getAuthorId ()Llove/forte/simbot/common/id/ID; + public abstract fun getBot ()Llove/forte/simbot/component/qguild/bot/QGBot; + public synthetic fun getContent ()Ljava/lang/Object; + public fun getContent ()Llove/forte/simbot/component/qguild/friend/QGFriend; + public synthetic fun getContent ()Llove/forte/simbot/definition/Actor; + public synthetic fun getContent ()Llove/forte/simbot/definition/Contact; + public fun getContentAsync ()Ljava/util/concurrent/CompletableFuture; + public fun getContentReserve ()Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public fun getId ()Llove/forte/simbot/common/id/ID; + public abstract fun getMessageContent ()Llove/forte/simbot/component/qguild/message/QGGroupAndC2CMessageContent; + public fun getTime ()Llove/forte/simbot/common/time/Timestamp; + public abstract synthetic fun reply (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract synthetic fun reply (Llove/forte/simbot/message/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract synthetic fun reply (Llove/forte/simbot/message/MessageContent;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun replyAsync (Ljava/lang/String;)Ljava/util/concurrent/CompletableFuture; + public fun replyAsync (Llove/forte/simbot/message/Message;)Ljava/util/concurrent/CompletableFuture; + public fun replyAsync (Llove/forte/simbot/message/MessageContent;)Ljava/util/concurrent/CompletableFuture; + public fun replyBlocking (Ljava/lang/String;)Llove/forte/simbot/component/qguild/message/QGMessageReceipt; + public synthetic fun replyBlocking (Ljava/lang/String;)Llove/forte/simbot/message/MessageReceipt; + public fun replyBlocking (Llove/forte/simbot/message/Message;)Llove/forte/simbot/component/qguild/message/QGMessageReceipt; + public synthetic fun replyBlocking (Llove/forte/simbot/message/Message;)Llove/forte/simbot/message/MessageReceipt; + public fun replyBlocking (Llove/forte/simbot/message/MessageContent;)Llove/forte/simbot/component/qguild/message/QGMessageReceipt; + public synthetic fun replyBlocking (Llove/forte/simbot/message/MessageContent;)Llove/forte/simbot/message/MessageReceipt; + public fun replyReserve (Ljava/lang/String;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public fun replyReserve (Llove/forte/simbot/message/Message;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public fun replyReserve (Llove/forte/simbot/message/MessageContent;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; +} + +public abstract class love/forte/simbot/component/qguild/event/QGC2CMsgReceiveEvent : love/forte/simbot/component/qguild/event/QGC2CManagementEvent { + public fun ()V +} + +public abstract class love/forte/simbot/component/qguild/event/QGC2CMsgRejectEvent : love/forte/simbot/component/qguild/event/QGC2CManagementEvent { + public fun ()V +} + public abstract class love/forte/simbot/component/qguild/event/QGChannelCreateEvent : love/forte/simbot/component/qguild/event/QGChannelEvent, love/forte/simbot/event/OrganizationChangeEvent { public fun ()V public abstract synthetic fun channel (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -865,6 +927,87 @@ public abstract class love/forte/simbot/component/qguild/event/QGForumThreadUpda public fun toString ()Ljava/lang/String; } +public abstract class love/forte/simbot/component/qguild/event/QGFriendAddEvent : love/forte/simbot/component/qguild/event/QGC2CManagementEvent { + public fun ()V +} + +public abstract class love/forte/simbot/component/qguild/event/QGFriendDelEvent : love/forte/simbot/component/qguild/event/QGC2CManagementEvent { + public fun ()V +} + +public abstract class love/forte/simbot/component/qguild/event/QGGroupAddRobotEvent : love/forte/simbot/component/qguild/event/QGGroupManagementEvent { + public fun ()V +} + +public abstract class love/forte/simbot/component/qguild/event/QGGroupAtMessageCreateEvent : love/forte/simbot/component/qguild/event/QGBotEvent, love/forte/simbot/event/ChatGroupMessageEvent { + public fun ()V + public abstract synthetic fun author (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract synthetic fun content (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public synthetic fun getAuthor ()Llove/forte/simbot/common/id/IDContainer; + public fun getAuthor ()Llove/forte/simbot/component/qguild/group/QGGroupMember; + public synthetic fun getAuthor ()Llove/forte/simbot/definition/Actor; + public synthetic fun getAuthor ()Llove/forte/simbot/definition/Member; + public fun getAuthorAsync ()Ljava/util/concurrent/CompletableFuture; + public fun getAuthorId ()Llove/forte/simbot/common/id/ID; + public fun getAuthorReserve ()Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public abstract fun getBot ()Llove/forte/simbot/component/qguild/bot/QGBot; + public synthetic fun getContent ()Ljava/lang/Object; + public fun getContent ()Llove/forte/simbot/component/qguild/group/QGGroup; + public synthetic fun getContent ()Llove/forte/simbot/definition/Actor; + public synthetic fun getContent ()Llove/forte/simbot/definition/ChatGroup; + public synthetic fun getContent ()Llove/forte/simbot/definition/ChatRoom; + public synthetic fun getContent ()Llove/forte/simbot/definition/Organization; + public fun getContentAsync ()Ljava/util/concurrent/CompletableFuture; + public fun getContentReserve ()Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public fun getId ()Llove/forte/simbot/common/id/ID; + public abstract fun getMessageContent ()Llove/forte/simbot/component/qguild/message/QGGroupAndC2CMessageContent; + public fun getTime ()Llove/forte/simbot/common/time/Timestamp; + public abstract synthetic fun reply (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract synthetic fun reply (Llove/forte/simbot/message/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract synthetic fun reply (Llove/forte/simbot/message/MessageContent;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun replyAsync (Ljava/lang/String;)Ljava/util/concurrent/CompletableFuture; + public fun replyAsync (Llove/forte/simbot/message/Message;)Ljava/util/concurrent/CompletableFuture; + public fun replyAsync (Llove/forte/simbot/message/MessageContent;)Ljava/util/concurrent/CompletableFuture; + public fun replyBlocking (Ljava/lang/String;)Llove/forte/simbot/message/MessageReceipt; + public fun replyBlocking (Llove/forte/simbot/message/Message;)Llove/forte/simbot/message/MessageReceipt; + public fun replyBlocking (Llove/forte/simbot/message/MessageContent;)Llove/forte/simbot/message/MessageReceipt; + public fun replyReserve (Ljava/lang/String;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public fun replyReserve (Llove/forte/simbot/message/Message;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public fun replyReserve (Llove/forte/simbot/message/MessageContent;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; +} + +public abstract class love/forte/simbot/component/qguild/event/QGGroupDelRobotEvent : love/forte/simbot/component/qguild/event/QGGroupManagementEvent { + public fun ()V +} + +public abstract class love/forte/simbot/component/qguild/event/QGGroupManagementEvent : love/forte/simbot/component/qguild/event/QGBotEvent, love/forte/simbot/event/ChatGroupEvent { + public fun ()V + protected final fun computeId (Llove/forte/simbot/qguild/event/GroupRobotManagementData;)Llove/forte/simbot/common/id/ID; + public abstract synthetic fun content (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public synthetic fun getContent ()Ljava/lang/Object; + public fun getContent ()Llove/forte/simbot/component/qguild/group/QGGroup; + public synthetic fun getContent ()Llove/forte/simbot/definition/Actor; + public synthetic fun getContent ()Llove/forte/simbot/definition/ChatGroup; + public synthetic fun getContent ()Llove/forte/simbot/definition/ChatRoom; + public synthetic fun getContent ()Llove/forte/simbot/definition/Organization; + public fun getContentAsync ()Ljava/util/concurrent/CompletableFuture; + public fun getContentReserve ()Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public abstract fun getId ()Llove/forte/simbot/common/id/ID; + public fun getOperator ()Llove/forte/simbot/component/qguild/group/QGGroupMember; + public fun getOperatorAsync ()Ljava/util/concurrent/CompletableFuture; + public fun getOperatorReserve ()Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public fun getTime ()Llove/forte/simbot/common/time/Timestamp; + public abstract synthetic fun operator (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public abstract class love/forte/simbot/component/qguild/event/QGGroupMsgReceiveEvent : love/forte/simbot/component/qguild/event/QGGroupManagementEvent { + public fun ()V +} + +public abstract class love/forte/simbot/component/qguild/event/QGGroupMsgRejectEvent : love/forte/simbot/component/qguild/event/QGGroupManagementEvent { + public fun ()V +} + public abstract class love/forte/simbot/component/qguild/event/QGGuildCreateEvent : love/forte/simbot/component/qguild/event/QGGuildEvent, love/forte/simbot/event/ChangeEvent, love/forte/simbot/event/GuildEvent { public fun ()V public abstract synthetic fun content (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1160,6 +1303,76 @@ public abstract interface class love/forte/simbot/component/qguild/forum/QGThrea public fun title (Ljava/lang/String;)Llove/forte/simbot/component/qguild/forum/QGThreadCreator; } +public abstract interface class love/forte/simbot/component/qguild/friend/QGFriend : love/forte/simbot/definition/Contact { + public fun getAvatar ()Ljava/lang/String; + public abstract fun getCoroutineContext ()Lkotlin/coroutines/CoroutineContext; + public abstract fun getId ()Llove/forte/simbot/common/id/ID; + public fun getName ()Ljava/lang/String; + public abstract synthetic fun uploadMedia (Ljava/lang/String;ILkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun uploadMediaAsync (Ljava/lang/String;I)Ljava/util/concurrent/CompletableFuture; + public fun uploadMediaBlocking (Ljava/lang/String;I)Llove/forte/simbot/component/qguild/message/QGMedia; + public fun uploadMediaReserve (Ljava/lang/String;I)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; +} + +public abstract interface class love/forte/simbot/component/qguild/group/QGGroup : love/forte/simbot/definition/ChatGroup { + public abstract synthetic fun botAsMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun getBotAsMember ()Llove/forte/simbot/component/qguild/group/QGGroupMember; + public synthetic fun getBotAsMember ()Llove/forte/simbot/definition/Member; + public fun getBotAsMemberAsync ()Ljava/util/concurrent/CompletableFuture; + public fun getBotAsMemberReserve ()Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public abstract fun getId ()Llove/forte/simbot/common/id/ID; + public fun getMember (Llove/forte/simbot/common/id/ID;)Llove/forte/simbot/component/qguild/group/QGGroupMember; + public synthetic fun getMember (Llove/forte/simbot/common/id/ID;)Llove/forte/simbot/definition/Member; + public fun getMemberAsync (Llove/forte/simbot/common/id/ID;)Ljava/util/concurrent/CompletableFuture; + public fun getMemberReserve (Llove/forte/simbot/common/id/ID;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public fun getMembers ()Llove/forte/simbot/common/collectable/Collectable; + public fun getName ()Ljava/lang/String; + public fun getOwnerId ()Llove/forte/simbot/common/id/ID; + public fun getRoles ()Llove/forte/simbot/common/collectable/Collectable; + public synthetic fun member (Llove/forte/simbot/common/id/ID;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun member$suspendImpl (Llove/forte/simbot/component/qguild/group/QGGroup;Llove/forte/simbot/common/id/ID;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract synthetic fun uploadMedia (Ljava/lang/String;ILkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun uploadMediaAsync (Ljava/lang/String;I)Ljava/util/concurrent/CompletableFuture; + public fun uploadMediaBlocking (Ljava/lang/String;I)Llove/forte/simbot/component/qguild/message/QGMedia; + public fun uploadMediaReserve (Ljava/lang/String;I)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; +} + +public abstract interface class love/forte/simbot/component/qguild/group/QGGroupMember : love/forte/simbot/definition/Member { + public fun getAvatar ()Ljava/lang/String; + public abstract fun getId ()Llove/forte/simbot/common/id/ID; + public fun getName ()Ljava/lang/String; + public fun getNick ()Ljava/lang/String; + public synthetic fun send (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public synthetic fun send (Llove/forte/simbot/message/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public synthetic fun send (Llove/forte/simbot/message/MessageContent;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun send$suspendImpl (Llove/forte/simbot/component/qguild/group/QGGroupMember;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun send$suspendImpl (Llove/forte/simbot/component/qguild/group/QGGroupMember;Llove/forte/simbot/message/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun send$suspendImpl (Llove/forte/simbot/component/qguild/group/QGGroupMember;Llove/forte/simbot/message/MessageContent;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public abstract interface class love/forte/simbot/component/qguild/group/QGGroupRelation : love/forte/simbot/bot/GroupRelation { + public fun getGroup (Llove/forte/simbot/common/id/ID;)Llove/forte/simbot/component/qguild/group/QGGroup; + public synthetic fun getGroup (Llove/forte/simbot/common/id/ID;)Llove/forte/simbot/definition/ChatGroup; + public fun getGroupAsync (Llove/forte/simbot/common/id/ID;)Ljava/util/concurrent/CompletableFuture; + public fun getGroupReserve (Llove/forte/simbot/common/id/ID;)Llove/forte/simbot/suspendrunner/reserve/SuspendReserve; + public fun getGroups ()Llove/forte/simbot/common/collectable/Collectable; + public abstract synthetic fun group (Llove/forte/simbot/common/id/ID;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public synthetic fun groupCount (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun groupCount$suspendImpl (Llove/forte/simbot/component/qguild/group/QGGroupRelation;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public final class love/forte/simbot/component/qguild/group/QGGroupRole : java/lang/Enum, love/forte/simbot/definition/Role { + public static final field ADMIN Llove/forte/simbot/component/qguild/group/QGGroupRole; + public static final field MEMBER Llove/forte/simbot/component/qguild/group/QGGroupRole; + public static final field OWNER Llove/forte/simbot/component/qguild/group/QGGroupRole; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getId ()Llove/forte/simbot/common/id/ID; + public synthetic fun getName ()Ljava/lang/String; + public fun isAdmin ()Z + public static fun valueOf (Ljava/lang/String;)Llove/forte/simbot/component/qguild/group/QGGroupRole; + public static fun values ()[Llove/forte/simbot/component/qguild/group/QGGroupRole; +} + public abstract interface class love/forte/simbot/component/qguild/guild/QGGuild : kotlinx/coroutines/CoroutineScope, love/forte/simbot/component/qguild/QGObjectiveContainer, love/forte/simbot/definition/Guild { public abstract fun botAsMember (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public abstract synthetic fun category (Llove/forte/simbot/common/id/ID;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1271,27 +1484,52 @@ public final class love/forte/simbot/component/qguild/internal/bot/QGBotImpl$inl public final synthetic fun apply (Ljava/lang/Object;)Ljava/lang/Object; } -public final class love/forte/simbot/component/qguild/internal/message/QGSingleMessageReceiptImplKt { +public final class love/forte/simbot/component/qguild/internal/message/QGMessageReceiptImplKt { + public static final fun asGroupReceipt (Ljava/lang/Iterable;)Llove/forte/simbot/component/qguild/message/QGAggregatedIdMessageReceipt; + public static final fun asReceipt (Llove/forte/simbot/qguild/api/message/group/GroupMessageSendResult;)Llove/forte/simbot/component/qguild/message/QGSingleIdMessageReceipt; + public static final fun asReceipt (Llove/forte/simbot/qguild/api/message/user/UserMessageSendResult;)Llove/forte/simbot/component/qguild/message/QGSingleIdMessageReceipt; public static final fun asReceipt (Llove/forte/simbot/qguild/model/Message;)Llove/forte/simbot/component/qguild/message/QGSingleMessageReceipt; + public static final fun asUserReceipt (Ljava/lang/Iterable;)Llove/forte/simbot/component/qguild/message/QGAggregatedIdMessageReceipt; } public final class love/forte/simbot/component/qguild/message/ImageParser : love/forte/simbot/component/qguild/message/SendingMessageParser { public static final field INSTANCE Llove/forte/simbot/component/qguild/message/ImageParser; public fun invoke (ILlove/forte/simbot/message/Message$Element;Llove/forte/simbot/message/Messages;Llove/forte/simbot/component/qguild/message/SendingMessageParser$BuilderContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public synthetic fun invoke (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; + public fun invoke (ILlove/forte/simbot/message/Message$Element;Llove/forte/simbot/message/Messages;Llove/forte/simbot/component/qguild/message/SendingMessageParser$GroupAndC2CBuilderContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } public final class love/forte/simbot/component/qguild/message/MessageParsers { public static final field INSTANCE Llove/forte/simbot/component/qguild/message/MessageParsers; - public final fun parse (Llove/forte/simbot/message/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun parse (Llove/forte/simbot/message/Message;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public final fun parse (Llove/forte/simbot/message/Message;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public final fun parse (Ljava/lang/String;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; + public final fun parse (Ljava/lang/String;Ljava/util/List;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; + public final fun parse (Ljava/lang/String;Ljava/util/List;Llove/forte/simbot/message/Messages;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; + public final synthetic fun parse (Llove/forte/simbot/message/Message;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun parse (Llove/forte/simbot/qguild/model/Message;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; public final fun parse (Llove/forte/simbot/qguild/model/Message;Llove/forte/simbot/message/Messages;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; + public static synthetic fun parse$default (Llove/forte/simbot/component/qguild/message/MessageParsers;Ljava/lang/String;Ljava/util/List;Llove/forte/simbot/message/Messages;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; public static synthetic fun parse$default (Llove/forte/simbot/component/qguild/message/MessageParsers;Llove/forte/simbot/message/Message;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; public static synthetic fun parse$default (Llove/forte/simbot/component/qguild/message/MessageParsers;Llove/forte/simbot/qguild/model/Message;Llove/forte/simbot/message/Messages;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; } +public final class love/forte/simbot/component/qguild/message/MessageSenderKt { + public static final fun sendGroupMessage (Llove/forte/simbot/component/qguild/bot/QGBot;Ljava/lang/String;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun sendGroupMessage (Llove/forte/simbot/component/qguild/bot/QGBot;Ljava/lang/String;Llove/forte/simbot/message/Message;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun sendGroupMessage (Llove/forte/simbot/component/qguild/bot/QGBot;Ljava/lang/String;Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendGroupMessage$default (Llove/forte/simbot/component/qguild/bot/QGBot;Ljava/lang/String;Llove/forte/simbot/message/Message;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun sendUserMessage (Llove/forte/simbot/component/qguild/bot/QGBot;Ljava/lang/String;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun sendUserMessage (Llove/forte/simbot/component/qguild/bot/QGBot;Ljava/lang/String;Llove/forte/simbot/message/Message;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun sendUserMessage (Llove/forte/simbot/component/qguild/bot/QGBot;Ljava/lang/String;Llove/forte/simbot/qguild/api/message/GroupAndC2CSendBody;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun sendUserMessage$default (Llove/forte/simbot/component/qguild/bot/QGBot;Ljava/lang/String;Llove/forte/simbot/message/Message;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; +} + +public abstract class love/forte/simbot/component/qguild/message/QGAggregatedIdMessageReceipt : love/forte/simbot/message/AggregatedMessageReceipt, love/forte/simbot/component/qguild/message/QGMessageReceipt { + public fun ()V + public fun delete ([Llove/forte/simbot/ability/DeleteOption;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun get (I)Llove/forte/simbot/component/qguild/message/QGSingleIdMessageReceipt; + public abstract fun getSize ()I + public abstract fun iterator ()Ljava/util/Iterator; +} + public abstract class love/forte/simbot/component/qguild/message/QGAggregatedMessageReceipt : love/forte/simbot/message/AggregatedMessageReceipt, love/forte/simbot/component/qguild/message/QGMessageReceipt { public fun ()V public fun delete ([Llove/forte/simbot/ability/DeleteOption;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -1405,6 +1643,14 @@ public final class love/forte/simbot/component/qguild/message/QGAttachmentMessag public static final fun toAttachment (Llove/forte/simbot/component/qguild/message/QGAttachmentMessage;)Llove/forte/simbot/qguild/model/Message$Attachment; } +public abstract class love/forte/simbot/component/qguild/message/QGBaseMessageContent : love/forte/simbot/message/MessageContent { + public fun ()V + public abstract fun getId ()Llove/forte/simbot/common/id/ID; + public abstract fun getMessages ()Llove/forte/simbot/message/Messages; + public abstract fun getPlainText ()Ljava/lang/String; + public abstract fun getSourceContent ()Ljava/lang/String; +} + public final class love/forte/simbot/component/qguild/message/QGContentText : love/forte/simbot/component/qguild/message/QGMessageElement, love/forte/simbot/message/PlainText { public static final field Companion Llove/forte/simbot/component/qguild/message/QGContentText$Companion; public fun (Ljava/lang/String;)V @@ -1467,12 +1713,83 @@ public final class love/forte/simbot/component/qguild/message/QGEmbedKt { public static final fun buildQGEmbed (Lkotlin/jvm/functions/Function1;)Llove/forte/simbot/component/qguild/message/QGEmbed; } -public abstract class love/forte/simbot/component/qguild/message/QGMessageContent : love/forte/simbot/message/MessageContent { +public abstract class love/forte/simbot/component/qguild/message/QGGroupAndC2CMessageContent : love/forte/simbot/component/qguild/message/QGBaseMessageContent { + public fun ()V + public synthetic fun delete ([Llove/forte/simbot/ability/DeleteOption;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun getAttachments ()Ljava/util/List; + public abstract fun getSourceContent ()Ljava/lang/String; +} + +public final class love/forte/simbot/component/qguild/message/QGMarkdown : love/forte/simbot/component/qguild/message/QGMessageElement { + public static final field Companion Llove/forte/simbot/component/qguild/message/QGMarkdown$Companion; + public static final fun byMarkdown (Llove/forte/simbot/qguild/model/Message$Markdown;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public final fun component1 ()Llove/forte/simbot/qguild/model/Message$Markdown; + public final fun copy (Llove/forte/simbot/qguild/model/Message$Markdown;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public static synthetic fun copy$default (Llove/forte/simbot/component/qguild/message/QGMarkdown;Llove/forte/simbot/qguild/model/Message$Markdown;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public static final fun create (Ljava/lang/String;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public static final fun createByCustomTemplateId (Ljava/lang/String;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public static final fun createByCustomTemplateId (Ljava/lang/String;Llove/forte/simbot/qguild/model/Message$Markdown$Params;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public static final fun createByTemplateId (I)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public static final fun createByTemplateId (ILlove/forte/simbot/qguild/model/Message$Markdown$Params;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public fun equals (Ljava/lang/Object;)Z + public final fun getMarkdown ()Llove/forte/simbot/qguild/model/Message$Markdown; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/component/qguild/message/QGMarkdown$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/component/qguild/message/QGMarkdown$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/component/qguild/message/QGMarkdown;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/component/qguild/message/QGMarkdown$Companion { + public final fun byMarkdown (Llove/forte/simbot/qguild/model/Message$Markdown;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public final fun create (Ljava/lang/String;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public final fun createByCustomTemplateId (Ljava/lang/String;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public final fun createByCustomTemplateId (Ljava/lang/String;Llove/forte/simbot/qguild/model/Message$Markdown$Params;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public static synthetic fun createByCustomTemplateId$default (Llove/forte/simbot/component/qguild/message/QGMarkdown$Companion;Ljava/lang/String;Llove/forte/simbot/qguild/model/Message$Markdown$Params;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public final fun createByTemplateId (I)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public final fun createByTemplateId (ILlove/forte/simbot/qguild/model/Message$Markdown$Params;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public static synthetic fun createByTemplateId$default (Llove/forte/simbot/component/qguild/message/QGMarkdown$Companion;ILlove/forte/simbot/qguild/model/Message$Markdown$Params;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/QGMarkdown; + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/component/qguild/message/QGMedia : love/forte/simbot/component/qguild/message/QGMessageElement { + public static final field Companion Llove/forte/simbot/component/qguild/message/QGMedia$Companion; + public fun (Llove/forte/simbot/qguild/model/MessageMedia;)V + public final fun component1 ()Llove/forte/simbot/qguild/model/MessageMedia; + public final fun copy (Llove/forte/simbot/qguild/model/MessageMedia;)Llove/forte/simbot/component/qguild/message/QGMedia; + public static synthetic fun copy$default (Llove/forte/simbot/component/qguild/message/QGMedia;Llove/forte/simbot/qguild/model/MessageMedia;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/QGMedia; + public fun equals (Ljava/lang/Object;)Z + public final fun getMedia ()Llove/forte/simbot/qguild/model/MessageMedia; + public fun hashCode ()I + public fun toString ()Ljava/lang/String; +} + +public synthetic class love/forte/simbot/component/qguild/message/QGMedia$$serializer : kotlinx/serialization/internal/GeneratedSerializer { + public static final field INSTANCE Llove/forte/simbot/component/qguild/message/QGMedia$$serializer; + public final fun childSerializers ()[Lkotlinx/serialization/KSerializer; + public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object; + public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Llove/forte/simbot/component/qguild/message/QGMedia; + public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor; + public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V + public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Llove/forte/simbot/component/qguild/message/QGMedia;)V + public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer; +} + +public final class love/forte/simbot/component/qguild/message/QGMedia$Companion { + public final fun serializer ()Lkotlinx/serialization/KSerializer; +} + +public abstract class love/forte/simbot/component/qguild/message/QGMessageContent : love/forte/simbot/component/qguild/message/QGBaseMessageContent { public fun ()V public synthetic fun delete ([Llove/forte/simbot/ability/DeleteOption;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun getId ()Llove/forte/simbot/common/id/ID; - public abstract fun getMessages ()Llove/forte/simbot/message/Messages; - public abstract fun getPlainText ()Ljava/lang/String; public abstract fun getSourceMessage ()Llove/forte/simbot/qguild/model/Message; } @@ -1527,11 +1844,15 @@ public final class love/forte/simbot/component/qguild/message/QGReference$Compan public final class love/forte/simbot/component/qguild/message/QGReplyTo : love/forte/simbot/component/qguild/message/QGMessageElement { public static final field Companion Llove/forte/simbot/component/qguild/message/QGReplyTo$Companion; public fun (Llove/forte/simbot/common/id/ID;)V + public fun (Llove/forte/simbot/common/id/ID;Ljava/lang/Integer;)V + public synthetic fun (Llove/forte/simbot/common/id/ID;Ljava/lang/Integer;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Llove/forte/simbot/common/id/ID; - public final fun copy (Llove/forte/simbot/common/id/ID;)Llove/forte/simbot/component/qguild/message/QGReplyTo; - public static synthetic fun copy$default (Llove/forte/simbot/component/qguild/message/QGReplyTo;Llove/forte/simbot/common/id/ID;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/QGReplyTo; + public final fun component2 ()Ljava/lang/Integer; + public final fun copy (Llove/forte/simbot/common/id/ID;Ljava/lang/Integer;)Llove/forte/simbot/component/qguild/message/QGReplyTo; + public static synthetic fun copy$default (Llove/forte/simbot/component/qguild/message/QGReplyTo;Llove/forte/simbot/common/id/ID;Ljava/lang/Integer;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/QGReplyTo; public fun equals (Ljava/lang/Object;)Z public final fun getId ()Llove/forte/simbot/common/id/ID; + public final fun getSeq ()Ljava/lang/Integer; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -1554,50 +1875,76 @@ public final class love/forte/simbot/component/qguild/message/QGReplyTo$Companio public abstract interface annotation class love/forte/simbot/component/qguild/message/QGSendOnly : java/lang/annotation/Annotation { } +public abstract class love/forte/simbot/component/qguild/message/QGSingleIdMessageReceipt : love/forte/simbot/message/SingleMessageReceipt, love/forte/simbot/component/qguild/message/QGMessageReceipt { + public fun ()V + public abstract fun getId ()Llove/forte/simbot/common/id/ID; +} + public abstract class love/forte/simbot/component/qguild/message/QGSingleMessageReceipt : love/forte/simbot/message/SingleMessageReceipt, love/forte/simbot/component/qguild/message/QGMessageReceipt { public fun ()V public abstract fun getMessageResult ()Llove/forte/simbot/qguild/model/Message; } public abstract interface class love/forte/simbot/component/qguild/message/ReceivingMessageParser { + public abstract fun invoke (Ljava/lang/String;Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; public abstract fun invoke (Llove/forte/simbot/qguild/model/Message;Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; } public final class love/forte/simbot/component/qguild/message/ReceivingMessageParser$Context { - public fun (Llove/forte/simbot/message/Messages;Ljava/lang/StringBuilder;)V + public fun (Llove/forte/simbot/message/Messages;Ljava/lang/StringBuilder;Ljava/util/List;)V + public synthetic fun (Llove/forte/simbot/message/Messages;Ljava/lang/StringBuilder;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V public final fun component1 ()Llove/forte/simbot/message/Messages; public final fun component2 ()Ljava/lang/StringBuilder; - public final fun copy (Llove/forte/simbot/message/Messages;Ljava/lang/StringBuilder;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; - public static synthetic fun copy$default (Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context;Llove/forte/simbot/message/Messages;Ljava/lang/StringBuilder;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; + public final fun component3 ()Ljava/util/List; + public final fun copy (Llove/forte/simbot/message/Messages;Ljava/lang/StringBuilder;Ljava/util/List;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; + public static synthetic fun copy$default (Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context;Llove/forte/simbot/message/Messages;Ljava/lang/StringBuilder;Ljava/util/List;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/ReceivingMessageParser$Context; public fun equals (Ljava/lang/Object;)Z + public final fun getAttachments ()Ljava/util/List; public final fun getMessages ()Llove/forte/simbot/message/Messages; public final fun getPlainTextBuilder ()Ljava/lang/StringBuilder; public fun hashCode ()I + public final fun setAttachments (Ljava/util/List;)V public final fun setMessages (Llove/forte/simbot/message/Messages;)V public final fun setPlainTextBuilder (Ljava/lang/StringBuilder;)V public fun toString ()Ljava/lang/String; } -public abstract interface class love/forte/simbot/component/qguild/message/SendingMessageParser : kotlin/coroutines/jvm/internal/SuspendFunction, kotlin/jvm/functions/Function5 { +public abstract interface class love/forte/simbot/component/qguild/message/SendingMessageParser { public abstract fun invoke (ILlove/forte/simbot/message/Message$Element;Llove/forte/simbot/message/Messages;Llove/forte/simbot/component/qguild/message/SendingMessageParser$BuilderContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun invoke (ILlove/forte/simbot/message/Message$Element;Llove/forte/simbot/message/Messages;Llove/forte/simbot/component/qguild/message/SendingMessageParser$GroupAndC2CBuilderContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun invoke$suspendImpl (Llove/forte/simbot/component/qguild/message/SendingMessageParser;ILlove/forte/simbot/message/Message$Element;Llove/forte/simbot/message/Messages;Llove/forte/simbot/component/qguild/message/SendingMessageParser$GroupAndC2CBuilderContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } -public final class love/forte/simbot/component/qguild/message/SendingMessageParser$BuilderContext { +public abstract class love/forte/simbot/component/qguild/message/SendingMessageParser$AbstractBuilderContext { public fun (Lkotlin/jvm/functions/Function0;)V - public final fun builderOrNew (Lkotlin/jvm/functions/Function1;)Llove/forte/simbot/qguild/api/message/MessageSendApi$Body$Builder; - public final fun component1 ()Lkotlin/jvm/functions/Function0; - public final fun copy (Lkotlin/jvm/functions/Function0;)Llove/forte/simbot/component/qguild/message/SendingMessageParser$BuilderContext; - public static synthetic fun copy$default (Llove/forte/simbot/component/qguild/message/SendingMessageParser$BuilderContext;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Llove/forte/simbot/component/qguild/message/SendingMessageParser$BuilderContext; - public fun equals (Ljava/lang/Object;)Z - public final fun getBuilder ()Llove/forte/simbot/qguild/api/message/MessageSendApi$Body$Builder; + public final fun builderOrNew (Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public fun getBuilder ()Ljava/lang/Object; public final fun getBuilderFactory ()Lkotlin/jvm/functions/Function0; public final fun getBuilders ()Lkotlin/collections/ArrayDeque; - public final fun getNextIsNew ()Z - public fun hashCode ()I - public final fun newBuilder ()Llove/forte/simbot/qguild/api/message/MessageSendApi$Body$Builder; - public final fun nextMustBeNew (Z)V - public static synthetic fun nextMustBeNew$default (Llove/forte/simbot/component/qguild/message/SendingMessageParser$BuilderContext;ZILjava/lang/Object;)V - public fun toString ()Ljava/lang/String; + public fun getNextIsNew ()Z + public fun newBuilder ()Ljava/lang/Object; + public fun nextMustBeNew (Z)V + public static synthetic fun nextMustBeNew$default (Llove/forte/simbot/component/qguild/message/SendingMessageParser$AbstractBuilderContext;ZILjava/lang/Object;)V + protected fun setNextIsNew (Z)V +} + +public final class love/forte/simbot/component/qguild/message/SendingMessageParser$BuilderContext : love/forte/simbot/component/qguild/message/SendingMessageParser$AbstractBuilderContext { + public fun (Lkotlin/jvm/functions/Function0;)V +} + +public final class love/forte/simbot/component/qguild/message/SendingMessageParser$GroupAndC2CBuilderContext : love/forte/simbot/component/qguild/message/SendingMessageParser$AbstractBuilderContext { + public fun (Llove/forte/simbot/component/qguild/bot/QGBot;Llove/forte/simbot/component/qguild/message/SendingMessageParser$GroupBuilderType;Ljava/lang/String;Lkotlin/jvm/functions/Function0;)V + public final fun getBot ()Llove/forte/simbot/component/qguild/bot/QGBot; + public final fun getTargetOpenid ()Ljava/lang/String; + public final fun getType ()Llove/forte/simbot/component/qguild/message/SendingMessageParser$GroupBuilderType; +} + +public final class love/forte/simbot/component/qguild/message/SendingMessageParser$GroupBuilderType : java/lang/Enum { + public static final field C2C Llove/forte/simbot/component/qguild/message/SendingMessageParser$GroupBuilderType; + public static final field GROUP Llove/forte/simbot/component/qguild/message/SendingMessageParser$GroupBuilderType; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public static fun valueOf (Ljava/lang/String;)Llove/forte/simbot/component/qguild/message/SendingMessageParser$GroupBuilderType; + public static fun values ()[Llove/forte/simbot/component/qguild/message/SendingMessageParser$GroupBuilderType; } public abstract interface class love/forte/simbot/component/qguild/role/QGRoleUpdater { diff --git a/simbot-component-qq-guild-core/build.gradle.kts b/simbot-component-qq-guild-core/build.gradle.kts index b5bf025a..aa34e1e9 100644 --- a/simbot-component-qq-guild-core/build.gradle.kts +++ b/simbot-component-qq-guild-core/build.gradle.kts @@ -78,7 +78,8 @@ kotlin { } jvmTest.dependencies { - implementation(libs.ktor.client.cio) +// implementation(libs.ktor.client.cio) + implementation(libs.ktor.client.java) // runtimeOnly(libs.kotlinx.coroutines.reactor) // implementation(libs.reactor.core) diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/QQGuildComponent.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/QQGuildComponent.kt index c068ad55..5be52d10 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/QQGuildComponent.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/QQGuildComponent.kt @@ -111,11 +111,13 @@ public class QQGuildComponent : Component { public val messageSerializersModule: SerializersModule = SerializersModule { fun PolymorphicModuleBuilder.subclass0() { subclass(QGArk.serializer()) + subclass(QGMarkdown.serializer()) subclass(QGAttachmentMessage.serializer()) subclass(QGReplyTo.serializer()) subclass(QGContentText.serializer()) subclass(QGReference.serializer()) subclass(QGEmbed.serializer()) + subclass(QGMedia.serializer()) @Suppress("DEPRECATION") subclass(QGAtChannel.serializer()) diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/bot/QGBot.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/bot/QGBot.kt index 92883146..0cca089a 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/bot/QGBot.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/bot/QGBot.kt @@ -19,19 +19,28 @@ package love.forte.simbot.component.qguild.bot import io.ktor.client.* import io.ktor.client.request.* +import love.forte.simbot.ability.EventMentionAware import love.forte.simbot.bot.Bot import love.forte.simbot.bot.ContactRelation -import love.forte.simbot.bot.GroupRelation import love.forte.simbot.common.id.ID import love.forte.simbot.common.id.StringID.Companion.ID import love.forte.simbot.component.qguild.QQGuildComponent import love.forte.simbot.component.qguild.channel.QGTextChannel +import love.forte.simbot.component.qguild.event.QGAtMessageCreateEvent +import love.forte.simbot.component.qguild.event.QGGroupAtMessageCreateEvent +import love.forte.simbot.component.qguild.friend.QGFriend +import love.forte.simbot.component.qguild.group.QGGroup +import love.forte.simbot.component.qguild.group.QGGroupRelation import love.forte.simbot.component.qguild.guild.QGGuildRelation +import love.forte.simbot.component.qguild.message.QGMedia import love.forte.simbot.component.qguild.message.QGMessageReceipt +import love.forte.simbot.event.Event import love.forte.simbot.message.Message import love.forte.simbot.message.MessageContent import love.forte.simbot.qguild.QQGuildApiException import love.forte.simbot.qguild.api.MessageAuditedException +import love.forte.simbot.qguild.api.files.UploadGroupFilesApi +import love.forte.simbot.qguild.api.files.UploadUserFilesApi import love.forte.simbot.suspendrunner.ST import love.forte.simbot.suspendrunner.STP import kotlin.jvm.JvmSynthetic @@ -51,7 +60,7 @@ import love.forte.simbot.qguild.stdlib.Bot as QGSourceBot * * @author ForteScarlet */ -public interface QGBot : Bot { +public interface QGBot : Bot, EventMentionAware { /** * QQ频道的 [组件][QQGuildComponent] 对象实例。 */ @@ -114,16 +123,28 @@ public interface QGBot : Bot { */ public val avatar: String - //// Impl + /** + * 如果事件类型为 + * - [QGGroupAtMessageCreateEvent] + * - [QGAtMessageCreateEvent] + * 则直接视为bot被at了,不论消息中是否真的有at元素。 + */ + override fun isMention(event: Event): Boolean { + return when (event) { + is QGGroupAtMessageCreateEvent -> true + is QGAtMessageCreateEvent -> true + else -> false + } + } /** - * QQ频道BOT没有'群'概念,始终得到 `null`。 + * QQ群相关内容的操作。 */ - override val groupRelation: GroupRelation? - get() = null + override val groupRelation: QGGroupRelation /** - * QQ频道BOT不存在'联系人'相关操作,始终得到 `null`。 + * QQ好友、单聊相关内容没有能支持获取它们的API, + * 始终得到 `null`。 */ override val contactRelation: ContactRelation? get() = null @@ -215,4 +236,48 @@ public interface QGBot : Bot { */ @STP public suspend fun me(): QGSourceUser = me(false) + + /** + * 上传一个资源为用于向QQ群发送的 [QGMedia], 可用于后续的发送。 + * + * 目前上传仅支持使用链接,QQ平台会对此链接进行转存。 + * + * @param target 目标群的ID + * @param url 目标链接 + * @param type 媒体类型。 + * + * > 1 图片,2 视频,3 语音,4 文件(暂不开放) 资源格式要求: 图片:png/ jpg,视频:mp4,语音:silk + * + * 参考 [UploadGroupFilesApi]。 + * + * @see QGGroup.uploadMedia + */ + @ST + public suspend fun uploadGroupMedia( + target: ID, + url: String, + type: Int, + ): QGMedia + + /** + * 上传一个资源为用于向QQ单聊发送的 [QGMedia], 可用于后续的发送。 + * + * 目前上传仅支持使用链接,QQ平台会对此链接进行转存。 + * + * @param target 目标用户的ID + * @param url 目标链接 + * @param type 媒体类型。 + * + * > 1 图片,2 视频,3 语音,4 文件(暂不开放) 资源格式要求: 图片:png/ jpg,视频:mp4,语音:silk + * + * 参考 [UploadUserFilesApi]。 + * + * @see QGFriend.uploadMedia + */ + @ST + public suspend fun uploadUserMedia( + target: ID, + url: String, + type: Int, + ): QGMedia } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGC2CManagementEvents.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGC2CManagementEvents.kt new file mode 100644 index 00000000..a648d98c --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGC2CManagementEvents.kt @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.event + +import love.forte.simbot.common.id.ID +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.common.time.Timestamp +import love.forte.simbot.component.qguild.ExperimentalQGApi +import love.forte.simbot.component.qguild.friend.QGFriend +import love.forte.simbot.component.qguild.utils.toTimestamp +import love.forte.simbot.event.ContactEvent +import love.forte.simbot.qguild.event.C2CManagementData +import love.forte.simbot.suspendrunner.STP + +/** + * 用户模块-用户管理相关事件 + * + * @see C2CManagementData + * @author ForteScarlet + */ +public abstract class QGC2CManagementEvent : QGBotEvent(), ContactEvent { + abstract override val id: ID + + @OptIn(ExperimentalQGApi::class) + override val time: Timestamp + get() = sourceEventEntity.timestamp.toTimestamp() + + /** + * 事件相关的C2C单聊用户目标 + */ + @STP + abstract override suspend fun content(): QGFriend + + protected fun C2CManagementData.computeId(): ID = buildString( + openid.length + timestamp.length + 1 + ) { + append(openid) + append('-') + append(timestamp) + }.ID +} + + +/** + * 用户添加机器人 + * + * @author ForteScarlet + */ +public abstract class QGFriendAddEvent : QGC2CManagementEvent() + +/** + * 用户删除机器人 + * + * @author ForteScarlet + */ +public abstract class QGFriendDelEvent : QGC2CManagementEvent() + +/** + * 拒绝机器人主动消息 + * + * @author ForteScarlet + */ +public abstract class QGC2CMsgRejectEvent : QGC2CManagementEvent() + +/** + * 允许机器人主动消息 + * + * @author ForteScarlet + */ +public abstract class QGC2CMsgReceiveEvent : QGC2CManagementEvent() diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGC2CMessageCreateEvent.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGC2CMessageCreateEvent.kt new file mode 100644 index 00000000..9adef4a4 --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGC2CMessageCreateEvent.kt @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.event + +import love.forte.simbot.common.id.ID +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.common.time.Timestamp +import love.forte.simbot.component.qguild.ExperimentalQGApi +import love.forte.simbot.component.qguild.bot.QGBot +import love.forte.simbot.component.qguild.friend.QGFriend +import love.forte.simbot.component.qguild.message.QGGroupAndC2CMessageContent +import love.forte.simbot.component.qguild.message.QGMessageReceipt +import love.forte.simbot.component.qguild.utils.toTimestamp +import love.forte.simbot.event.ContactMessageEvent +import love.forte.simbot.message.Message +import love.forte.simbot.message.MessageContent +import love.forte.simbot.qguild.event.C2CMessageCreate +import love.forte.simbot.suspendrunner.ST +import love.forte.simbot.suspendrunner.STP + + +/** + * 一个C2C单聊消息事件。 + * + * @see C2CMessageCreate + * + * @author ForteScarlet + */ +public abstract class QGC2CMessageCreateEvent : QGBotEvent(), ContactMessageEvent { + abstract override val bot: QGBot + + override val id: ID + get() = sourceEventEntity.data.id.ID + + @OptIn(ExperimentalQGApi::class) + override val time: Timestamp + get() = sourceEventEntity.data.timestamp.toTimestamp() + + override val authorId: ID + get() = sourceEventEntity.data.author.userOpenid.ID + + abstract override val messageContent: QGGroupAndC2CMessageContent + + /** + * 消息事件来源的 [QGFriend] + */ + @STP + abstract override suspend fun content(): QGFriend + + /** + * 向此用户目标回复消息。 + */ + @ST + abstract override suspend fun reply(text: String): QGMessageReceipt + + /** + * 向此用户目标回复消息。 + */ + @ST + abstract override suspend fun reply(message: Message): QGMessageReceipt + + /** + * 向此用户目标回复消息。 + */ + @ST + abstract override suspend fun reply(messageContent: MessageContent): QGMessageReceipt +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGGroupAtMessageCreateEvent.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGGroupAtMessageCreateEvent.kt new file mode 100644 index 00000000..6390993f --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGGroupAtMessageCreateEvent.kt @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.event + +import love.forte.simbot.common.id.ID +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.common.time.Timestamp +import love.forte.simbot.component.qguild.ExperimentalQGApi +import love.forte.simbot.component.qguild.bot.QGBot +import love.forte.simbot.component.qguild.group.QGGroup +import love.forte.simbot.component.qguild.group.QGGroupMember +import love.forte.simbot.component.qguild.message.QGGroupAndC2CMessageContent +import love.forte.simbot.component.qguild.utils.toTimestamp +import love.forte.simbot.event.ChatGroupMessageEvent +import love.forte.simbot.message.Message +import love.forte.simbot.message.MessageContent +import love.forte.simbot.message.MessageReceipt +import love.forte.simbot.qguild.event.GroupAtMessageCreate +import love.forte.simbot.suspendrunner.ST +import love.forte.simbot.suspendrunner.STP + + +/** + * 群消息事件。需要bot被at后触发。 + * + * @see GroupAtMessageCreate + * + * @author ForteScarlet + */ +public abstract class QGGroupAtMessageCreateEvent : QGBotEvent(), ChatGroupMessageEvent { + abstract override val bot: QGBot + + /** + * 事件ID + */ + override val id: ID + get() = sourceEventEntity.data.id.ID + + /** + * 事件时间 + */ + @OptIn(ExperimentalQGApi::class) + override val time: Timestamp + get() = sourceEventEntity.data.timestamp.toTimestamp() + + /** + * 消息发送者的ID + */ + override val authorId: ID + get() = sourceEventEntity.data.author.memberOpenid.ID + + abstract override val messageContent: QGGroupAndC2CMessageContent + + @STP + abstract override suspend fun author(): QGGroupMember + + /** + * 此消息事件所处的QQ群。 + * 使用此事件内的 [content.send][QGGroup.send] 发送消息时, + * 会自动附加回复用的 `msgId`, 不消耗主动消息次数, + * 但是可能会被自动添加 `@目标` 效果(这是QQ平台决定的)。 + */ + @STP + abstract override suspend fun content(): QGGroup + + /** + * 基于当前消息源回复此消息。 + * 会尝试添加引用回复效果。 + */ + @ST + abstract override suspend fun reply(text: String): MessageReceipt + + /** + * 基于当前消息源回复此消息。 + * 会尝试添加引用回复效果。 + */ + @ST + abstract override suspend fun reply(message: Message): MessageReceipt + + /** + * 基于当前消息源回复此消息。 + * 会尝试添加引用回复效果。 + */ + @ST + abstract override suspend fun reply(messageContent: MessageContent): MessageReceipt +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGGroupManagementEvents.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGGroupManagementEvents.kt new file mode 100644 index 00000000..e9ba0765 --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/event/QGGroupManagementEvents.kt @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.event + +import love.forte.simbot.common.id.ID +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.common.time.Timestamp +import love.forte.simbot.component.qguild.ExperimentalQGApi +import love.forte.simbot.component.qguild.group.QGGroup +import love.forte.simbot.component.qguild.group.QGGroupMember +import love.forte.simbot.component.qguild.utils.toTimestamp +import love.forte.simbot.event.ChatGroupEvent +import love.forte.simbot.qguild.event.GroupRobotManagementData +import love.forte.simbot.suspendrunner.STP + +/** + * 群聊模块中的管理相关事件。 + * + * @see GroupRobotManagementData + */ +public abstract class QGGroupManagementEvent : + QGBotEvent(), + ChatGroupEvent { + abstract override val id: ID + + @OptIn(ExperimentalQGApi::class) + override val time: Timestamp + get() = sourceEventEntity.timestamp.toTimestamp() + + /** + * 事件相关的群 + */ + @STP + abstract override suspend fun content(): QGGroup + + /** + * 事件行为的操作者 + */ + @STP + public abstract suspend fun operator(): QGGroupMember + + protected fun GroupRobotManagementData.computeId(): ID = buildString( + groupOpenid.length + + opMemberOpenid.length + + timestamp.length + + 2 + ) { + append(groupOpenid) + append('-') + append(opMemberOpenid) + append('-') + append(timestamp) + }.ID +} + +/** + * 机器人加入群聊 + * @author ForteScarlet + */ +public abstract class QGGroupAddRobotEvent : QGGroupManagementEvent() + +/** + * 机器人退出群聊 + * @author ForteScarlet + */ +public abstract class QGGroupDelRobotEvent : QGGroupManagementEvent() + +/** + * 群聊拒绝机器人主动消息 + * @author ForteScarlet + */ +public abstract class QGGroupMsgRejectEvent : QGGroupManagementEvent() + +/** + * 群聊接受机器人主动消息 + * @author ForteScarlet + */ +public abstract class QGGroupMsgReceiveEvent : QGGroupManagementEvent() diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/friend/QGFriend.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/friend/QGFriend.kt new file mode 100644 index 00000000..07944f4d --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/friend/QGFriend.kt @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.friend + +import love.forte.simbot.common.id.ID +import love.forte.simbot.component.qguild.bot.QGBot +import love.forte.simbot.component.qguild.message.QGMedia +import love.forte.simbot.definition.Contact +import love.forte.simbot.suspendrunner.ST +import kotlin.coroutines.CoroutineContext + + +/** + * 一个QQ的C2C单聊用户目标。 + * 比较类似QQ好友的概念,但实际上并不太一样, + * [QGFriend] 通常来自消息事件,且只能得知其 openid 信息。 + * + * @author ForteScarlet + */ +public interface QGFriend : Contact { + override val coroutineContext: CoroutineContext + override val id: ID + + /** + * QQ单聊场景下无法获取用户名,始终得到空字符串。 + */ + override val name: String + get() = "" + + /** + * QQ单聊场景下无法获取用户头像,始终得到 `null`。 + */ + override val avatar: String? + get() = null + + /** + * 上传一个资源为用于向QQ单聊发送的 [QGMedia], 可用于后续的发送。 + * + * 目前上传仅支持使用链接,QQ平台会对此链接进行转存。 + * + * @param url 目标链接 + * @param type 媒体类型。 + * + * > 1 图片,2 视频,3 语音,4 文件(暂不开放) 资源格式要求: 图片:png/ jpg,视频:mp4,语音:silk + * + * @see QGBot.uploadUserMedia + */ + @ST + public suspend fun uploadMedia( + url: String, + type: Int, + ): QGMedia +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/group/QGGroup.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/group/QGGroup.kt new file mode 100644 index 00000000..1c56d084 --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/group/QGGroup.kt @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.group + +import love.forte.simbot.common.collectable.Collectable +import love.forte.simbot.common.collectable.asCollectable +import love.forte.simbot.common.collectable.emptyCollectable +import love.forte.simbot.common.id.ID +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.component.qguild.bot.QGBot +import love.forte.simbot.component.qguild.message.QGMedia +import love.forte.simbot.definition.ChatGroup +import love.forte.simbot.definition.Role +import love.forte.simbot.suspendrunner.ST +import love.forte.simbot.suspendrunner.STP + + +/** + * 一个群at消息事件中的群信息对象。 + * + * @author ForteScarlet + */ +public interface QGGroup : ChatGroup { + /** + * 这个群的openid。 + */ + override val id: ID + + @STP + override suspend fun botAsMember(): QGGroupMember + + /** + * 群消息事件中,只存在群的openid,无法得知群名称, + * 将始终得到空字符串。 + */ + override val name: String + get() = "" + + /** + * 无法查询群成员列表,将始终得到空结果。 + */ + override val members: Collectable + get() = emptyCollectable() + + /** + * 无法查询群成员,将始终得到 `null`。 + */ + @ST(blockingBaseName = "getMember", blockingSuffix = "", asyncBaseName = "getMember", reserveBaseName = "getMember") + override suspend fun member(id: ID): QGGroupMember? = null + + /** + * 无法得知群主ID,始终得到 `null` + */ + override val ownerId: ID? + get() = null + + /** + * 得到 [QGGroupRole] 的元素集。 + */ + override val roles: Collectable + get() = QGGroupRole.entries.asCollectable() + + /** + * 上传一个资源为用于向QQ群发送的 [QGMedia], 可用于后续的发送。 + * + * 目前上传仅支持使用链接,QQ平台会对此链接进行转存。 + * + * @param url 目标链接 + * @param type 媒体类型。 + * + * > 1 图片,2 视频,3 语音,4 文件(暂不开放) 资源格式要求: 图片:png/ jpg,视频:mp4,语音:silk + * + * @see QGBot.uploadGroupMedia + */ + @ST + public suspend fun uploadMedia( + url: String, + type: Int, + ): QGMedia +} + +/** + * 一个QQ群的角色,老生常谈的那三个。 + */ +public enum class QGGroupRole(override val isAdmin: Boolean) : Role { + OWNER(true), + ADMIN(true), + MEMBER(false); + + override val id: ID + get() = name.ID +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/group/QGGroupMember.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/group/QGGroupMember.kt new file mode 100644 index 00000000..1db1995a --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/group/QGGroupMember.kt @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.group + +import love.forte.simbot.common.id.ID +import love.forte.simbot.definition.Member +import love.forte.simbot.message.Message +import love.forte.simbot.message.MessageContent +import love.forte.simbot.message.MessageReceipt +import kotlin.jvm.JvmSynthetic + +/** + * 一个通过群消息事件得到的群成员信息。 + * 只能得到它的 openid。 + */ +public interface QGGroupMember : Member { + /** + * 此成员的openid + */ + override val id: ID + + /** + * 无法得知对方的用户名,始终得到空字符串。 + */ + override val name: String + get() = "" + + /** + * 无法得知昵称,始终得到 `null`。 + */ + override val nick: String? + get() = null + + /** + * 无法得知头像,始终得到 `null`。 + */ + override val avatar: String? + get() = null + + /** + * 不支持主动向群成员发送消息,将会抛出 [UnsupportedOperationException] + * + * @throws UnsupportedOperationException + */ + @JvmSynthetic + override suspend fun send(message: Message): MessageReceipt { + sendToMemberIsUnsupported(id) + } + + /** + * 不支持主动向群成员发送消息,将会抛出 [UnsupportedOperationException] + * + * @throws UnsupportedOperationException + */ + @JvmSynthetic + override suspend fun send(messageContent: MessageContent): MessageReceipt { + sendToMemberIsUnsupported(id) + } + + /** + * 不支持主动向群成员发送消息,将会抛出 [UnsupportedOperationException] + * + * @throws UnsupportedOperationException + */ + @JvmSynthetic + override suspend fun send(text: String): MessageReceipt { + sendToMemberIsUnsupported(id) + } +} + +private fun sendToMemberIsUnsupported(id: ID): Nothing = + throw UnsupportedOperationException("Send message to QGGroupMember(id=$id)") diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/group/QGGroupRelation.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/group/QGGroupRelation.kt new file mode 100644 index 00000000..f16178b3 --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/group/QGGroupRelation.kt @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.group + +import love.forte.simbot.bot.GroupRelation +import love.forte.simbot.common.collectable.Collectable +import love.forte.simbot.common.collectable.emptyCollectable +import love.forte.simbot.common.id.ID +import love.forte.simbot.suspendrunner.ST +import kotlin.jvm.JvmSynthetic + + +/** + * QQ组件中与QQ群相关的操作。 + * QQ群实际上没有开放任何相关能力的API,因此: + * - 列表获取将永远得到空结果。 + * - ID查询将是一种“伪”操作,会直接将提供的 `id` 包装为一个 [QGGroup] 返回。 + * 如果此ID不是真实存在的,则进行某些操作时(比如主动发送消息)将会抛出异常。 + * + * @author ForteScarlet + */ +public interface QGGroupRelation : GroupRelation { + + /** + * 无法获取列表,将始终得到空结果。 + */ + override val groups: Collectable + get() = emptyCollectable() + + /** + * 使用 [id] 直接包装为一个伪 [QGGroup], + * **不会**校验其真实性。 + * 如果此ID对应的群不是真实存在的, + * 则进行某些操作时(比如主动发送消息)将会抛出异常。 + */ + @ST( + blockingBaseName = "getGroup", + blockingSuffix = "", + asyncBaseName = "getGroup", + reserveBaseName = "getGroup" + ) + override suspend fun group(id: ID): QGGroup? + + /** + * 无法得知已加入的群的总数,始终得到 `-1`。 + */ + @JvmSynthetic + override suspend fun groupCount(): Int = -1 +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/bot/QGBotImpl.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/bot/QGBotImpl.kt index e6ab6ac7..af67d3de 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/bot/QGBotImpl.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/bot/QGBotImpl.kt @@ -33,10 +33,13 @@ import love.forte.simbot.component.qguild.QQGuildComponent import love.forte.simbot.component.qguild.bot.QGBot import love.forte.simbot.component.qguild.bot.config.QGBotComponentConfiguration import love.forte.simbot.component.qguild.channel.* +import love.forte.simbot.component.qguild.group.QGGroup +import love.forte.simbot.component.qguild.group.QGGroupRelation import love.forte.simbot.component.qguild.guild.QGGuild import love.forte.simbot.component.qguild.guild.QGGuildRelation import love.forte.simbot.component.qguild.internal.channel.* import love.forte.simbot.component.qguild.internal.event.QGBotStartedEventImpl +import love.forte.simbot.component.qguild.internal.group.idGroup import love.forte.simbot.component.qguild.internal.guild.QGGuildImpl import love.forte.simbot.component.qguild.internal.guild.QGGuildImpl.Companion.qgGuild import love.forte.simbot.component.qguild.internal.guild.QGMemberImpl @@ -44,6 +47,7 @@ import love.forte.simbot.component.qguild.internal.role.QGGuildRoleImpl import love.forte.simbot.component.qguild.internal.role.QGMemberRoleImpl import love.forte.simbot.component.qguild.internal.role.toGuildRole import love.forte.simbot.component.qguild.internal.role.toMemberRole +import love.forte.simbot.component.qguild.message.QGMedia import love.forte.simbot.component.qguild.message.QGMessageReceipt import love.forte.simbot.component.qguild.message.sendMessage import love.forte.simbot.event.EventDispatcher @@ -55,6 +59,8 @@ import love.forte.simbot.qguild.QQGuildApiException import love.forte.simbot.qguild.addStackTrace import love.forte.simbot.qguild.api.channel.GetChannelApi import love.forte.simbot.qguild.api.channel.GetGuildChannelListApi +import love.forte.simbot.qguild.api.files.UploadGroupFilesApi +import love.forte.simbot.qguild.api.files.UploadUserFilesApi import love.forte.simbot.qguild.api.guild.GetGuildApi import love.forte.simbot.qguild.api.member.GetMemberApi import love.forte.simbot.qguild.api.role.GetGuildRoleListApi @@ -130,6 +136,13 @@ internal class QGBotImpl( return ::botSelf.isInitialized && botSelf.id == id.literal } + override val groupRelation: QGGroupRelation = GroupRelationImpl() + + private inner class GroupRelationImpl : QGGroupRelation { + override suspend fun group(id: ID): QGGroup = + idGroup(this@QGBotImpl, id) + } + override val guildRelation: QGGuildRelation = GuildRelationImpl() private inner class GuildRelationImpl : QGGuildRelation { @@ -396,6 +409,25 @@ internal class QGBotImpl( } } + override suspend fun uploadGroupMedia(target: ID, url: String, type: Int): QGMedia { + val media = UploadGroupFilesApi.create( + openid = target.literal, + fileType = type, + url = url + ).requestDataBy(source) + + return QGMedia(media) + } + + override suspend fun uploadUserMedia(target: ID, url: String, type: Int): QGMedia { + val media = UploadUserFilesApi.create( + openid = target.literal, + fileType = type, + url = url + ).requestDataBy(source) + + return QGMedia(media) + } private val isTransmitCacheable = cacheable && cacheConfig?.transmitCacheConfig?.enable == true diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/bot/QGEventProcess.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/bot/QGEventProcess.kt index a2ba71a4..bd69dc17 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/bot/QGEventProcess.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/bot/QGEventProcess.kt @@ -17,6 +17,7 @@ package love.forte.simbot.component.qguild.internal.bot +import kotlinx.coroutines.Job import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import love.forte.simbot.common.id.StringID.Companion.ID @@ -143,9 +144,45 @@ internal fun QGBotImpl.registerEventProcessor(): DisposableHandle { // 消息 + /// 频道 is AtMessageCreate -> { pushEvent { QGAtMessageCreateEventImpl(bot, raw, event.data) } } + /// 群&单聊 + is GroupAtMessageCreate -> { + pushEvent { QGGroupAtMessageCreateEventImpl(bot, raw, event) } + } + + is C2CMessageCreate -> { + pushEvent { QGC2CMessageCreateEventImpl(bot, raw, event) } + } + + // 群聊:managements + is GroupAddRobot -> { + pushEvent { QGGroupAddRobotEventImpl(event.id, bot, raw, event.data) } + } + is GroupDelRobot -> { + pushEvent { QGGroupDelRobotEventImpl(event.id, bot, raw, event.data) } + } + is GroupMsgReject -> { + pushEvent { QGGroupMsgRejectEventImpl(event.id, bot, raw, event.data) } + } + is GroupMsgReceive -> { + pushEvent { QGGroupMsgReceiveEventImpl(event.id, bot, raw, event.data) } + } + // C2C: managements + is FriendAdd -> { + pushEvent { QGFriendAddEventImpl(event.id, bot, raw, event.data) } + } + is FriendDel -> { + pushEvent { QGFriendDelEventImpl(event.id, bot, raw, event.data) } + } + is C2CMsgReject -> { + pushEvent { QGC2CMsgRejectEventImpl(event.id, bot, raw, event.data) } + } + is C2CMsgReceive -> { + pushEvent { QGC2CMsgReceiveEventImpl(event.id, bot, raw, event.data) } + } // OpenForum is OpenForumDispatch -> when (event) { @@ -182,11 +219,14 @@ internal fun QGBotImpl.registerEventProcessor(): DisposableHandle { } -private inline fun QGBotImpl.pushEvent(crossinline block: () -> Event) { - launch { +private inline fun QGBotImpl.pushEvent(crossinline block: () -> Event): Job { + return launch { val event = block() - eventDispatcher.push(event) - .onEachError { e -> logger.error("Event {} process failed: {}", event, e, e.content) } + eventDispatcher + .push(event) + .onEachError { e -> + logger.error("Event {} process failed: {}", event, e, e.content) + } .collect() } } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGC2CManagementEventImpls.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGC2CManagementEventImpls.kt new file mode 100644 index 00000000..56fc20a6 --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGC2CManagementEventImpls.kt @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.internal.event + +import love.forte.simbot.common.id.ID +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.component.qguild.event.QGC2CMsgReceiveEvent +import love.forte.simbot.component.qguild.event.QGC2CMsgRejectEvent +import love.forte.simbot.component.qguild.event.QGFriendAddEvent +import love.forte.simbot.component.qguild.event.QGFriendDelEvent +import love.forte.simbot.component.qguild.friend.QGFriend +import love.forte.simbot.component.qguild.internal.bot.QGBotImpl +import love.forte.simbot.component.qguild.internal.friend.idFriend +import love.forte.simbot.qguild.event.C2CManagementData + + +internal class QGFriendAddEventImpl( + private val _id: String?, + override val bot: QGBotImpl, + override val sourceEventRaw: String, + override val sourceEventEntity: C2CManagementData, +) : QGFriendAddEvent() { + override val id: ID + get() = _id?.ID ?: sourceEventEntity.computeId() + + override suspend fun content(): QGFriend { + return idFriend( + bot = bot, + id = sourceEventEntity.openid.ID, + eventId = _id, + seq = null, + ) + } +} + +internal class QGFriendDelEventImpl( + private val _id: String?, + override val bot: QGBotImpl, + override val sourceEventRaw: String, + override val sourceEventEntity: C2CManagementData, +) : QGFriendDelEvent() { + override val id: ID + get() = _id?.ID ?: sourceEventEntity.computeId() + + override suspend fun content(): QGFriend { + return idFriend( + bot = bot, + id = sourceEventEntity.openid.ID, + eventId = null, + seq = null, + ) + } +} + +internal class QGC2CMsgRejectEventImpl( + private val _id: String?, + override val bot: QGBotImpl, + override val sourceEventRaw: String, + override val sourceEventEntity: C2CManagementData, +) : QGC2CMsgRejectEvent() { + override val id: ID + get() = _id?.ID ?: sourceEventEntity.computeId() + + override suspend fun content(): QGFriend { + return idFriend( + bot = bot, + id = sourceEventEntity.openid.ID, + eventId = null, + seq = null, + ) + } +} + +internal class QGC2CMsgReceiveEventImpl( + private val _id: String?, + override val bot: QGBotImpl, + override val sourceEventRaw: String, + override val sourceEventEntity: C2CManagementData, +) : QGC2CMsgReceiveEvent() { + override val id: ID + get() = _id?.ID ?: sourceEventEntity.computeId() + + override suspend fun content(): QGFriend { + return idFriend( + bot = bot, + id = sourceEventEntity.openid.ID, + eventId = null, + seq = null, + ) + } +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGC2CMessageCreateEventImpl.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGC2CMessageCreateEventImpl.kt new file mode 100644 index 00000000..25ea5719 --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGC2CMessageCreateEventImpl.kt @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.internal.event + +import love.forte.simbot.common.atomic.AtomicInt +import love.forte.simbot.common.atomic.atomic +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.component.qguild.event.QGC2CMessageCreateEvent +import love.forte.simbot.component.qguild.friend.QGFriend +import love.forte.simbot.component.qguild.internal.bot.QGBotImpl +import love.forte.simbot.component.qguild.internal.friend.toFriend +import love.forte.simbot.component.qguild.internal.message.QGGroupAndC2CMessageContentImpl +import love.forte.simbot.component.qguild.message.QGGroupAndC2CMessageContent +import love.forte.simbot.component.qguild.message.QGMessageReceipt +import love.forte.simbot.component.qguild.message.sendUserMessage +import love.forte.simbot.message.Message +import love.forte.simbot.message.MessageContent +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody +import love.forte.simbot.qguild.api.message.group.GroupMessageSendApi +import love.forte.simbot.qguild.event.C2CMessageCreate + + +/** + * + * @author ForteScarlet + */ +internal class QGC2CMessageCreateEventImpl( + override val bot: QGBotImpl, + override val sourceEventRaw: String, + override val sourceEventEntity: C2CMessageCreate, + private val msgSeq: AtomicInt = atomic(1) +) : QGC2CMessageCreateEvent() { + override val messageContent: QGGroupAndC2CMessageContent = + QGGroupAndC2CMessageContentImpl( + sourceEventEntity.data.id.ID, + sourceEventEntity.data.content, + sourceEventEntity.data.attachments + ) + + override suspend fun content(): QGFriend { + return sourceEventEntity.data.toFriend( + bot = bot, + seq = msgSeq + ) + } + + private fun GroupAndC2CSendBody.initMsgIdAndSeq() { + if (msgId == null) { + msgId = sourceEventEntity.data.id + } + if (msgSeq == null) { + msgSeq = this@QGC2CMessageCreateEventImpl.msgSeq.getAndIncrement() + } + } + + override suspend fun reply(text: String): QGMessageReceipt { + return bot.sendUserMessage( + openid = sourceEventEntity.data.author.userOpenid, + text = text, + msgType = GroupMessageSendApi.MSG_TYPE_TEXT, + ) { + initMsgIdAndSeq() + } + } + + override suspend fun reply(message: Message): QGMessageReceipt { + return bot.sendUserMessage( + openid = sourceEventEntity.data.author.userOpenid, + message = message, + ) { + initMsgIdAndSeq() + } + } + + override suspend fun reply(messageContent: MessageContent): QGMessageReceipt { + return bot.sendUserMessage( + openid = sourceEventEntity.data.author.userOpenid, + messageContent = messageContent, + ) { + initMsgIdAndSeq() + } + } +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGGroupAtMessageCreateEventImpl.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGGroupAtMessageCreateEventImpl.kt new file mode 100644 index 00000000..4b4c51fb --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGGroupAtMessageCreateEventImpl.kt @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.internal.event + +import love.forte.simbot.common.atomic.AtomicInt +import love.forte.simbot.common.atomic.atomic +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.component.qguild.event.QGGroupAtMessageCreateEvent +import love.forte.simbot.component.qguild.group.QGGroup +import love.forte.simbot.component.qguild.group.QGGroupMember +import love.forte.simbot.component.qguild.internal.bot.QGBotImpl +import love.forte.simbot.component.qguild.internal.group.QGGroupMemberImpl +import love.forte.simbot.component.qguild.internal.group.toGroup +import love.forte.simbot.component.qguild.internal.message.QGGroupAndC2CMessageContentImpl +import love.forte.simbot.component.qguild.message.QGGroupAndC2CMessageContent +import love.forte.simbot.component.qguild.message.sendGroupMessage +import love.forte.simbot.message.Message +import love.forte.simbot.message.MessageContent +import love.forte.simbot.message.MessageReceipt +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody +import love.forte.simbot.qguild.api.message.group.GroupMessageSendApi +import love.forte.simbot.qguild.event.GroupAtMessageCreate + + +/** + * + * @author ForteScarlet + */ +internal class QGGroupAtMessageCreateEventImpl( + override val bot: QGBotImpl, + override val sourceEventRaw: String, + override val sourceEventEntity: GroupAtMessageCreate, + private val msgSeq: AtomicInt = atomic(1) +) : QGGroupAtMessageCreateEvent() { + override suspend fun author(): QGGroupMember { + return QGGroupMemberImpl( + bot, + sourceEventEntity.data.author.memberOpenid.ID, + ) + } + + override val messageContent: QGGroupAndC2CMessageContent = QGGroupAndC2CMessageContentImpl( + sourceEventEntity.data.id.ID, + sourceEventEntity.data.content, + sourceEventEntity.data.attachments + ) + + override suspend fun content(): QGGroup = + sourceEventEntity.data.toGroup(bot, msgSeq) + + private fun GroupAndC2CSendBody.initRefAndMsgIdAndSeq() { + if (messageReference == null) { + messageReference = love.forte.simbot.qguild.model.Message.Reference( + sourceEventEntity.data.id, + ) + } + if (msgId == null) { + msgId = sourceEventEntity.data.id + } + if (msgSeq == null) { + msgSeq = this@QGGroupAtMessageCreateEventImpl.msgSeq.getAndIncrement() + } + } + + override suspend fun reply(text: String): MessageReceipt { + return bot.sendGroupMessage( + openid = sourceEventEntity.data.groupOpenid, + text = text, + msgType = GroupMessageSendApi.MSG_TYPE_TEXT, + ) { + initRefAndMsgIdAndSeq() + } + } + + override suspend fun reply(message: Message): MessageReceipt { + return bot.sendGroupMessage( + openid = sourceEventEntity.data.groupOpenid, + message = message, + ) { + // post + initRefAndMsgIdAndSeq() + } + } + + override suspend fun reply(messageContent: MessageContent): MessageReceipt { + return bot.sendGroupMessage( + openid = sourceEventEntity.data.groupOpenid, + messageContent = messageContent, + ) { + // post + initRefAndMsgIdAndSeq() + } + } +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGGroupManagementEventImpls.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGGroupManagementEventImpls.kt new file mode 100644 index 00000000..0ac8d9d0 --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/event/QGGroupManagementEventImpls.kt @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.internal.event + +import love.forte.simbot.common.id.ID +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.component.qguild.event.QGGroupAddRobotEvent +import love.forte.simbot.component.qguild.event.QGGroupDelRobotEvent +import love.forte.simbot.component.qguild.event.QGGroupMsgReceiveEvent +import love.forte.simbot.component.qguild.event.QGGroupMsgRejectEvent +import love.forte.simbot.component.qguild.group.QGGroup +import love.forte.simbot.component.qguild.group.QGGroupMember +import love.forte.simbot.component.qguild.internal.bot.QGBotImpl +import love.forte.simbot.component.qguild.internal.group.QGGroupMemberImpl +import love.forte.simbot.component.qguild.internal.group.idGroup +import love.forte.simbot.qguild.event.GroupRobotManagementData + +internal class QGGroupAddRobotEventImpl( + private val _id: String?, + override val bot: QGBotImpl, + override val sourceEventRaw: String, + override val sourceEventEntity: GroupRobotManagementData, +) : QGGroupAddRobotEvent() { + override val id: ID + get() = _id?.ID ?: sourceEventEntity.computeId() + + override suspend fun content(): QGGroup { + return idGroup( + bot = bot, + id = sourceEventEntity.groupOpenid.ID, + isFake = false + ) + } + + override suspend fun operator(): QGGroupMember { + return QGGroupMemberImpl(bot, sourceEventEntity.opMemberOpenid.ID) + } +} + +internal class QGGroupDelRobotEventImpl( + private val _id: String?, + override val bot: QGBotImpl, + override val sourceEventRaw: String, + override val sourceEventEntity: GroupRobotManagementData, +) : QGGroupDelRobotEvent() { + override val id: ID + get() = _id?.ID ?: sourceEventEntity.computeId() + + override suspend fun content(): QGGroup { + return idGroup( + bot = bot, + id = sourceEventEntity.groupOpenid.ID, + isFake = false + ) + } + + override suspend fun operator(): QGGroupMember { + return QGGroupMemberImpl(bot, sourceEventEntity.opMemberOpenid.ID) + } +} + +internal class QGGroupMsgRejectEventImpl( + private val _id: String?, + override val bot: QGBotImpl, + override val sourceEventRaw: String, + override val sourceEventEntity: GroupRobotManagementData, +) : QGGroupMsgRejectEvent() { + override val id: ID + get() = _id?.ID ?: sourceEventEntity.computeId() + + override suspend fun content(): QGGroup { + return idGroup( + bot = bot, + id = sourceEventEntity.groupOpenid.ID, + isFake = false + ) + } + + override suspend fun operator(): QGGroupMember { + return QGGroupMemberImpl(bot, sourceEventEntity.opMemberOpenid.ID) + } +} + +internal class QGGroupMsgReceiveEventImpl( + private val _id: String?, + override val bot: QGBotImpl, + override val sourceEventRaw: String, + override val sourceEventEntity: GroupRobotManagementData, +) : QGGroupMsgReceiveEvent() { + override val id: ID + get() = _id?.ID ?: sourceEventEntity.computeId() + + override suspend fun content(): QGGroup { + return idGroup( + bot = bot, + id = sourceEventEntity.groupOpenid.ID, + isFake = false + ) + } + + override suspend fun operator(): QGGroupMember { + return QGGroupMemberImpl(bot, sourceEventEntity.opMemberOpenid.ID) + } +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/friend/QGFriendImpl.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/friend/QGFriendImpl.kt new file mode 100644 index 00000000..534527b9 --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/friend/QGFriendImpl.kt @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.internal.friend + +import love.forte.simbot.common.atomic.AtomicInt +import love.forte.simbot.common.id.ID +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.common.id.literal +import love.forte.simbot.component.qguild.friend.QGFriend +import love.forte.simbot.component.qguild.internal.bot.QGBotImpl +import love.forte.simbot.component.qguild.internal.bot.newSupervisorCoroutineContext +import love.forte.simbot.component.qguild.message.QGMedia +import love.forte.simbot.component.qguild.message.sendUserMessage +import love.forte.simbot.message.Message +import love.forte.simbot.message.MessageContent +import love.forte.simbot.message.MessageReceipt +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody +import love.forte.simbot.qguild.event.C2CMessageCreate +import kotlin.coroutines.CoroutineContext + + +/** + * + * @author ForteScarlet + */ +internal class QGFriendImpl( + private val bot: QGBotImpl, + override val id: ID, + private val eventId: String? = null, + private val sourceEvent: C2CMessageCreate.Data? = null, + private val msgSeq: AtomicInt? = null, +) : QGFriend { + override val coroutineContext: CoroutineContext = + bot.newSupervisorCoroutineContext() + + override suspend fun uploadMedia(url: String, type: Int): QGMedia { + return bot.uploadUserMedia(id, url, type) + } + + private fun GroupAndC2CSendBody.initMsgIdAndSeq() { + if (msgId == null) { + if (sourceEvent != null) { + msgId = sourceEvent.id + } else if (eventId == null && this@QGFriendImpl.eventId != null) { + eventId = this@QGFriendImpl.eventId + } + } + + if (msgSeq == null && this@QGFriendImpl.msgSeq != null) { + msgSeq = this@QGFriendImpl.msgSeq.getAndIncrement() + } + } + + override suspend fun send(text: String): MessageReceipt { + return bot.sendUserMessage( + openid = id.literal, + text = text, + msgType = GroupAndC2CSendBody.MSG_TYPE_TEXT, + ) { + initMsgIdAndSeq() + } + } + + override suspend fun send(message: Message): MessageReceipt { + return bot.sendUserMessage( + openid = id.literal, + message = message, + ) { + initMsgIdAndSeq() + } + } + + override suspend fun send(messageContent: MessageContent): MessageReceipt { + return bot.sendUserMessage( + openid = id.literal, + messageContent = messageContent, + ) { + initMsgIdAndSeq() + } + } +} + +internal fun C2CMessageCreate.Data.toFriend( + bot: QGBotImpl, + seq: AtomicInt? = null, +): QGFriendImpl = + QGFriendImpl( + bot = bot, + id = id.ID, + eventId = null, + sourceEvent = this, + msgSeq = seq + ) + +internal fun idFriend( + bot: QGBotImpl, + id: ID, + eventId: String? = null, + seq: AtomicInt? = null, +): QGFriendImpl = + QGFriendImpl( + bot = bot, + id = id, + eventId = eventId, + sourceEvent = null, + msgSeq = seq + ) diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/group/QGBotMemberImpl.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/group/QGBotMemberImpl.kt new file mode 100644 index 00000000..102c06db --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/group/QGBotMemberImpl.kt @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.internal.group + +import love.forte.simbot.common.id.ID +import love.forte.simbot.component.qguild.group.QGGroupMember +import love.forte.simbot.component.qguild.internal.bot.QGBotImpl +import love.forte.simbot.component.qguild.internal.bot.newSupervisorCoroutineContext +import kotlin.coroutines.CoroutineContext + + +/** + * + * @author ForteScarlet + */ +internal class QGBotMemberImpl( + private val bot: QGBotImpl +) : QGGroupMember { + override val coroutineContext: CoroutineContext = + bot.newSupervisorCoroutineContext() + + override val id: ID + get() = bot.id +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/group/QGGroupImpl.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/group/QGGroupImpl.kt new file mode 100644 index 00000000..2e95619a --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/group/QGGroupImpl.kt @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.internal.group + +import love.forte.simbot.common.atomic.AtomicInt +import love.forte.simbot.common.id.ID +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.common.id.literal +import love.forte.simbot.component.qguild.group.QGGroup +import love.forte.simbot.component.qguild.group.QGGroupMember +import love.forte.simbot.component.qguild.internal.bot.QGBotImpl +import love.forte.simbot.component.qguild.internal.bot.newSupervisorCoroutineContext +import love.forte.simbot.component.qguild.message.QGMedia +import love.forte.simbot.component.qguild.message.sendGroupMessage +import love.forte.simbot.message.Message +import love.forte.simbot.message.MessageContent +import love.forte.simbot.message.MessageReceipt +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody +import love.forte.simbot.qguild.api.message.group.GroupMessageSendApi +import love.forte.simbot.qguild.event.GroupAtMessageCreate +import kotlin.coroutines.CoroutineContext + + +/** + * + * @author ForteScarlet + */ +internal class QGGroupImpl( + private val bot: QGBotImpl, + override val id: ID, + private val sourceEvent: GroupAtMessageCreate.Data?, + private val msgSeq: AtomicInt?, + private val isFake: Boolean, +) : QGGroup { + override val coroutineContext: CoroutineContext = bot.newSupervisorCoroutineContext() + + override suspend fun botAsMember(): QGGroupMember = + QGBotMemberImpl(bot) + + private fun GroupAndC2CSendBody.initMsgIdAndSeq() { + if (msgId == null && sourceEvent != null) { + msgId = sourceEvent.id + } + if (msgSeq == null && this@QGGroupImpl.msgSeq != null) { + msgSeq = this@QGGroupImpl.msgSeq.getAndIncrement() + } + } + + override suspend fun send(text: String): MessageReceipt { + return bot.sendGroupMessage(id.literal, text, GroupMessageSendApi.MSG_TYPE_TEXT) { + initMsgIdAndSeq() + } + } + + override suspend fun send(message: Message): MessageReceipt { + return bot.sendGroupMessage( + id.literal, + message = message, + ) { + initMsgIdAndSeq() + } + } + + override suspend fun send(messageContent: MessageContent): MessageReceipt { + return bot.sendGroupMessage( + id.literal, + messageContent = messageContent, + ) { + initMsgIdAndSeq() + } + } + + override suspend fun uploadMedia(url: String, type: Int): QGMedia { + return bot.uploadGroupMedia(id, url, type) + } + + override fun toString(): String { + return "QGGroup(id=$id, isFake=$isFake)" + } +} + +internal fun GroupAtMessageCreate.Data.toGroup(bot: QGBotImpl, msgSeq: AtomicInt? = null): QGGroupImpl = + QGGroupImpl(bot, groupOpenid.ID, this, msgSeq, false) + +internal fun idGroup(bot: QGBotImpl, id: ID, msgSeq: AtomicInt? = null, isFake: Boolean = true): QGGroupImpl = + QGGroupImpl(bot, id, null, msgSeq, isFake) diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/group/QGGroupMemberImpl.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/group/QGGroupMemberImpl.kt new file mode 100644 index 00000000..af82392f --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/group/QGGroupMemberImpl.kt @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.internal.group + +import love.forte.simbot.common.id.ID +import love.forte.simbot.component.qguild.group.QGGroupMember +import love.forte.simbot.component.qguild.internal.bot.QGBotImpl +import love.forte.simbot.component.qguild.internal.bot.newSupervisorCoroutineContext +import kotlin.coroutines.CoroutineContext + + +/** + * + * @author ForteScarlet + */ +internal class QGGroupMemberImpl( + bot: QGBotImpl, + override val id: ID, +) : QGGroupMember { + override val coroutineContext: CoroutineContext = bot.newSupervisorCoroutineContext() +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/message/QGSingleMessageReceiptImpl.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/message/QGMessageReceiptImpl.kt similarity index 57% rename from simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/message/QGSingleMessageReceiptImpl.kt rename to simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/message/QGMessageReceiptImpl.kt index d77b0360..70054656 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/message/QGSingleMessageReceiptImpl.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/message/QGMessageReceiptImpl.kt @@ -19,8 +19,12 @@ package love.forte.simbot.component.qguild.internal.message import love.forte.simbot.common.id.ID import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.component.qguild.message.QGAggregatedIdMessageReceipt import love.forte.simbot.component.qguild.message.QGAggregatedMessageReceipt +import love.forte.simbot.component.qguild.message.QGSingleIdMessageReceipt import love.forte.simbot.component.qguild.message.QGSingleMessageReceipt +import love.forte.simbot.qguild.api.message.group.GroupMessageSendResult +import love.forte.simbot.qguild.api.message.user.UserMessageSendResult import love.forte.simbot.qguild.model.Message @@ -43,3 +47,31 @@ private class QGAggregatedMessageReceiptImpl(private val messages: List.asReceipt(): QGAggregatedMessageReceipt = QGAggregatedMessageReceiptImpl(this.map { QGSingleMessageReceiptImpl(it) }) + +private class QGSingleIdMessageReceiptImpl(override val id: ID) : QGSingleIdMessageReceipt() + +private class QGAggregatedIdMessageReceiptImpl(private val messages: List) : + QGAggregatedIdMessageReceipt() { + override val size: Int get() = messages.size + override fun get(index: Int): QGSingleIdMessageReceipt = messages[index] + override fun iterator(): Iterator = messages.iterator() +} + +@PublishedApi +internal fun GroupMessageSendResult.asReceipt(): QGSingleIdMessageReceipt = QGSingleIdMessageReceiptImpl(id.ID) + +@PublishedApi +internal fun Iterable.asGroupReceipt(): QGAggregatedIdMessageReceipt = + QGAggregatedIdMessageReceiptImpl( + map { QGSingleIdMessageReceiptImpl(it.id.ID) } + ) + +@PublishedApi +internal fun UserMessageSendResult.asReceipt(): QGSingleIdMessageReceipt = QGSingleIdMessageReceiptImpl(id.ID) + + +@PublishedApi +internal fun Iterable.asUserReceipt(): QGAggregatedIdMessageReceipt = + QGAggregatedIdMessageReceiptImpl( + map { QGSingleIdMessageReceiptImpl(it.id.ID) } + ) diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/message/QGReceiveMessageContentImpl.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/message/QGReceiveMessageContentImpl.kt index 42129160..e44808c5 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/message/QGReceiveMessageContentImpl.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/internal/message/QGReceiveMessageContentImpl.kt @@ -20,6 +20,7 @@ package love.forte.simbot.component.qguild.internal.message import love.forte.simbot.common.id.ID import love.forte.simbot.common.id.StringID.Companion.ID import love.forte.simbot.component.qguild.message.MessageParsers +import love.forte.simbot.component.qguild.message.QGGroupAndC2CMessageContent import love.forte.simbot.component.qguild.message.QGMessageContent import love.forte.simbot.message.Messages import love.forte.simbot.qguild.model.Message @@ -40,6 +41,9 @@ internal class QGMessageContentImpl(override val sourceMessage: Message) : QGMes parseContext.plainTextBuilder.toString() } + override val sourceContent: String + get() = sourceMessage.content + override fun toString(): String { return "QGReceiveMessageContentImpl(messageId=${sourceMessage.id}, sourceMessage=$sourceMessage)" } @@ -54,3 +58,21 @@ internal class QGMessageContentImpl(override val sourceMessage: Message) : QGMes override fun hashCode(): Int = sourceMessage.id.hashCode() } +internal class QGGroupAndC2CMessageContentImpl( + override val id: ID, + override val sourceContent: String, + override val attachments: List, +) : QGGroupAndC2CMessageContent() { + private val parseContext by lazy(LazyThreadSafetyMode.PUBLICATION) { MessageParsers.parse(sourceContent, attachments) } + + override val messages: Messages + get() = parseContext.messages + + override val plainText: String by lazy(LazyThreadSafetyMode.PUBLICATION) { + parseContext.plainTextBuilder.toString() + } + + override fun toString(): String { + return "QGGroupAndC2CMessageContentImpl(id=$id, sourceContent=$sourceContent)" + } +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.kt index e067e11f..79205e88 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.kt @@ -18,7 +18,9 @@ package love.forte.simbot.component.qguild.message import io.ktor.utils.io.core.* +import love.forte.simbot.logger.LoggerFactory import love.forte.simbot.message.* +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody import love.forte.simbot.resource.ByteArrayResource @@ -27,6 +29,8 @@ import love.forte.simbot.resource.ByteArrayResource * @author ForteScarlet */ public object ImageParser : SendingMessageParser { + internal val logger = LoggerFactory.getLogger("love.forte.simbot.component.qguild.message.ImageParser") + override suspend fun invoke( index: Int, element: Message.Element, @@ -35,6 +39,25 @@ public object ImageParser : SendingMessageParser { ) { // TODO attachment? + when (element) { + is Image -> { + if (element is OfflineImage) { + processOfflineImage(index, element, messages, builderContext) + } + } + + // TODO more image type support for file_image + } + } + + override suspend fun invoke( + index: Int, + element: Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext + ) { + // TODO attachment? + when (element) { is Image -> { if (element is OfflineImage) { @@ -78,3 +101,30 @@ internal expect fun processOfflineImage0( messages: Messages?, builderContext: SendingMessageParser.BuilderContext ): Boolean + +internal suspend fun processOfflineImage( + index: Int, + element: OfflineImage, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext +) { + // TODO 目前只支持使用 URL 由平台转存。 + processOfflineImage0(index, element, messages, builderContext) +} + +/** + * MEDIA 可以和文字类型相融合, + * 因此也接受文字类型,事后将其类型直接修改为 MEDIA + */ +internal fun isTextOrMedia(type: Int) = when (type) { + GroupAndC2CSendBody.MSG_TYPE_TEXT, + GroupAndC2CSendBody.MSG_TYPE_MEDIA -> true + else -> false +} + +internal expect suspend fun processOfflineImage0( + index: Int, + element: OfflineImage, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext +): Boolean diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/MessageSender.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/MessageSender.kt index 94597919..169fc01e 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/MessageSender.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/MessageSender.kt @@ -17,15 +17,21 @@ package love.forte.simbot.component.qguild.message +import love.forte.simbot.component.qguild.ExperimentalQGApi import love.forte.simbot.component.qguild.bot.QGBot +import love.forte.simbot.component.qguild.internal.message.asGroupReceipt import love.forte.simbot.component.qguild.internal.message.asReceipt +import love.forte.simbot.component.qguild.internal.message.asUserReceipt import love.forte.simbot.message.Message import love.forte.simbot.message.MessageContent import love.forte.simbot.qguild.QGInternalApi import love.forte.simbot.qguild.QQGuildApiException import love.forte.simbot.qguild.api.MessageAuditedException +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody import love.forte.simbot.qguild.api.message.MessageSendApi import love.forte.simbot.qguild.api.message.direct.DmsSendApi +import love.forte.simbot.qguild.api.message.group.GroupMessageSendApi +import love.forte.simbot.qguild.api.message.user.UserMessageSendApi import love.forte.simbot.qguild.message.ContentTextEncoder import love.forte.simbot.qguild.stdlib.requestDataBy @@ -72,7 +78,7 @@ public suspend inline fun QGBot.sendMessage( * 使用当前 [QGBot] 向 [channelId] 通过 [MessageSendApi] 发送一个消息, * 消息内容为 [messageContent] 的解析结果。 * - * 如果 [messageContent] 是其他QQ频道事件收到的消息(即为 [QGReceiveMessageContent] 类型), + * 如果 [messageContent] 是其他QQ频道事件收到的消息(即为 [QGMessageContent] 类型), * 则会直接通过 [MessageSendApi.Body.Builder.fromMessage] 转义内部信息而不会尝试解析 [MessageContent.messages]。 * * **注意:** 在转化的过程中会丢失不支持发送的消息(例如附件、图片等)。 @@ -141,7 +147,7 @@ public suspend inline fun QGBot.sendMessage( ): QGMessageReceipt { val body = MessageSendApi.Body { onEachPre() - // 转移后的纯文本字符串 + // 转义后的纯文本字符串 content = ContentTextEncoder.encode(text) onEachPost() } @@ -167,3 +173,176 @@ internal suspend fun QGBot.sendMessage( @QGInternalApi internal suspend fun QGBot.sendDmsMessage(guildId: String, body: MessageSendApi.Body): QGMessageReceipt = DmsSendApi.create(guildId, body).requestDataBy(source).asReceipt() + +@PublishedApi +internal suspend fun QGBot.sendGroupMessage( + openid: String, + body: GroupAndC2CSendBody, +): QGMessageReceipt { + return GroupMessageSendApi.create(openid, body).requestDataBy(source).asReceipt() +} + +@PublishedApi +internal suspend fun QGBot.sendGroupMessage( + openid: String, + list: List, +): QGMessageReceipt { + val receipts = list.map { + GroupMessageSendApi.create(openid, it).requestDataBy(source) + } + + return receipts.asGroupReceipt() +} + +@PublishedApi +internal suspend fun QGBot.sendUserMessage( + openid: String, + list: List, +): QGMessageReceipt { + val receipts = list.map { + UserMessageSendApi.create(openid, it).requestDataBy(source) + } + + return receipts.asUserReceipt() +} + +@PublishedApi +internal suspend fun QGBot.sendUserMessage( + openid: String, + body: GroupAndC2CSendBody, +): QGMessageReceipt { + return UserMessageSendApi.create(openid, body).requestDataBy(source).asReceipt() +} + +internal suspend inline fun QGBot.sendGroupMessage( + openid: String, + text: String, + msgType: Int, + configure: GroupAndC2CSendBody.() -> Unit = {}, +): QGMessageReceipt { + // 转义 + val contentPlainText = ContentTextEncoder.encode(text) + val body = GroupAndC2CSendBody.create(contentPlainText, msgType) + .also(configure) + + return sendGroupMessage(openid, body) +} + +@OptIn(ExperimentalQGApi::class) +@PublishedApi +internal suspend inline fun QGBot.sendGroupMessage( + openid: String, + message: Message, + crossinline onEachPre: GroupAndC2CSendBody.() -> Unit = {}, + onEachPost: GroupAndC2CSendBody.() -> Unit = {}, +): QGMessageReceipt { + val parsed = MessageParsers.parseToGroupAndC2C( + this, + message = message, + builderType = SendingMessageParser.GroupBuilderType.GROUP, + targetOpenid = openid, + factory = { + GroupAndC2CSendBody.create("", GroupAndC2CSendBody.MSG_TYPE_TEXT) + }, + onEachPre = onEachPre, + onEachPost = onEachPost + ) + + if (parsed.size == 1) { + val body = parsed[0] + return sendGroupMessage(openid, body) + } + + return sendGroupMessage(openid, parsed) +} + +@QGInternalApi +public suspend inline fun QGBot.sendGroupMessage( + openid: String, + messageContent: MessageContent, + crossinline onEachPre: GroupAndC2CSendBody.() -> Unit = {}, + onEachPost: GroupAndC2CSendBody.() -> Unit = {}, +): QGMessageReceipt { + if (messageContent is QGGroupAndC2CMessageContent) { + + val body = GroupAndC2CSendBody.create( + messageContent.sourceContent, + GroupAndC2CSendBody.MSG_TYPE_TEXT, + ) { + onEachPre() + // TODO attachments? + onEachPost() + } + + return sendGroupMessage(openid, body) + } + + return sendGroupMessage(openid, messageContent.messages, onEachPre, onEachPost) +} + +//// Users + +internal suspend inline fun QGBot.sendUserMessage( + openid: String, + text: String, + msgType: Int, + configure: GroupAndC2CSendBody.() -> Unit = {}, +): QGMessageReceipt { + // 转义 + val contentPlainText = ContentTextEncoder.encode(text) + val body = GroupAndC2CSendBody.create(contentPlainText, msgType) + .also(configure) + + return sendUserMessage(openid, body) +} + +@OptIn(ExperimentalQGApi::class) +@PublishedApi +internal suspend inline fun QGBot.sendUserMessage( + openid: String, + message: Message, + crossinline onEachPre: GroupAndC2CSendBody.() -> Unit = {}, + onEachPost: GroupAndC2CSendBody.() -> Unit = {}, +): QGMessageReceipt { + val parsed = MessageParsers.parseToGroupAndC2C( + this, + message = message, + builderType = SendingMessageParser.GroupBuilderType.C2C, + targetOpenid = openid, + factory = { + GroupAndC2CSendBody.create("", GroupAndC2CSendBody.MSG_TYPE_TEXT) + }, + onEachPre = onEachPre, + onEachPost = onEachPost + ) + + if (parsed.size == 1) { + val body = parsed[0] + return sendUserMessage(openid, body) + } + + return sendUserMessage(openid, parsed) +} + +@QGInternalApi +public suspend inline fun QGBot.sendUserMessage( + openid: String, + messageContent: MessageContent, + crossinline onEachPre: GroupAndC2CSendBody.() -> Unit = {}, + onEachPost: GroupAndC2CSendBody.() -> Unit = {}, +): QGMessageReceipt { + if (messageContent is QGGroupAndC2CMessageContent) { + val body = GroupAndC2CSendBody.create( + messageContent.sourceContent, + GroupAndC2CSendBody.MSG_TYPE_TEXT, + ) { + onEachPre() + // TODO attachments? + onEachPost() + } + + return sendUserMessage(openid, body) + } + + return sendUserMessage(openid, messageContent.messages, onEachPre, onEachPost) +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGArk.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGArk.kt index 31c9bed5..abe1b205 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGArk.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGArk.kt @@ -24,6 +24,7 @@ import love.forte.simbot.common.id.StringID.Companion.ID import love.forte.simbot.common.id.literal import love.forte.simbot.component.qguild.message.QGArk.Companion.byArk import love.forte.simbot.message.Messages +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody import love.forte.simbot.qguild.message.buildArk import love.forte.simbot.qguild.model.Message import kotlin.jvm.JvmStatic @@ -81,4 +82,31 @@ internal object ArkParser : SendingMessageParser { builderContext.builderOrNew { it.ark == null }.ark = buildArk(realArk.templateId) { from(realArk) } } } + + /** + * 文本消息应当能够与其他类型相融合,因此也接受 TEXT 类型 + */ + private fun isTextOrArk(type: Int) = when (type) { + GroupAndC2CSendBody.MSG_TYPE_ARK, + GroupAndC2CSendBody.MSG_TYPE_TEXT -> true + else -> false + } + + override suspend fun invoke( + index: Int, + element: love.forte.simbot.message.Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext + ) { + if (element is QGArk) { + val builder = builderContext.builderOrNew { + isTextOrArk(it.msgType) && it.ark == null + }.apply { + msgType = GroupAndC2CSendBody.MSG_TYPE_ARK + } + + val realArk = element.toRealArk() + builder.ark = buildArk(realArk.templateId) { from(realArk) } + } + } } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGAtMessages.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGAtMessages.kt index 4aedeeea..8554a710 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGAtMessages.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGAtMessages.kt @@ -20,6 +20,7 @@ package love.forte.simbot.component.qguild.message import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import love.forte.simbot.common.id.ID +import love.forte.simbot.common.id.literal import love.forte.simbot.message.At import love.forte.simbot.message.AtAll import love.forte.simbot.message.Message @@ -55,7 +56,7 @@ internal object MentionParser : SendingMessageParser { // https://bot.q.qq.com/wiki/develop/api/openapi/message/message_format.html /* - 解析为 #子频道 标签,点击可以跳转至子频道,仅支持当前频道内的子频道 + * 解析为 #子频道 标签,点击可以跳转至子频道,仅支持当前频道内的子频道 */ fun atChannel(id: ID) { builderContext.builder.appendContent("<#$id>") @@ -66,18 +67,24 @@ internal object MentionParser : SendingMessageParser { if (element.type == "channel") { atChannel(element.target) } else { - /* - 解析为 @用户 标签 - */ - builderContext.builder.appendContent("<@${element.target}>") + // 解析为 @用户 标签 + // builderContext.builder.appendContent("<@${element.target}>") + // 嵌入文本使用格式: 协议:<@userid>即将弃用,请使用上述最新格式。 + // see https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/trans/text-chain.html + // TODO 2024-07-13 经测试,新格式尚无法使用 +// builderContext.builder.appendContent(toQQBotAtUser(element.target.literal)) + builderContext.builder.appendContent(toOldQQBotAtUser(element.target.literal)) } } is AtAll -> { - /* - 解析为 @所有人 标签,需要机器人拥有发送 @所有人 消息的权限 - */ - builderContext.builder.appendContent("@everyone") + // 解析为 @所有人 标签,需要机器人拥有发送 @所有人 消息的权限 + // builderContext.builder.appendContent("@everyone") + // 嵌入文本使用格式: 协议:@everyone即将弃用,请使用上述最新格式。 + // see https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/trans/text-chain.html + // TODO 2024-07-13 经测试,新格式尚无法使用 +// builderContext.builder.appendContent(QQ_BOT_AT_EVERYONE) + builderContext.builder.appendContent(OLD_QQ_BOT_AT_EVERYONE) } is QGAtChannel -> { @@ -85,4 +92,31 @@ internal object MentionParser : SendingMessageParser { } } } + + override suspend fun invoke( + index: Int, + element: Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext + ) { + when (element) { + is At -> { + // 解析为 @用户 标签 + // builderContext.builder.appendContent("<@${element.target}>") + // 嵌入文本使用格式: 协议:<@userid>即将弃用,请使用上述最新格式。 + // see https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/trans/text-chain.html + // TODO 2024-07-13 群聊似乎不能解析at + builderContext.builder.content += toQQBotAtUser(element.target.literal) + } + + is AtAll -> { + // 解析为 @所有人 标签,需要机器人拥有发送 @所有人 消息的权限 + // builderContext.builder.appendContent("@everyone") + // 嵌入文本使用格式: 协议:@everyone即将弃用,请使用上述最新格式。 + // see https://bot.q.qq.com/wiki/develop/api-v2/server-inter/message/trans/text-chain.html + // TODO 2024-07-13 群聊似乎不能解析at + builderContext.builder.content += QQ_BOT_AT_EVERYONE + } + } + } } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGAttachmentMessage.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGAttachmentMessage.kt index 6105b37d..4adced7c 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGAttachmentMessage.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGAttachmentMessage.kt @@ -92,9 +92,21 @@ internal object AttachmentParser : SendingMessageParser { messages: Messages?, builderContext: SendingMessageParser.BuilderContext ) { + // TODO Attachment 暂不支持 Channel if (element is QGAttachmentMessage) { logger.warn("Attachment message is not yet supported for sending") } } + override suspend fun invoke( + index: Int, + element: love.forte.simbot.message.Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext + ) { + // TODO Attachment 暂不支持 GroupAndC2C + if (element is QGAttachmentMessage) { + logger.warn("Attachment message is not yet supported for sending") + } + } } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGEmbed.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGEmbed.kt index f1d6b504..d84f8030 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGEmbed.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGEmbed.kt @@ -83,4 +83,7 @@ internal object EmbedParser : SendingMessageParser { builderContext.nextMustBeNew() } } + + // TODO Embed暂不不支持 GroupAndC2C + } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMarkdown.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMarkdown.kt new file mode 100644 index 00000000..3a18f19c --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMarkdown.kt @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.message + +import kotlinx.serialization.Serializable +import love.forte.simbot.message.Messages +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody +import love.forte.simbot.qguild.model.Message +import love.forte.simbot.qguild.model.Message.Markdown.Params +import kotlin.jvm.JvmOverloads +import kotlin.jvm.JvmStatic + + +/** + * Markdown 消息内容。 + * + * @author ForteScarlet + */ +@Serializable +public data class QGMarkdown internal constructor( + public val markdown: Message.Markdown +) : QGMessageElement { + public companion object { + /** + * 使用 [markdown] 直接包装构建。 + */ + @JvmStatic + public fun byMarkdown(markdown: Message.Markdown) : QGMarkdown = + QGMarkdown(markdown) + + /** + * 使用 [content] 构建一个 [QGMarkdown]。 + */ + @JvmStatic + public fun create(content: String) : QGMarkdown = + byMarkdown(Message.Markdown(content = content)) + + /** + * 使用 `templateId` 构建一个 [QGMarkdown]。 + * + * @see Message.Markdown.createByTemplateId + */ + @JvmStatic + @JvmOverloads + public fun createByTemplateId(templateId: Int, params: Params? = null) : QGMarkdown = + byMarkdown(Message.Markdown.createByTemplateId(templateId, params)) + + /** + * 使用 `customTemplateId` 构建一个 [QGMarkdown]。 + * + * @see Message.Markdown.createByCustomTemplateId + */ + @JvmStatic + @JvmOverloads + public fun createByCustomTemplateId(customTemplateId: String, params: Params? = null) : QGMarkdown = + byMarkdown(Message.Markdown.createByCustomTemplateId(customTemplateId, params)) + } +} + +internal object MarkdownParser : SendingMessageParser { + // TODO 连续Markdown content可叠加? + + override suspend fun invoke( + index: Int, + element: love.forte.simbot.message.Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.BuilderContext + ) { + if (element is QGMarkdown) { + val builder = builderContext.builderOrNew { + it.markdown == null + } + builder.markdown = element.markdown + } + } + + private fun isTextOrMarkdown(type: Int): Boolean { + return type == GroupAndC2CSendBody.MSG_TYPE_TEXT + || type == GroupAndC2CSendBody.MSG_TYPE_MARKDOWN + } + + override suspend fun invoke( + index: Int, + element: love.forte.simbot.message.Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext + ) { + if (element is QGMarkdown) { + val builder = builderContext.builderOrNew { + isTextOrMarkdown(it.msgType) && it.markdown == null + } + builder.msgType = GroupAndC2CSendBody.MSG_TYPE_MARKDOWN + builder.markdown = element.markdown + } + } +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMedia.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMedia.kt new file mode 100644 index 00000000..2788c0d5 --- /dev/null +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMedia.kt @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024. ForteScarlet. + * + * This file is part of simbot-component-qq-guild. + * + * simbot-component-qq-guild is free software: you can redistribute it and/or modify it under the terms + * of the GNU Lesser General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * simbot-component-qq-guild is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along with simbot-component-qq-guild. + * If not, see . + */ + +package love.forte.simbot.component.qguild.message + +import kotlinx.serialization.Serializable +import love.forte.simbot.message.Message +import love.forte.simbot.message.Messages +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody +import love.forte.simbot.qguild.model.MessageMedia + + +/** + * 一个用于发送的 media 消息内容,内含 [fileInfo][MessageMedia.fileInfo] 信息。 + * + * @author ForteScarlet + */ +@Serializable +public data class QGMedia(public val media: MessageMedia) : QGMessageElement + +internal object MediaParser : SendingMessageParser { + override suspend fun invoke( + index: Int, + element: Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.BuilderContext + ) { + // Channel not supported media + } + + override suspend fun invoke( + index: Int, + element: Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext + ) { + if (element is QGMedia) { + val builder = builderContext.builderOrNew { + isTextOrMedia(it.msgType) && it.media == null + }.apply { + msgType = GroupAndC2CSendBody.MSG_TYPE_MEDIA + } + + builder.media = element.media + if (builder.content.isEmpty()) { + builder.content = " " + } + } + } +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMessageContent.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMessageContent.kt index 8d126006..a43072fc 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMessageContent.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMessageContent.kt @@ -23,6 +23,7 @@ import love.forte.simbot.common.id.ID import love.forte.simbot.component.qguild.QQGuildComponent import love.forte.simbot.message.* import love.forte.simbot.qguild.message.ContentTextDecoder +import love.forte.simbot.qguild.model.Message import kotlin.jvm.JvmSynthetic import love.forte.simbot.qguild.model.Message as QGSourceMessage @@ -31,16 +32,17 @@ import love.forte.simbot.qguild.model.Message as QGSourceMessage * * @author ForteScarlet */ -public abstract class QGMessageContent : MessageContent { +public abstract class QGBaseMessageContent : MessageContent { /** * 此消息的ID */ abstract override val id: ID + /** - * 通过 [sourceMessage] 转化后的消息元素链。 + * 通过原始消息转化后的消息元素链。 * - * 如果中 [sourceMessage] 的 [content][QGSourceMessage.content] 没有任何可匹配特殊的内嵌格式, + * 如果事件中的 `content`没有任何可匹配特殊的内嵌格式, * 则 [messages] 的第一个元素会直接根据 [content][QGSourceMessage.content] 拼接为 [QGContentText], * 否则会解析 `content` 并将其中的内容**依次顺序地**根据类型转化为以下可能的类型: * - [Text]: 根据解析的 `content` 中非内嵌格式文本的[**解码**][ContentTextDecoder.decode]结果。 @@ -53,7 +55,7 @@ public abstract class QGMessageContent : MessageContent { * - [Face]: 当 `content` 中存在系统表情时(例如 ``)会被转化为 [Face] 类型。 * 注意并不是转化为 [Emoji],因为其代表的是**系统表情**。 * - * 上述解析结束后,会再根据 [sourceMessage] 中的其他可转化属性在结果后面继续追加如下可能的类型: + * 上述解析结束后,会再根据原始消息中的其他可转化属性在结果后面继续追加如下可能的类型: * - [QGArk]: 来自于 [sourceMessage.ark][QGSourceMessage.ark] * - [QGAttachmentMessage]: 来自于 [sourceMessage.attachments][QGSourceMessage.attachments],可能有多个 * - [QGReference]: 来自于 [sourceMessage.messageReference][QGSourceMessage.messageReference] @@ -63,12 +65,6 @@ public abstract class QGMessageContent : MessageContent { // TODO attachment image 类型解析为 QGImage? - /** - * 事件接收到的原始的消息对象 [Message][QGSourceMessage] - */ - public abstract val sourceMessage: QGSourceMessage - - /** * * 接收到的被替换/移除所有 **特殊文本([内嵌格式](https://bot.q.qq.com/wiki/develop/api/openapi/message/message_format.html))** 内容后的纯文本消息内容。 @@ -83,7 +79,7 @@ public abstract class QGMessageContent : MessageContent { * ``` * 此时收到的消息中的 `content` 为 * ```text - * <@!123456> 你好 + * 你好 * ``` * 那么就会根据 `mentions` 进行替换,最终的 [plainText] 的值为: * ```text @@ -96,10 +92,12 @@ public abstract class QGMessageContent : MessageContent { * * ### `mention everyone` 替换 * - * 对于 `@everyone` 来说,没有可转义的字符,因此可能会被伪造。当 [mentionEveryone][QGSourceMessage.mentionEveryone] 为 `true` 时, - * [plainText] 会尝试清理文本中**第一个** `@everyone`。 + * 当 [mentionEveryone][QGSourceMessage.mentionEveryone] 为 `true` 时, + * [plainText] 会尝试清理文本中**第一个** ``。 + * + * 如果是群消息(即没有 [QGSourceMessage] 类型,只有 `content`),则会全部进行转化。 * - * 被替换的这个首个 `@everyone` 会被解析于 [messages] 中作为 [AtAll]。 + * 被替换的 `` 会被解析于 [messages] 中作为 [AtAll]。 * * ### `mention channel` 替换 * @@ -141,7 +139,7 @@ public abstract class QGMessageContent : MessageContent { * * ### 原始Content * - * 如果你想要得到本次消息最原始的 `content`,直接使用 [sourceMessage] 获取 [Message.content][QGSourceMessage.content] + * 如果你想要得到本次消息最原始的 `content`,直接使用 [sourceContent] 获取 * * ```kotlin * val contentText = receiveContent.sourceMessage.content @@ -152,6 +150,24 @@ public abstract class QGMessageContent : MessageContent { */ abstract override val plainText: String + /** + * 事件中原始的 `content` 内容。 + * + */ + public abstract val sourceContent: String +} + +/** + * 文字子频道中接收到的事件消息内容。 + * + * @author ForteScarlet + */ +public abstract class QGMessageContent : QGBaseMessageContent() { + /** + * 事件接收到的原始的消息对象 [Message][QGSourceMessage] + */ + public abstract val sourceMessage: QGSourceMessage + /** * 暂时不支持消息撤回。 * 如果 [options] 中不包含 @@ -160,9 +176,39 @@ public abstract class QGMessageContent : MessageContent { */ @JvmSynthetic override suspend fun delete(vararg options: DeleteOption) { + // TODO if (options.none { it == StandardDeleteOption.IGNORE_ON_UNSUPPORTED }) { - throw UnsupportedOperationException("QGReceiveMessageContent.delete") + throw UnsupportedOperationException("QGMessageContent.delete") } } +} +/** + * 群聊或c2c单聊接收到的事件消息内容。 + * @author ForteScarlet + */ +public abstract class QGGroupAndC2CMessageContent : QGBaseMessageContent() { + /** + * 原始的消息正文内容。 + */ + abstract override val sourceContent: String + + /** + * 原始的消息事件内的 attachements + */ + public abstract val attachments: List + + /** + * 暂时不支持消息撤回。 + * 如果 [options] 中不包含 + * [StandardDeleteOption.IGNORE_ON_UNSUPPORTED] + * 则抛出 [UnsupportedOperationException] + */ + @JvmSynthetic + override suspend fun delete(vararg options: DeleteOption) { + // TODO + if (options.none { it == StandardDeleteOption.IGNORE_ON_UNSUPPORTED }) { + throw UnsupportedOperationException("QGGroupAndC2CMessageContent.delete") + } + } } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMessageReceipt.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMessageReceipt.kt index 8062fe9c..6d3f692d 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMessageReceipt.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGMessageReceipt.kt @@ -19,6 +19,7 @@ package love.forte.simbot.component.qguild.message import love.forte.simbot.ability.DeleteOption import love.forte.simbot.ability.StandardDeleteOption +import love.forte.simbot.common.id.ID import love.forte.simbot.message.AggregatedMessageReceipt import love.forte.simbot.message.MessageReceipt import love.forte.simbot.message.SingleMessageReceipt @@ -91,3 +92,25 @@ public abstract class QGAggregatedMessageReceipt : AggregatedMessageReceipt(), Q super.delete(*options) } } + +/** + * 仅有ID信息的 [QGMessageReceipt]. 通常来自发送群消息或好友消息。 + */ +public abstract class QGSingleIdMessageReceipt : SingleMessageReceipt(), QGMessageReceipt { + abstract override val id: ID +} + +/** + * 多个 [QGSingleIdMessageReceipt] 的集合回执。 + */ +public abstract class QGAggregatedIdMessageReceipt : AggregatedMessageReceipt(), QGMessageReceipt { + abstract override val size: Int + + abstract override fun get(index: Int): QGSingleIdMessageReceipt + + abstract override fun iterator(): Iterator + + override suspend fun delete(vararg options: DeleteOption) { + super.delete(*options) + } +} diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGReference.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGReference.kt index 03b71440..e4081de9 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGReference.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGReference.kt @@ -121,4 +121,17 @@ internal object ReferenceParser : SendingMessageParser { } } } + + override suspend fun invoke( + index: Int, + element: love.forte.simbot.message.Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext + ) { + if (element is QGReference) { + builderContext.builders.forEach { + it.messageReference = element.source + } + } + } } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGReplyTo.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGReplyTo.kt index 32535268..e86e9101 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGReplyTo.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/QGReplyTo.kt @@ -24,6 +24,7 @@ import love.forte.simbot.common.id.literal import love.forte.simbot.message.Message import love.forte.simbot.message.Messages import love.forte.simbot.qguild.api.message.MessageSendApi +import kotlin.jvm.JvmOverloads /** * @@ -41,7 +42,9 @@ import love.forte.simbot.qguild.api.message.MessageSendApi @SerialName("qg.replyTo") @Serializable @QGSendOnly -public data class QGReplyTo(val id: ID) : QGMessageElement +public data class QGReplyTo +@JvmOverloads constructor(val id: ID, val seq: Int? = null) : + QGMessageElement internal object ReplyToParser : SendingMessageParser { override suspend fun invoke( @@ -57,4 +60,17 @@ internal object ReplyToParser : SendingMessageParser { } } + override suspend fun invoke( + index: Int, + element: Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext + ) { + if (element is QGReplyTo) { + builderContext.builders.forEach { + it.msgId = element.id.literal + element.seq?.also { seq -> it.msgSeq = seq } + } + } + } } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/SendingMessageParser.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/SendingMessageParser.kt index f1f90965..d2cfa349 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/SendingMessageParser.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/SendingMessageParser.kt @@ -18,54 +18,72 @@ package love.forte.simbot.component.qguild.message import love.forte.simbot.component.qguild.ExperimentalQGApi +import love.forte.simbot.component.qguild.bot.QGBot import love.forte.simbot.message.Messages import love.forte.simbot.message.emptyMessages +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody import love.forte.simbot.qguild.api.message.MessageSendApi +import love.forte.simbot.qguild.api.message.isEmpty import love.forte.simbot.qguild.model.Message -import kotlin.jvm.JvmName import kotlin.jvm.JvmOverloads +import kotlin.jvm.JvmSynthetic import love.forte.simbot.message.Message as SimbotMessage /** * 通过消息体和message builder, 以责任链的形式构建消息体。 */ -public fun interface SendingMessageParser : - suspend (Int, SimbotMessage.Element, Messages?, SendingMessageParser.BuilderContext) -> Unit { +public fun interface SendingMessageParser { /** * 将 [SimbotMessage.Element] 拼接到 [MessageSendApi.Body.Builder] 中。 * * @param index 当前消息链中的数据. */ - override suspend fun invoke( + public suspend fun invoke( index: Int, element: SimbotMessage.Element, messages: Messages?, builderContext: BuilderContext, ) - public data class BuilderContext( - val builderFactory: () -> MessageSendApi.Body.Builder + /** + * 将 [SimbotMessage.Element] 拼接到 [GroupAndC2CSendBody] 中。 + * + * @param index 当前消息链中的数据. + */ + public suspend fun invoke( + index: Int, + element: SimbotMessage.Element, + messages: Messages?, + builderContext: GroupAndC2CBuilderContext, + ) { + } + + public enum class GroupBuilderType { + GROUP, C2C + } + + public abstract class AbstractBuilderContext( + public val builderFactory: () -> B ) { - public val builders: ArrayDeque + public val builders: ArrayDeque /** * 标记下一次再获取 builder 时必须新建。 */ - public var nextIsNew: Boolean = false - private set + public open var nextIsNew: Boolean = false + protected set @PublishedApi - internal fun nextMustBeNew(value: Boolean = true) { + internal open fun nextMustBeNew(value: Boolean = true) { nextIsNew = value } init { builders = ArrayDeque() - builders.add(builderFactory()) } - val builder: MessageSendApi.Body.Builder + public open val builder: B get() { if (nextIsNew) { return newBuilder().also { @@ -73,46 +91,78 @@ public fun interface SendingMessageParser : } } + if (builders.isEmpty()) { + return newBuilder() + } + return builders.last() } - public fun newBuilder(): MessageSendApi.Body.Builder { + public open fun newBuilder(): B { return builderFactory().also { builders.addLast(it) } } + /** * 如果符合 [check] 的条件,得到 [builder], 否则使用 [newBuilder] 构建一个新的builder。 * + * 如果尚未初始化,直接返回一个新的值,不做检测。 + * * 如果 [nextIsNew] 被标记为 `true`, 则本次不会调用 [check] 且必然得到新的 builder. * */ - public inline fun builderOrNew(check: (MessageSendApi.Body.Builder) -> Boolean): MessageSendApi.Body.Builder { + public inline fun builderOrNew(check: (B) -> Boolean): B { if (nextIsNew) { return newBuilder().also { nextMustBeNew(false) } } + + if (builders.isEmpty()) { + return newBuilder() + } + return builder.takeIf(check) ?: newBuilder() } } + + public class BuilderContext( + builderFactory: () -> MessageSendApi.Body.Builder + ) : AbstractBuilderContext(builderFactory) + + public class GroupAndC2CBuilderContext( + public val bot: QGBot, + public val type: GroupBuilderType, + public val targetOpenid: String, + builderFactory: () -> GroupAndC2CSendBody + ) : AbstractBuilderContext(builderFactory) } /** - * 将一个 [Message] 转化为 [Message]. + * 将一个 [Message] 转化为 [Messages]. */ -public fun interface ReceivingMessageParser { +public interface ReceivingMessageParser { /** * 解析一个 [Message], 并将其内部信息并入 [Context] 中。 */ public operator fun invoke(qgMessage: Message, context: Context): Context + /** + * 解析一个 `content`, 并将其内部信息并入 [Context] 中。 + */ + public operator fun invoke(qgContent: String, context: Context): Context + /** * 消息链和正文文本内容的容器,用于 [ReceivingMessageParser.invoke] 中进行传递解析。 * */ - public data class Context(public var messages: Messages, public var plainTextBuilder: StringBuilder) + public data class Context( + public var messages: Messages, + public var plainTextBuilder: StringBuilder, + public var attachments: List? = null, + ) } @@ -131,6 +181,8 @@ public object MessageParsers { add(ReplyToParser) add(ImageParser) add(ReferenceParser) + add(MediaParser) + add(MarkdownParser) } @ExperimentalQGApi @@ -138,16 +190,6 @@ public object MessageParsers { add(QGMessageParser) } -// @ExperimentalSimbotAPI -// public fun addParser(parser: SendingMessageParser) { -// sendingParsers.add(parser) -// } -// -// @ExperimentalSimbotAPI -// public fun addParser(parser: ReceivingMessageParser) { -// receivingParsers.add(parser) -// } - /** * 将 [message] 解析为一个或多个 [MessageSendApi.Body.Builder]。 * @@ -181,26 +223,27 @@ public object MessageParsers { * @return 解析结果的 [MessageSendApi.Body.Builder] 序列。 */ @OptIn(ExperimentalQGApi::class) - @JvmOverloads - @JvmName("parse") + @JvmSynthetic public suspend inline fun parse( message: SimbotMessage, crossinline onEachPre: MessageSendApi.Body.Builder.() -> Unit = {}, onEachPost: MessageSendApi.Body.Builder.() -> Unit = {}, ): List { - val context = SendingMessageParser.BuilderContext { MessageSendApi.Body.Builder().also(onEachPre) } + val context = SendingMessageParser.BuilderContext { + MessageSendApi.Body.Builder().also(onEachPre) + } when (message) { is SimbotMessage.Element -> { for (parser in sendingParsers) { - parser(0, message, null, context) + parser.invoke(0, message, null, context) } } is Messages -> { message.forEachIndexed { index, element -> for (parser in sendingParsers) { - parser(index, element, message, context) + parser.invoke(index, element, message, context) } } } @@ -215,6 +258,52 @@ public object MessageParsers { } + @ExperimentalQGApi + @JvmSynthetic + public suspend inline fun parseToGroupAndC2C( + bot: QGBot, + message: SimbotMessage, + builderType: SendingMessageParser.GroupBuilderType, + targetOpenid: String, + crossinline factory: () -> GroupAndC2CSendBody, + crossinline onEachPre: GroupAndC2CSendBody.() -> Unit = {}, + onEachPost: GroupAndC2CSendBody.() -> Unit = {}, + ): List { + val context = SendingMessageParser.GroupAndC2CBuilderContext( + bot, + builderType, + targetOpenid + ) { + factory().also(onEachPre) + } + + when (message) { + is SimbotMessage.Element -> { + for (parser in sendingParsers) { + parser.invoke(0, message, null, context) + } + } + + is Messages -> { + message.forEachIndexed { index, element -> + for (parser in sendingParsers) { + parser.invoke(index, element, message, context) + } + } + } + } + + val builders = context.builders + if (builders.size <= 1) { + return listOf(builders.first().also(onEachPost)) + } + + return builders.mapNotNullTo(ArrayList(builders.size)) { + it.also(onEachPost).takeUnless { b -> b.isEmpty() } + } + } + + @OptIn(ExperimentalQGApi::class) @JvmOverloads public fun parse( @@ -224,10 +313,30 @@ public object MessageParsers { return receivingParsers.fold( ReceivingMessageParser.Context( messagesInit, - StringBuilder(message.content.length) + StringBuilder(message.content.length), + message.attachments, + ) + ) { context, parser -> + parser.invoke(message, context) + } + } + + + @OptIn(ExperimentalQGApi::class) + @JvmOverloads + public fun parse( + content: String, + attachments: List? = null, + messagesInit: Messages = emptyMessages(), + ): ReceivingMessageParser.Context { + return receivingParsers.fold( + ReceivingMessageParser.Context( + messagesInit, + StringBuilder(content.length), + attachments ) ) { context, parser -> - parser(message, context) + parser.invoke(content, context) } } diff --git a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/StandardMessageParsers.kt b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/StandardMessageParsers.kt index d4627d88..353c048f 100644 --- a/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/StandardMessageParsers.kt +++ b/simbot-component-qq-guild-core/src/commonMain/kotlin/love/forte/simbot/component/qguild/message/StandardMessageParsers.kt @@ -47,6 +47,26 @@ internal object ContentParser : SendingMessageParser { } } } + + override suspend fun invoke( + index: Int, + element: love.forte.simbot.message.Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext + ) { + fun builder() = builderContext.builder + + when (element) { + is Text -> { + // 转义为无内嵌格式的文本 + builder().content += ContentTextEncoder.encode(element.text) + } + + is QGContentText -> { + builder().content += element.content + } + } + } } /** @@ -73,39 +93,105 @@ internal object FaceParser : SendingMessageParser { builderContext.builder.appendContent("$EMOJI_PREFIX$id$EMOJI_SUFFIX") } } + + override suspend fun invoke( + index: Int, + element: love.forte.simbot.message.Message.Element, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext + ) { + if (element is Face) { + val builder = builderContext.builder + + val id = element.id.literal + builder.content += "$EMOJI_PREFIX$id$EMOJI_SUFFIX" + } + } } internal object QGMessageParser : ReceivingMessageParser { private const val AT_USER_VALUE = "uv" private const val AT_EVERYONE_GROUP = "all" + // 2024-07-13 兼容之前的两个写法解析:因为好像内容还没变 + private const val AT_USER_OLD_VALUE = "uvold" + private const val AT_EVERYONE_OLD_GROUP = "allold" + private const val MENTION_CHANNEL_VALUE = "cv" private const val EMOJI_VALUE = "ev" +// +// private val replaceRegex = Regex( +// "<@!?(?<$AT_USER_VALUE>\\d+)>" + +// "|(?<$AT_EVERYONE_GROUP>@everyone)" + +// "|<#(?<$MENTION_CHANNEL_VALUE>\\d+)>" + +// "|\\d+)>" +// ) +// +// private val replaceWithoutMentionAllRegex = Regex( +// "<@!?(?<$AT_USER_VALUE>\\d+)>" + +// "|<#(?<$MENTION_CHANNEL_VALUE>\\d+)>" + +// "|\\d+)>" +// ) + + /* + * 嵌入文本使用格式: 协议:<@userid>即将弃用,请使用上述最新格式。 + * 嵌入文本使用格式: 协议:@everyone即将弃用,请使用上述最新格式。 + */ private val replaceRegex = Regex( - "<@!?(?<$AT_USER_VALUE>\\d+)>" + - "|(?<$AT_EVERYONE_GROUP>@everyone)" + + "[.a-zA-Z0-9_-]+)\" */>" + + "|(?<$AT_EVERYONE_GROUP>)" + "|<#(?<$MENTION_CHANNEL_VALUE>\\d+)>" + - "|\\d+)>" + "|\\d+)>" + + // 兼容之前的两个写法解析 + "|<@!?(?<$AT_USER_OLD_VALUE>\\d+)>" + + "|(?<$AT_EVERYONE_OLD_GROUP>@everyone)" ) private val replaceWithoutMentionAllRegex = Regex( - "<@!?(?<$AT_USER_VALUE>\\d+)>" + + "[.a-zA-Z0-9_-]+)\" */>" + "|<#(?<$MENTION_CHANNEL_VALUE>\\d+)>" + - "|\\d+)>" + "|\\d+)>" + + // 兼容之前的两个写法解析 + "|<@!?(?<$AT_USER_OLD_VALUE>\\d+)>" ) + override fun invoke(qgContent: String, context: ReceivingMessageParser.Context): ReceivingMessageParser.Context { + return invoke0(qgContent, null, context) + } override fun invoke(qgMessage: Message, context: ReceivingMessageParser.Context): ReceivingMessageParser.Context { - val contentText = qgMessage.content - val isMentionEveryone = qgMessage.mentionEveryone + return invoke0(qgMessage.content, qgMessage, context) + } + + + private inline fun resolveAttachments(attachments: List, block: (QGAttachmentMessage) -> Unit) { + attachments.forEach { + block(it.toMessage()) + } + } + + private fun invoke0( + content: String, + qgMessage: Message?, + context: ReceivingMessageParser.Context + ): ReceivingMessageParser.Context { + val isMentionEveryone = qgMessage?.mentionEveryone + val maybeMentionEveryone = isMentionEveryone != false var match: MatchResult? = - (if (isMentionEveryone) replaceRegex else replaceWithoutMentionAllRegex).find(contentText) + // null or true + (if (maybeMentionEveryone) replaceRegex else replaceWithoutMentionAllRegex).find(content) + if (match == null) { - context.plainTextBuilder.append(ContentTextDecoder.decode(contentText)) - context.messages += QGContentText(contentText) + context.plainTextBuilder.append(ContentTextDecoder.decode(content)) + context.messages += QGContentText(content) + context.attachments?.also { + resolveAttachments(it) { attachment -> + context.messages += attachment + } + } return context } @@ -142,16 +228,22 @@ internal object QGMessageParser : ReceivingMessageParser { } var lastStart = 0 - val length = contentText.length + val length = content.length do { val foundMatch = match!! - appendText(contentText, lastStart, foundMatch.range.first) + appendText(content, lastStart, foundMatch.range.first) //region match transform kotlin.run { val groups = foundMatch.groups groups[AT_USER_VALUE]?.also { atUserValue -> + flushText() + messageList.add(At(atUserValue.value.ID, originContent = toQQBotAtUser(atUserValue.value))) + return@run + } + // 兼容旧的 + groups[AT_USER_OLD_VALUE]?.also { atUserValue -> flushText() messageList.add(At(atUserValue.value.ID, originContent = "<@${atUserValue.value}>")) return@run @@ -169,12 +261,17 @@ internal object QGMessageParser : ReceivingMessageParser { return@run } - if (isMentionEveryone) { + if (maybeMentionEveryone) { groups[AT_EVERYONE_GROUP]?.also { flushText() messageList.add(AtAll) return@run } + groups[AT_EVERYONE_OLD_GROUP]?.also { + flushText() + messageList.add(AtAll) + return@run + } } groups[EMOJI_VALUE]?.also { emojiValue -> @@ -192,24 +289,42 @@ internal object QGMessageParser : ReceivingMessageParser { } while (lastStart < length && match != null) if (lastStart < length) { - appendText(contentText, lastStart, contentText.length) + appendText(content, lastStart, content.length) } // end flush flushText() // ark - qgMessage.ark?.toMessage()?.also { messageList.add(it) } + qgMessage?.ark?.toMessage()?.also { messageList.add(it) } // attachments - qgMessage.attachments.mapTo(messageList) { it.toMessage() } + context.attachments?.mapTo(messageList) { it.toMessage() } // TODO embeds? - // reference - qgMessage.messageReference?.also { messageList.add(it.toMessage()) } + qgMessage?.messageReference?.also { messageList.add(it.toMessage()) } context.messages += messageList return context } } + +/* + * 嵌入文本使用格式: 协议:<@userid>即将弃用,请使用上述最新格式。 + * 嵌入文本使用格式: 协议:@everyone即将弃用,请使用上述最新格式。 + */ + +internal const val QQ_BOT_AT_USER_PREFIX = "" +internal const val QQ_BOT_AT_EVERYONE = "" + +internal fun toQQBotAtUser(id: String): String = + "$QQ_BOT_AT_USER_PREFIX$id$QQ_BOT_AT_USER_SUFFIX" + +internal const val OLD_QQ_BOT_AT_USER_PREFIX = "<@" +internal const val OLD_QQ_BOT_AT_USER_SUFFIX = ">" +internal const val OLD_QQ_BOT_AT_EVERYONE = "@everyone" + +internal fun toOldQQBotAtUser(id: String): String = + "$OLD_QQ_BOT_AT_USER_PREFIX$id$OLD_QQ_BOT_AT_USER_SUFFIX" diff --git a/simbot-component-qq-guild-core/src/jsMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.js.kt b/simbot-component-qq-guild-core/src/jsMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.js.kt index edec521d..f9b5f0d4 100644 --- a/simbot-component-qq-guild-core/src/jsMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.js.kt +++ b/simbot-component-qq-guild-core/src/jsMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.js.kt @@ -26,3 +26,10 @@ internal actual fun processOfflineImage0( messages: Messages?, builderContext: SendingMessageParser.BuilderContext ): Boolean = false + +internal actual suspend fun processOfflineImage0( + index: Int, + element: OfflineImage, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext +): Boolean = false diff --git a/simbot-component-qq-guild-core/src/jvmMain/java/module-info.java b/simbot-component-qq-guild-core/src/jvmMain/java/module-info.java index b653c2a5..80ae9253 100644 --- a/simbot-component-qq-guild-core/src/jvmMain/java/module-info.java +++ b/simbot-component-qq-guild-core/src/jvmMain/java/module-info.java @@ -39,6 +39,8 @@ exports love.forte.simbot.component.qguild.event; exports love.forte.simbot.component.qguild.forum; exports love.forte.simbot.component.qguild.guild; + exports love.forte.simbot.component.qguild.friend; + exports love.forte.simbot.component.qguild.group; exports love.forte.simbot.component.qguild.message; exports love.forte.simbot.component.qguild.role; exports love.forte.simbot.component.qguild.utils; diff --git a/simbot-component-qq-guild-core/src/jvmMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.jvm.kt b/simbot-component-qq-guild-core/src/jvmMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.jvm.kt index f7427c61..a1398f7b 100644 --- a/simbot-component-qq-guild-core/src/jvmMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.jvm.kt +++ b/simbot-component-qq-guild-core/src/jvmMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.jvm.kt @@ -17,9 +17,15 @@ package love.forte.simbot.component.qguild.message +import love.forte.simbot.common.id.StringID.Companion.ID +import love.forte.simbot.component.qguild.message.SendingMessageParser.GroupBuilderType.C2C +import love.forte.simbot.component.qguild.message.SendingMessageParser.GroupBuilderType.GROUP import love.forte.simbot.message.Messages import love.forte.simbot.message.OfflineImage import love.forte.simbot.message.OfflineResourceImage +import love.forte.simbot.qguild.api.files.UploadGroupFilesApi +import love.forte.simbot.qguild.api.files.UploadUserFilesApi +import love.forte.simbot.qguild.api.message.GroupAndC2CSendBody import love.forte.simbot.resource.FileResource import love.forte.simbot.resource.PathResource import love.forte.simbot.resource.URIResource @@ -51,3 +57,71 @@ internal actual fun processOfflineImage0( return false } + +internal actual suspend fun processOfflineImage0( + index: Int, + element: OfflineImage, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext +): Boolean { + // TODO Upload 目前只支持 URL 链接的格式 + + fun builder() = builderContext.builderOrNew { + isTextOrMedia(it.msgType) && it.media == null + }.also { + it.msgType = GroupAndC2CSendBody.MSG_TYPE_MEDIA + } + + val url = when (element) { + is OfflineResourceImage -> { + val resource = element.resource + if (resource is URIResource) { + resource.uri.toASCIIString() + } else { + ImageParser.logger.warn( + "QQGroup or C2C currently only supports sending **offline** images using URL links, " + + "the type of element {} (index={}, type={}) is not supported. " + + "Please use `URIResource`, `OfflineURIImage` or use `QGMedia` instead.", + element, + index, + element::class, + ) + + return false + } + } + + else -> return false + } + + val type = builderContext.type + ImageParser.logger.debug("Uploading offline image to {} with target {}", type, builderContext.targetOpenid) + + val uploadedMedia = when (type) { + GROUP -> { + builderContext.bot.uploadGroupMedia( + target = builderContext.targetOpenid.ID, + url = url, + type = UploadGroupFilesApi.FILE_TYPE_IMAGE, + ) + } + + C2C -> { + builderContext.bot.uploadUserMedia( + target = builderContext.targetOpenid.ID, + url = url, + type = UploadUserFilesApi.FILE_TYPE_IMAGE, + ) + } + } + + ImageParser.logger.debug("Uploaded offline image to media {}", uploadedMedia) + + val builder = builder() + builder.media = uploadedMedia.media + if (builder.content.isEmpty()) { + builder.content = " " + } + + return true +} diff --git a/simbot-component-qq-guild-core/src/jvmTest/resources/log4j2.xml b/simbot-component-qq-guild-core/src/jvmTest/resources/log4j2.xml new file mode 100644 index 00000000..52b6eb74 --- /dev/null +++ b/simbot-component-qq-guild-core/src/jvmTest/resources/log4j2.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/simbot-component-qq-guild-core/src/nativeMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.native.kt b/simbot-component-qq-guild-core/src/nativeMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.native.kt index edec521d..f9b5f0d4 100644 --- a/simbot-component-qq-guild-core/src/nativeMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.native.kt +++ b/simbot-component-qq-guild-core/src/nativeMain/kotlin/love/forte/simbot/component/qguild/message/ImageParser.native.kt @@ -26,3 +26,10 @@ internal actual fun processOfflineImage0( messages: Messages?, builderContext: SendingMessageParser.BuilderContext ): Boolean = false + +internal actual suspend fun processOfflineImage0( + index: Int, + element: OfflineImage, + messages: Messages?, + builderContext: SendingMessageParser.GroupAndC2CBuilderContext +): Boolean = false diff --git a/simbot-component-qq-guild-stdlib/api/simbot-component-qq-guild-stdlib.api b/simbot-component-qq-guild-stdlib/api/simbot-component-qq-guild-stdlib.api index fe506200..cb3f2307 100644 --- a/simbot-component-qq-guild-stdlib/api/simbot-component-qq-guild-stdlib.api +++ b/simbot-component-qq-guild-stdlib/api/simbot-component-qq-guild-stdlib.api @@ -2,6 +2,7 @@ public abstract interface class love/forte/simbot/qguild/stdlib/Bot : kotlinx/co public fun asFuture ()Ljava/util/concurrent/CompletableFuture; public fun cancel ()V public abstract fun cancel (Ljava/lang/Throwable;)V + public abstract fun getAccessToken ()Ljava/lang/String; public abstract fun getApiClient ()Lio/ktor/client/HttpClient; public abstract fun getApiDecoder ()Lkotlinx/serialization/json/Json; public abstract fun getApiServer ()Lio/ktor/http/Url; @@ -90,6 +91,7 @@ public final class love/forte/simbot/qguild/stdlib/BotFactory { public final class love/forte/simbot/qguild/stdlib/BotRequests { public static final fun botToken (Llove/forte/simbot/qguild/stdlib/Bot;)Ljava/lang/String; + public static final fun qqBotToken (Llove/forte/simbot/qguild/stdlib/Bot;)Ljava/lang/String; public static final synthetic fun request (Llove/forte/simbot/qguild/stdlib/Bot;Llove/forte/simbot/qguild/api/QQGuildApi;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun requestAsync (Llove/forte/simbot/qguild/stdlib/Bot;Llove/forte/simbot/qguild/api/QQGuildApi;)Ljava/util/concurrent/CompletableFuture; public static final fun requestAsync (Llove/forte/simbot/qguild/stdlib/Bot;Llove/forte/simbot/qguild/api/QQGuildApi;Lkotlinx/coroutines/CoroutineScope;)Ljava/util/concurrent/CompletableFuture; diff --git a/simbot-component-qq-guild-stdlib/build.gradle.kts b/simbot-component-qq-guild-stdlib/build.gradle.kts index e6fc308c..cfd790c6 100644 --- a/simbot-component-qq-guild-stdlib/build.gradle.kts +++ b/simbot-component-qq-guild-stdlib/build.gradle.kts @@ -75,7 +75,8 @@ kotlin { } jvmTest.dependencies { - runtimeOnly(libs.ktor.client.cio) +// implementation(libs.ktor.client.cio) + implementation(libs.ktor.client.java) implementation(libs.log4j.api) implementation(libs.log4j.core) implementation(libs.log4j.slf4j2) diff --git a/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/Bot.kt b/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/Bot.kt index 22374ae6..6b3ebecf 100644 --- a/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/Bot.kt +++ b/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/Bot.kt @@ -46,6 +46,17 @@ public interface Bot : CoroutineScope { */ public val ticket: Ticket + /** + * 用于API请求的 `access_token`。 + * 当执行了 [start] 之后会周期性刷新此值, + * 直到bot被终止。 + * + * 如果bot尚未被启动,则会始终得到空字符串。 + * + * 这属于敏感信息,请注意保护。 + */ + public val accessToken: String + /** * Bot当前的配置信息。 */ @@ -145,6 +156,8 @@ public interface Bot : CoroutineScope { /** * 启动当前BOT。如果已经存在 [client], 则会关闭已存连接并重新连接。 * + * 更建议使用 `start(() -> GatewayInfo)` + * * @throws CancellationException 如果当前 bot 已经被关闭 * * @param gateway 提供准备好的路由信息。 diff --git a/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/BotRequests.kt b/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/BotRequests.kt index 604cae09..f34034a2 100644 --- a/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/BotRequests.kt +++ b/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/BotRequests.kt @@ -36,11 +36,11 @@ import kotlin.jvm.JvmSynthetic */ @JvmSynthetic public suspend fun QQGuildApi<*>.requestBy(bot: Bot): HttpResponse { - val botToken = bot.botToken() return request( client = bot.apiClient, - token = botToken, + token = bot.qqBotToken(), server = bot.apiServer, + appId = bot.ticket.appId ) } @@ -53,12 +53,12 @@ public suspend inline fun QQGuildApi<*>.requestTextBy( bot: Bot, useResp: (HttpResponse) -> Unit = {} ): String { - val botToken = bot.botToken() return requestText( client = bot.apiClient, - token = botToken, + token = bot.qqBotToken(), server = bot.apiServer, - useResp = useResp + useResp = useResp, + appId = bot.ticket.appId ) } @@ -69,12 +69,12 @@ public suspend inline fun QQGuildApi<*>.requestTextBy( */ @JvmSynthetic public suspend inline fun QQGuildApi.requestDataBy(bot: Bot): R { - val botToken = bot.botToken() return requestData( client = bot.apiClient, - token = botToken, + token = bot.qqBotToken(), server = bot.apiServer, - decoder = bot.apiDecoder + decoder = bot.apiDecoder, + appId = bot.ticket.appId ) } @@ -99,6 +99,15 @@ public suspend fun Bot.requestText(api: QQGuildApi<*>): String = api.requestText public suspend fun Bot.requestData(api: QQGuildApi): R = api.requestDataBy(this) +@Suppress("DEPRECATION") @PublishedApi +@Deprecated("Use qqBotToken", ReplaceWith("qqBotToken()")) internal fun Bot.botToken(): String = if (this is BotImpl) botToken else "Bot ${ticket.appId}.${ticket.token}" + +/** + * see [鉴权方式](https://bot.q.qq.com/wiki/develop/api-v2/dev-prepare/interface-framework/api-use.html#%E8%8E%B7%E5%8F%96%E8%B0%83%E7%94%A8%E5%87%AD%E8%AF%81) + */ +@PublishedApi +internal fun Bot.qqBotToken(): String = + if (this is BotImpl) qqBotToken else "QQBot $accessToken" diff --git a/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/internal/BotImpl.kt b/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/internal/BotImpl.kt index 992ef669..0b1e1381 100644 --- a/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/internal/BotImpl.kt +++ b/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/internal/BotImpl.kt @@ -39,6 +39,9 @@ import love.forte.simbot.logger.Logger import love.forte.simbot.logger.LoggerFactory import love.forte.simbot.qguild.api.GatewayApis import love.forte.simbot.qguild.api.GatewayInfo +import love.forte.simbot.qguild.api.app.AppAccessToken +import love.forte.simbot.qguild.api.app.GetAppAccessTokenApi +import love.forte.simbot.qguild.api.requestData import love.forte.simbot.qguild.api.user.GetBotInfoApi import love.forte.simbot.qguild.event.Ready import love.forte.simbot.qguild.event.Shard @@ -48,6 +51,9 @@ import love.forte.simbot.qguild.stdlib.* import love.forte.simbot.qguild.stdlib.DisposableHandle import kotlin.concurrent.Volatile import kotlin.coroutines.CoroutineContext +import kotlin.math.max +import kotlin.time.Duration +import kotlin.time.Duration.Companion.seconds /** @@ -151,16 +157,36 @@ internal class BotImpl( } } + /** + * 下一次刷新token需要等待事件,最小1秒 + */ + private fun flushWaitingDuration(expireIn: Int): Duration = + max(1, (expireIn.toFloat() * 0.9f).toInt()).seconds + + /** + * `access_token`。 + * 在使用了 [start] 后会定期刷新,周期为上一个 access_token 有效期的 90%。 + * 比如如果有效期是 7200,那么下次刷新会在 7200*0.9=6480 秒后刷新。 + * + * 刷新此值的应当只有一个 Job,一般不会产生竞争的情况。 + */ + @Volatile + override var accessToken: String = "" + override val apiServer: Url = configuration.serverUrl + + @Deprecated("Use qqBotToken", replaceWith = ReplaceWith("qqBotToken")) internal val botToken = "Bot ${ticket.appId}.${ticket.token}" + + internal val qqBotToken + get() = "QQBot $accessToken" + override val shard: Shard = configuration.shard override val apiDecoder: Json = configuration.apiDecoder - internal val processorQueue: ConcurrentQueue = createConcurrentQueue() internal val preProcessorQueue: ConcurrentQueue = createConcurrentQueue() - override fun subscribe(sequence: SubscribeSequence, processor: EventProcessor): DisposableHandle { return when (sequence) { SubscribeSequence.PRE -> { @@ -221,15 +247,14 @@ internal class BotImpl( */ internal val startLock = Mutex() - // TODO atomic? lock update? -// private val stageLoopJob = atomicRef(null) - @Volatile private var stageLoopJob: Job? = null + @Volatile + private var flushAccessTokenJob: Job? = null + private val clientLock = Mutex() - // TODO With Lock @Volatile private var _client: ClientImpl? = null override val client: Bot.Client? get() = _client @@ -242,21 +267,31 @@ internal class BotImpl( } override suspend fun start() { - start(requestData(GatewayApis.Normal)) + start0 { requestData(GatewayApis.Normal) } } override suspend fun start(gateway: GatewayInfo) { + start0 { gateway } + } + + private suspend fun start0(gatewayFactory: suspend () -> GatewayInfo) { startLock.withLock { stageLoopJob?.cancel() stageLoopJob = null + if (flushAccessTokenJob == null) { + logger.debug("Initializing flush accessToken job") + flushAccessTokenJob = initFlushAccessTokenJob() + } + + val gateway = gatewayFactory() + logger.debug("Request gateway {} by shard {}", gateway, shard) val state = Connect(this, shard, gateway) logger.debug("Create state loop {}", state) - var st: State? = state do { logger.debug("Current state: {}", st) @@ -272,10 +307,60 @@ internal class BotImpl( st.loop() } + stageLoopJob.invokeOnCompletion { reason -> + reason?.also { + logger.debug("StageLoopJob is on completion: {}", it.message, it) + } + } + this.stageLoopJob = stageLoopJob } } + private suspend fun initFlushAccessTokenJob(): Job { + val api = GetAppAccessTokenApi.create(ticket.appId, ticket.secret) + + val initialToken = getNewAccessToken(api) + val firstToken = initialToken.accessToken + this.accessToken = firstToken + val initialDelay = flushWaitingDuration(initialToken.expiresIn) + + logger.debug( + "Initialized token: {}{}***{}{}, next delay: {}", + firstToken[0], + firstToken[1], + firstToken[firstToken.lastIndex - 1], + firstToken.last(), + initialDelay.toString() + ) + + return launch { + var delay = initialDelay + while (isActive) { + delay(delay) + val appToken = getNewAccessToken(api) + this@BotImpl.accessToken = appToken.accessToken + delay = this@BotImpl.flushWaitingDuration(appToken.expiresIn) + logger.debug( + "Flushed token: {}{}********{}{}, next delay: {}", + firstToken[0], + firstToken[1], + firstToken[firstToken.lastIndex - 1], + firstToken.last(), + delay.toString() + ) + } + } + } + + private suspend fun getNewAccessToken(api: GetAppAccessTokenApi): AppAccessToken = + api.requestData( + client = apiClient, + token = null, + server = null, + appId = null + ) + override fun cancel(reason: Throwable?) { if (!job.isActive) return diff --git a/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/internal/BotStates.kt b/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/internal/BotStates.kt index e4fc29c2..160aa73d 100644 --- a/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/internal/BotStates.kt +++ b/simbot-component-qq-guild-stdlib/src/commonMain/kotlin/love/forte/simbot/qguild/stdlib/internal/BotStates.kt @@ -22,13 +22,9 @@ import io.ktor.client.plugins.websocket.* import io.ktor.client.request.* import io.ktor.websocket.* import kotlinx.coroutines.* -import kotlinx.coroutines.channels.ClosedReceiveChannelException import kotlinx.coroutines.sync.withLock import kotlinx.serialization.SerializationException -import kotlinx.serialization.json.int -import kotlinx.serialization.json.jsonObject -import kotlinx.serialization.json.jsonPrimitive -import kotlinx.serialization.json.longOrNull +import kotlinx.serialization.json.* import love.forte.simbot.common.collection.ExperimentalSimbotCollectionApi import love.forte.simbot.logger.Logger import love.forte.simbot.logger.isDebugEnabled @@ -94,7 +90,7 @@ internal class Connect( val identify = Signal.Identify( Signal.Identify.Data( - token = bot.botToken, + token = bot.qqBotToken, intents = intents, shard = shard, properties = properties, @@ -121,7 +117,7 @@ internal class WaitingHello( while (session.isActive) { val frame = session.incoming.receive() as? Frame.Text ?: continue val text = frame.readText() - logger.debug("waiting hello : received frame {}", text) + logger.debug("Waiting hello : received frame {}", text) val json = bot.wsDecoder.parseToJsonElement(text) if (json.jsonObject["op"]?.jsonPrimitive?.int == Opcodes.Hello) { hello = bot.wsDecoder.decodeFromJsonElement(Signal.Hello.serializer(), json) @@ -155,15 +151,36 @@ internal class WaitingReadyEvent( ) : State() { override suspend fun invoke(): State { // 发送 identify - logger.debug("Send identify {}", identify) - session.send(bot.wsDecoder.encodeToString(Signal.Identify.serializer(), identify)) + val identifyJson = bot.wsDecoder.encodeToString(Signal.Identify.serializer(), identify) + logger.debug("Send identify {}, JSON: {}", identify, identifyJson) + session.send(identifyJson) + logger.debug("Send identify Successfully.") + +// HeartbeatJob( +// bot, hello, +// Ready.Data( +// "", +// "", +// User("", ""), +// Shard.FULL +// ), session +// ).invoke() + // 等待ready var ready: Ready? = null + logger.debug("Waiting for Signal ready...") while (session.isActive) { - val frame = session.incoming.receive() as? Frame.Text ?: continue + val frameResult = session.incoming.receiveCatching() + if (!frameResult.isSuccess) { + val reason = frameResult.exceptionOrNull() + val closeReason = session.closeReason.await() + throw IllegalStateException("Session closed: $closeReason", reason) + } + + val frame = frameResult.getOrThrow() as? Frame.Text ?: continue val text = frame.readText() - logger.debug("waiting ready event : received frame {}", text) + logger.debug("Waiting ready event : received frame {}", text) val json = bot.wsDecoder.parseToJsonElement(text) if (json.jsonObject["op"]?.jsonPrimitive?.int == Opcodes.Dispatch) { val dispatch = bot.wsDecoder.decodeFromJsonElement(Signal.Dispatch.serializer(), json) @@ -215,8 +232,6 @@ internal class HeartbeatJob( return if (r > heartbeatInterval) 0 else heartbeatInterval - r } -// val heartbeatSupervisorJob = SupervisorJob(session.coroutineContext[Job]!!) - // heartbeat Job return session.launch(CoroutineName("bot.${bot.ticket.appId}.heartbeat")) { val serializer = Signal.Heartbeat.serializer() @@ -230,7 +245,6 @@ internal class HeartbeatJob( session.send(bot.wsDecoder.encodeToString(serializer, hb)) } } - } } @@ -276,7 +290,7 @@ internal class ReceiveEvent( return Resume(bot, client) } - suspend fun onCatchErr(e: Throwable): State? { + suspend fun onCatchErr(e: Throwable?): State? { val reason = session.closeReason.await() if (reason == null) { logger.debug("Session closed and reason is null, try to resume", e) @@ -326,7 +340,9 @@ internal class ReceiveEvent( } bot.cancel(e) - session.cancel(e.message ?: e.toString(), e) + if (session.isActive) { + session.cancel(e?.message ?: e.toString(), e) + } bot.updateClient(null) } } @@ -336,14 +352,13 @@ internal class ReceiveEvent( } logger.trace("Receiving next frame ...") - val frame = try { - session.incoming.receive() - } catch (e: ClosedReceiveChannelException) { - return onCatchErr(e) - } catch (e: CancellationException) { - return onCatchErr(e) + val frameResult = session.incoming.receiveCatching() + if (!frameResult.isSuccess) { + return onCatchErr(frameResult.exceptionOrNull()) } + val frame = frameResult.getOrThrow() + try { logger.trace("Received next frame: {}", frame) val raw = (frame as? Frame.Text)?.readText() ?: run { @@ -363,7 +378,12 @@ internal class ReceiveEvent( val disSeq = runCatching { json.jsonObject["s"]?.jsonPrimitive?.longOrNull ?: seq.value }.getOrElse { seq.value } - Signal.Dispatch.Unknown(disSeq, json, raw).also { + // dispatch.id + val id = kotlin.runCatching { + json.jsonObject["id"]?.jsonPrimitive?.contentOrNull + }.getOrNull() + + Signal.Dispatch.Unknown(id, disSeq, json, raw).also { val t = kotlin.runCatching { json.jsonObject[Signal.Dispatch.DISPATCH_CLASS_DISCRIMINATOR]?.jsonPrimitive?.content } .getOrNull() @@ -481,7 +501,7 @@ internal class Resume( bot.wsClient.ws { gateway }.apply { // 发送 Opcode6 val resumeSignal = - Signal.Resume(Signal.Resume.Data(bot.botToken, client.readyData.sessionId, client.seq)) + Signal.Resume(Signal.Resume.Data(bot.qqBotToken, client.readyData.sessionId, client.seq)) send(bot.wsDecoder.encodeToString(Signal.Resume.serializer(), resumeSignal)) } }