Compare commits

...

28 Commits

Author SHA1 Message Date
e5788822ed feat: add retry configuration and optimization running lifecycle 2025-03-26 19:12:56 +08:00
d9d3bb2a5b fix: change help command format 2025-02-04 14:18:03 +08:00
6eea40e134 docs: change the wrong version number 2025-02-04 14:05:31 +08:00
d2cb0728cd docs: change the wrong version number 2025-02-04 14:05:15 +08:00
c6c119da39 fix: fix cannot use escape char to be the command prefix 2025-02-04 14:01:07 +08:00
2bdb11622f ci: change version 2025-02-04 13:53:31 +08:00
3e1b71c149 feat: add changeable command prefix 2025-02-04 13:50:52 +08:00
9b9b55ed85 ci: change version to 1.6 release 2025-02-01 04:26:58 +08:00
8b729519b0 fix: fix json message part cannot be serialized correctly 2025-02-01 04:26:03 +08:00
57177510d5 feat: add some type 2024-12-20 11:31:12 +08:00
ad2d5a085e fix: change default max packet size to 6553600 2024-11-09 21:15:19 +08:00
wzp
94937e990e fix: fix cn.wzpmc.plugins.JavaPlugin::saveDefaultConfig method overwrite the configuration file bug 2024-10-23 10:45:51 +08:00
wzp
6526af0437 fix: fix cn.wzpmc.plugins.JavaPlugin::saveDefaultConfig method overwrite the configuration file bug 2024-10-23 10:44:02 +08:00
wzp
dc1f35ca0d docs: adding document 2024-10-23 10:42:57 +08:00
wzp
bc57932783 ci: change version to 1.0.5 2024-10-10 10:47:24 +08:00
wzp
4c5fc7a673 feat: adding configuration loader 2024-10-10 09:40:45 +08:00
wzp
a8c46c6ef7 deps: change snakeyaml to api 2024-10-10 09:29:10 +08:00
wzp
f8cbc50a6a feat: adding essence event
fix: Fixed the BUG of automatically agreeing to add group applications
2024-10-10 08:53:42 +08:00
wzp
eb44c6bab4 ci: change the ways to include dependencies in the module of api 2024-09-08 14:10:44 +08:00
wzp
61d3a8280e docs: fix using the releases repository cannot build bug (using public group repository) 2024-09-02 20:00:41 +08:00
wzp
e833337f75 docs: fix cannot build's javadoc 2024-09-01 00:49:14 +08:00
wzp
c1a38f0103 feat: adding auto configuration update 2024-09-01 00:48:09 +08:00
wzp
fba3d1eab6 pref: remove unused code 2024-09-01 00:16:12 +08:00
wzp
b5605c6a0f feat: adding auto group add and auto friend add
feat: adding new config
fix: fix send command cannot send cq code bug
fix: fix cannot at all bug
2024-09-01 00:15:37 +08:00
wzp
448167d021 feat: adding list command and send command
fix: fix NotifySubType Error
2024-08-30 00:33:09 +08:00
wzp
ad89fc4d1f fix: fix wrong return data type 2024-08-27 15:14:49 +08:00
wzp
1abdcbb691 docs: fix syntax in readme, change my-bot module to mybot-api module 2024-08-26 21:07:44 +08:00
wzp
62b001b131 pref: Split project into two modules(main, api) 2024-08-26 21:05:35 +08:00
275 changed files with 32988 additions and 1445 deletions

6
.idea/ApifoxUploaderProjectSetting.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ApifoxUploaderProjectSetting">
<option name="apiAccessToken" value="APS-QWelq6AktQqByilNWeWZgKoPT7a4ml1d" />
</component>
</project>

1
.idea/compiler.xml generated
View File

@ -8,6 +8,7 @@
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.34/ec547ef414ab1d2c040118fb9c1c265ada63af14/lombok-1.18.34.jar" /> <entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.34/ec547ef414ab1d2c040118fb9c1c265ada63af14/lombok-1.18.34.jar" />
</processorPath> </processorPath>
<module name="MyBot.main" /> <module name="MyBot.main" />
<module name="MyBot.mybot-api.main" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel target="11" /> <bytecodeTargetLevel target="11" />

View File

@ -1 +1 @@
1.0.2 1.0.7

4
.idea/gradle.xml generated
View File

@ -4,11 +4,13 @@
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="" /> <option name="gradleHome" value="$USER_HOME$/.sdkman/candidates/gradle/current" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/mybot-api" />
</set> </set>
</option> </option>
</GradleProjectSettings> </GradleProjectSettings>

View File

@ -21,5 +21,25 @@
<option name="name" value="maven" /> <option name="name" value="maven" />
<option name="url" value="https://libraries.minecraft.net" /> <option name="url" value="https://libraries.minecraft.net" />
</remote-repository> </remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://maven.aliyun.com/repository/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
<option name="url" value="https://maven.aliyun.com/repository/central" />
</remote-repository>
<remote-repository>
<option name="id" value="maven3" />
<option name="name" value="maven3" />
<option name="url" value="https://maven.aliyun.com/repository/gradle-plugin" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenLocal" />
<option name="name" value="MavenLocal" />
<option name="url" value="file:/$MAVEN_REPOSITORY$" />
</remote-repository>
</component> </component>
</project> </project>

5
.idea/misc.xml generated
View File

@ -5,9 +5,10 @@
<groovy codeStyle="LEGACY" /> <groovy codeStyle="LEGACY" />
</component> </component>
<component name="EntryPointsManager"> <component name="EntryPointsManager">
<list size="2"> <list size="3">
<item index="0" class="java.lang.String" itemvalue="cn.wzpmc.api.plugins.event.EventHandler" /> <item index="0" class="java.lang.String" itemvalue="cn.wzpmc.api.plugins.event.EventHandler" />
<item index="1" class="java.lang.String" itemvalue="com.alibaba.fastjson2.annotation.JSONField" /> <item index="1" class="java.lang.String" itemvalue="cn.wzpmc.plugins.event.EventHandler" />
<item index="2" class="java.lang.String" itemvalue="com.alibaba.fastjson2.annotation.JSONField" />
</list> </list>
</component> </component>
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />

1
.idea/modules.xml generated
View File

@ -3,6 +3,7 @@
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/MyBot.main.iml" filepath="$PROJECT_DIR$/.idea/modules/MyBot.main.iml" /> <module fileurl="file://$PROJECT_DIR$/.idea/modules/MyBot.main.iml" filepath="$PROJECT_DIR$/.idea/modules/MyBot.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/mybot-api/MyBot.mybot-api.main.iml" filepath="$PROJECT_DIR$/.idea/modules/mybot-api/MyBot.mybot-api.main.iml" />
</modules> </modules>
</component> </component>
</project> </project>

8
.idea/modules/MyBot.iml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="AdditionalModuleElements">
<content url="file://$MODULE_DIR$/../.." dumb="true">
<excludeFolder url="file://$MODULE_DIR$/../../run" />
</content>
</component>
</module>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="AdditionalModuleElements">
<content url="file://$MODULE_DIR$/../../../mybot-api/build/generated/sources/annotationProcessor/java/main">
<sourceFolder url="file://$MODULE_DIR$/../../../mybot-api/build/generated/sources/annotationProcessor/java/main" isTestSource="false" generated="true" />
</content>
</component>
</module>

View File

@ -11,7 +11,7 @@
2. 任意 OneBot11 协议框架的实现 2. 任意 OneBot11 协议框架的实现
### 使用步骤 ### 使用步骤
1. 前往 [Github Release](https://github.com/Wzp-2008/MyBot/releases/latest) 或 [Gitea Release](https://wzpmc.cn:3000/wzp/MyBot/releases/latest) 下载最新版本的 JAR 包。 1. 前往 [GitHub Release](https://github.com/Wzp-2008/MyBot/releases/latest) 或 [Gitea Release](https://wzpmc.cn:3000/wzp/MyBot/releases/latest) 下载最新版本的 JAR 包。
2. 将下载的 JAR 包放入一个空文件夹中。 2. 将下载的 JAR 包放入一个空文件夹中。
3. 启动你的 OneBot 实例。 3. 启动你的 OneBot 实例。
4. 通过以下命令启动 MyBot 服务端: 4. 通过以下命令启动 MyBot 服务端:
@ -39,7 +39,7 @@
<repositories> <repositories>
<repository> <repository>
<id>wzpmc-maven-releases</id> <id>wzpmc-maven-releases</id>
<url>https://wzpmc.cn:90/repository/maven-releases</url> <url>https://wzpmc.cn:90/repository/maven-public</url>
</repository> </repository>
</repositories> </repositories>
``` ```
@ -50,7 +50,7 @@
```groovy ```groovy
repositories { repositories {
maven { maven {
url "https://wzpmc.cn:90/repository/maven-releases" url "https://wzpmc.cn:90/repository/maven-public"
} }
} }
``` ```
@ -59,7 +59,7 @@ repositories {
```kotlin ```kotlin
repositories { repositories {
maven { maven {
url = uri("https://wzpmc.cn:90/repository/maven-releases") url = uri("https://wzpmc.cn:90/repository/maven-public")
} }
} }
``` ```
@ -71,7 +71,7 @@ repositories {
```xml ```xml
<dependency> <dependency>
<groupId>cn.wzpmc</groupId> <groupId>cn.wzpmc</groupId>
<artifactId>my-bot</artifactId> <artifactId>mybot-api</artifactId>
<version>[LATEST-VERSION]</version> <version>[LATEST-VERSION]</version>
</dependency> </dependency>
``` ```
@ -80,16 +80,16 @@ repositories {
##### Groovy DSL ##### Groovy DSL
```groovy ```groovy
implementation 'cn.wzpmc:my-bot:[LATEST-VERSION]' implementation 'cn.wzpmc:mybot-api:[LATEST-VERSION]'
``` ```
##### Kotlin DSL ##### Kotlin DSL
```kotlin ```kotlin
implementation("cn.wzpmc:my-bot:[LATEST-VERSION]") implementation("cn.wzpmc:mybot-api:[LATEST-VERSION]")
``` ```
--- ---
如此设置之后,您将轻松地将 MyBot 集成到您的项目中,并快速构建与 OneBot11 兼容的机器人应用。Enjoy~ 如此设置之后,您将轻松地将 MyBot-API 集成到您的项目中,并快速构建与 OneBot11 兼容的机器人应用。Enjoy~
--- ---

View File

@ -11,7 +11,7 @@
2. Implementation of any OneBot11 protocol framework 2. Implementation of any OneBot11 protocol framework
### Steps to Use ### Steps to Use
1. Go to [Github Release](https://github.com/Wzp-2008/MyBot/releases/latest) or [Gitea Release](https://wzpmc.cn:3000/wzp/MyBot/releases/latest) to download the latest version of the JAR package. 1. Go to [GitHub Release](https://github.com/Wzp-2008/MyBot/releases/latest) or [Gitea Release](https://wzpmc.cn:3000/wzp/MyBot/releases/latest) to download the latest version of the JAR package.
2. Place the downloaded JAR package in an empty folder. 2. Place the downloaded JAR package in an empty folder.
3. Start your OneBot instance. 3. Start your OneBot instance.
4. Start the MyBot server using the following command: 4. Start the MyBot server using the following command:
@ -39,7 +39,7 @@ In your `pom.xml`, add the following repository configuration:
<repositories> <repositories>
<repository> <repository>
<id>wzpmc-maven-releases</id> <id>wzpmc-maven-releases</id>
<url>https://wzpmc.cn:90/repository/maven-releases</url> <url>https://wzpmc.cn:90/repository/maven-public</url>
</repository> </repository>
</repositories> </repositories>
``` ```
@ -50,7 +50,7 @@ In your `pom.xml`, add the following repository configuration:
```groovy ```groovy
repositories { repositories {
maven { maven {
url "https://wzpmc.cn:90/repository/maven-releases" url "https://wzpmc.cn:90/repository/maven-public"
} }
} }
``` ```
@ -59,7 +59,7 @@ repositories {
```kotlin ```kotlin
repositories { repositories {
maven { maven {
url = uri("https://wzpmc.cn:90/repository/maven-releases") url = uri("https://wzpmc.cn:90/repository/maven-public")
} }
} }
``` ```
@ -71,7 +71,7 @@ In your `pom.xml`, add the following dependency:
```xml ```xml
<dependency> <dependency>
<groupId>cn.wzpmc</groupId> <groupId>cn.wzpmc</groupId>
<artifactId>my-bot</artifactId> <artifactId>mybot-api</artifactId>
<version>[LATEST-VERSION]</version> <version>[LATEST-VERSION]</version>
</dependency> </dependency>
``` ```
@ -80,16 +80,16 @@ In your `pom.xml`, add the following dependency:
##### Groovy DSL ##### Groovy DSL
```groovy ```groovy
implementation 'cn.wzpmc:my-bot:[LATEST-VERSION]' implementation 'cn.wzpmc:mybot-api:[LATEST-VERSION]'
``` ```
##### Kotlin DSL ##### Kotlin DSL
```kotlin ```kotlin
implementation("cn.wzpmc:my-bot:[LATEST-VERSION]") implementation("cn.wzpmc:mybot-api:[LATEST-VERSION]")
``` ```
--- ---
With these settings, you'll be able to seamlessly integrate MyBot into your project and quickly build OneBot11-compatible bot applications. Enjoy! With these settings, you'll be able to seamlessly integrate MyBot-API into your project and quickly build OneBot11-compatible bot applications. Enjoy!
--- ---

View File

@ -2,41 +2,59 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
val projectName = rootProject.name val projectName = rootProject.name
val groupName by extra("cn.wzpmc") val groupName: String by extra
val projectArtifactId by extra("my-bot") val projectArtifactId: String by extra
val projectVersion by extra("1.0.1") val projectVersion: String by extra
plugins { plugins {
id("java") id("java-library")
id("maven-publish")
id("com.github.johnrengelman.shadow") version "8.1.1" id("com.github.johnrengelman.shadow") version "8.1.1"
} }
allprojects {
apply(plugin = "java-library")
val groupName by extra("cn.wzpmc")
val projectArtifactId by extra("my-bot")
val projectVersion by extra("1.0.7-SNAPSHOT")
repositories {
mavenCentral()
maven("https://libraries.minecraft.net")
}
dependencies {
// https://mvnrepository.com/artifact/org.projectlombok/lombok
compileOnly("org.projectlombok:lombok:1.18.34")
annotationProcessor("org.projectlombok:lombok:1.18.34")
// https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2
api("com.alibaba.fastjson2:fastjson2:2.0.52")
api("com.mojang:brigadier:1.0.18")
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api
api("org.apache.logging.log4j:log4j-api:2.23.1")
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
// https://mvnrepository.com/artifact/org.yaml/snakeyaml
api("org.yaml:snakeyaml:2.2")
}
tasks.compileJava {
options.encoding = "UTF-8"
}
tasks.javadoc {
options.encoding = "UTF-8"
}
}
group = groupName group = groupName
version = projectVersion version = projectVersion
repositories {
mavenCentral()
maven("https://libraries.minecraft.net")
}
dependencies { dependencies {
implementation(project(":mybot-api"))
implementation("net.minecrell:terminalconsoleappender:1.3.0") { implementation("net.minecrell:terminalconsoleappender:1.3.0") {
exclude(group = "org.apache.logging.log4j", module = "log4j-core") exclude(group = "org.apache.logging.log4j", module = "log4j-core")
exclude(group = "org.apache.logging.log4j", module = "log4j-api") exclude(group = "org.apache.logging.log4j", module = "log4j-api")
} }
implementation("com.mojang:brigadier:1.0.18")
// https://mvnrepository.com/artifact/io.netty/netty-all
implementation("io.netty:netty-all:4.1.112.Final")
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core // https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core
implementation("org.apache.logging.log4j:log4j-core:2.23.1") implementation("org.apache.logging.log4j:log4j-core:2.23.1")
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api
implementation("org.apache.logging.log4j:log4j-api:2.23.1")
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-jul // https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-jul
implementation("org.apache.logging.log4j:log4j-jul:2.23.1") implementation("org.apache.logging.log4j:log4j-jul:2.23.1")
// https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2 // https://mvnrepository.com/artifact/io.netty/netty-all
implementation("com.alibaba.fastjson2:fastjson2:2.0.52") implementation("io.netty:netty-all:4.1.112.Final")
// https://mvnrepository.com/artifact/org.yaml/snakeyaml
implementation("org.yaml:snakeyaml:2.2")
// https://mvnrepository.com/artifact/org.jline/jline // https://mvnrepository.com/artifact/org.jline/jline
implementation("org.jline:jline-terminal:3.26.3") implementation("org.jline:jline-terminal:3.26.3")
implementation("org.jline:jline-reader:3.26.3") implementation("org.jline:jline-reader:3.26.3")
@ -46,22 +64,6 @@ dependencies {
implementation("org.jline:jline-terminal-jansi:3.26.3") implementation("org.jline:jline-terminal-jansi:3.26.3")
// https://mvnrepository.com/artifact/org.fusesource.jansi/jansi // https://mvnrepository.com/artifact/org.fusesource.jansi/jansi
implementation("org.fusesource.jansi:jansi:2.4.1") implementation("org.fusesource.jansi:jansi:2.4.1")
/*// https://mvnrepository.com/artifact/org.jline/jline-terminal-jna
implementation("org.jline:jline-terminal-jna:3.26.3")
// https://mvnrepository.com/artifact/net.java.dev.jna/jna
implementation("net.java.dev.jna:jna:5.14.0")*/
// https://mvnrepository.com/artifact/org.projectlombok/lombok
compileOnly("org.projectlombok:lombok:1.18.34")
annotationProcessor("org.projectlombok:lombok:1.18.34")
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
tasks.compileJava {
options.encoding = "UTF-8"
}
tasks.javadoc {
options.encoding = "UTF-8"
} }
tasks.register<Jar>("javadocJar") { tasks.register<Jar>("javadocJar") {
archiveClassifier.set("javadoc") archiveClassifier.set("javadoc")
@ -86,57 +88,6 @@ tasks.withType<ShadowJar> {
tasks.named("build") { tasks.named("build") {
dependsOn(tasks.named("shadowJar")) dependsOn(tasks.named("shadowJar"))
} }
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
groupId = groupName
artifactId = projectArtifactId
version = projectVersion
artifact(tasks.named("javadocJar"))
artifact(tasks.named("sourcesJar"))
pom {
name.set(projectName)
description.set("A Java-based OneBot11-compatible robot framework")
licenses {
license {
name.set("The MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("wzp")
name.set("wzp")
email.set("minecraftwzpmc@gmail.com")
}
}
scm {
connection.set("scm:git:https://wzpmc.cn:3000/wzp/MyBot.git")
developerConnection.set("scm:git:https://wzpmc.cn:3000/wzp/MyBot.git")
url.set("https://wzpmc.cn:3000/wzp/MyBot")
}
}
}
}
repositories {
maven {
val releasesRepoUrl = uri("https://wzpmc.cn:90/repository/maven-releases")
val snapshotsRepoUrl = uri("https://wzpmc.cn:90/repository/maven-snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = project.findProperty("repo.user") as String? ?: ""
password = project.findProperty("repo.password") as String? ?: ""
}
}
}
}
tasks.test { tasks.test {
useJUnitPlatform() useJUnitPlatform()
} }

2
docs/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.idea/
node_modules/

5
docs/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,5 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

12
docs/.idea/docs.iml generated Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
docs/.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/docs.iml" filepath="$PROJECT_DIR$/.idea/docs.iml" />
</modules>
</component>
</project>

6
docs/.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

1
docs/.vitepress/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
cache/

View File

@ -0,0 +1,269 @@
import {
useMediaQuery
} from "./chunk-WVCZVGU2.js";
import {
computed,
ref,
shallowRef,
watch
} from "./chunk-XIDTNVOX.js";
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/index.js
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/fonts.css";
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/without-fonts.js
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/vars.css";
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/base.css";
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/icons.css";
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/utils.css";
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/components/custom-block.css";
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code.css";
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code-group.css";
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/components/vp-doc.css";
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/components/vp-sponsor.css";
import VPBadge from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue";
import Layout from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/Layout.vue";
import { default as default2 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue";
import { default as default3 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPImage.vue";
import { default as default4 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPButton.vue";
import { default as default5 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPHomeContent.vue";
import { default as default6 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPHomeHero.vue";
import { default as default7 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPHomeFeatures.vue";
import { default as default8 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPHomeSponsors.vue";
import { default as default9 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPLink.vue";
import { default as default10 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPDocAsideSponsors.vue";
import { default as default11 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPSocialLink.vue";
import { default as default12 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPSocialLinks.vue";
import { default as default13 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPSponsors.vue";
import { default as default14 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPTeamPage.vue";
import { default as default15 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageTitle.vue";
import { default as default16 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageSection.vue";
import { default as default17 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPTeamMembers.vue";
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/support/utils.js
import { withBase } from "vitepress";
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/composables/data.js
import { useData as useData$ } from "vitepress";
var useData = useData$;
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/support/utils.js
function ensureStartingSlash(path) {
return /^\//.test(path) ? path : `/${path}`;
}
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/support/sidebar.js
function getSidebar(_sidebar, path) {
if (Array.isArray(_sidebar))
return addBase(_sidebar);
if (_sidebar == null)
return [];
path = ensureStartingSlash(path);
const dir = Object.keys(_sidebar).sort((a, b) => {
return b.split("/").length - a.split("/").length;
}).find((dir2) => {
return path.startsWith(ensureStartingSlash(dir2));
});
const sidebar = dir ? _sidebar[dir] : [];
return Array.isArray(sidebar) ? addBase(sidebar) : addBase(sidebar.items, sidebar.base);
}
function getSidebarGroups(sidebar) {
const groups = [];
let lastGroupIndex = 0;
for (const index in sidebar) {
const item = sidebar[index];
if (item.items) {
lastGroupIndex = groups.push(item);
continue;
}
if (!groups[lastGroupIndex]) {
groups.push({ items: [] });
}
groups[lastGroupIndex].items.push(item);
}
return groups;
}
function addBase(items, _base) {
return [...items].map((_item) => {
const item = { ..._item };
const base = item.base || _base;
if (base && item.link)
item.link = base + item.link;
if (item.items)
item.items = addBase(item.items, base);
return item;
});
}
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/composables/sidebar.js
function useSidebar() {
const { frontmatter, page, theme: theme2 } = useData();
const is960 = useMediaQuery("(min-width: 960px)");
const isOpen = ref(false);
const _sidebar = computed(() => {
const sidebarConfig = theme2.value.sidebar;
const relativePath = page.value.relativePath;
return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : [];
});
const sidebar = ref(_sidebar.value);
watch(_sidebar, (next, prev) => {
if (JSON.stringify(next) !== JSON.stringify(prev))
sidebar.value = _sidebar.value;
});
const hasSidebar = computed(() => {
return frontmatter.value.sidebar !== false && sidebar.value.length > 0 && frontmatter.value.layout !== "home";
});
const leftAside = computed(() => {
if (hasAside)
return frontmatter.value.aside == null ? theme2.value.aside === "left" : frontmatter.value.aside === "left";
return false;
});
const hasAside = computed(() => {
if (frontmatter.value.layout === "home")
return false;
if (frontmatter.value.aside != null)
return !!frontmatter.value.aside;
return theme2.value.aside !== false;
});
const isSidebarEnabled = computed(() => hasSidebar.value && is960.value);
const sidebarGroups = computed(() => {
return hasSidebar.value ? getSidebarGroups(sidebar.value) : [];
});
function open() {
isOpen.value = true;
}
function close() {
isOpen.value = false;
}
function toggle() {
isOpen.value ? close() : open();
}
return {
isOpen,
sidebar,
sidebarGroups,
hasSidebar,
hasAside,
leftAside,
isSidebarEnabled,
open,
close,
toggle
};
}
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/composables/local-nav.js
import { onContentUpdated } from "vitepress";
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/composables/outline.js
import { getScrollOffset } from "vitepress";
var resolvedHeaders = [];
function getHeaders(range) {
const headers = [
...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")
].filter((el) => el.id && el.hasChildNodes()).map((el) => {
const level = Number(el.tagName[1]);
return {
element: el,
title: serializeHeader(el),
link: "#" + el.id,
level
};
});
return resolveHeaders(headers, range);
}
function serializeHeader(h) {
let ret = "";
for (const node of h.childNodes) {
if (node.nodeType === 1) {
if (node.classList.contains("VPBadge") || node.classList.contains("header-anchor") || node.classList.contains("ignore-header")) {
continue;
}
ret += node.textContent;
} else if (node.nodeType === 3) {
ret += node.textContent;
}
}
return ret.trim();
}
function resolveHeaders(headers, range) {
if (range === false) {
return [];
}
const levelsRange = (typeof range === "object" && !Array.isArray(range) ? range.level : range) || 2;
const [high, low] = typeof levelsRange === "number" ? [levelsRange, levelsRange] : levelsRange === "deep" ? [2, 6] : levelsRange;
return buildTree(headers, high, low);
}
function buildTree(data, min, max) {
resolvedHeaders.length = 0;
const result = [];
const stack = [];
data.forEach((item) => {
const node = { ...item, children: [] };
let parent = stack[stack.length - 1];
while (parent && parent.level >= node.level) {
stack.pop();
parent = stack[stack.length - 1];
}
if (node.element.classList.contains("ignore-header") || parent && "shouldIgnore" in parent) {
stack.push({ level: node.level, shouldIgnore: true });
return;
}
if (node.level > max || node.level < min)
return;
resolvedHeaders.push({ element: node.element, link: node.link });
if (parent)
parent.children.push(node);
else
result.push(node);
stack.push(node);
});
return result;
}
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/composables/local-nav.js
function useLocalNav() {
const { theme: theme2, frontmatter } = useData();
const headers = shallowRef([]);
const hasLocalNav = computed(() => {
return headers.value.length > 0;
});
onContentUpdated(() => {
headers.value = getHeaders(frontmatter.value.outline ?? theme2.value.outline);
});
return {
headers,
hasLocalNav
};
}
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/without-fonts.js
var theme = {
Layout,
enhanceApp: ({ app }) => {
app.component("Badge", VPBadge);
}
};
var without_fonts_default = theme;
export {
default2 as VPBadge,
default4 as VPButton,
default10 as VPDocAsideSponsors,
default5 as VPHomeContent,
default7 as VPHomeFeatures,
default6 as VPHomeHero,
default8 as VPHomeSponsors,
default3 as VPImage,
default9 as VPLink,
default11 as VPSocialLink,
default12 as VPSocialLinks,
default13 as VPSponsors,
default17 as VPTeamMembers,
default14 as VPTeamPage,
default16 as VPTeamPageSection,
default15 as VPTeamPageTitle,
without_fonts_default as default,
useLocalNav,
useSidebar
};
//# sourceMappingURL=@theme_index.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,40 @@
{
"hash": "30a63267",
"configHash": "2c9c0d33",
"lockfileHash": "de33837a",
"browserHash": "7755b019",
"optimized": {
"vue": {
"src": "../../../node_modules/.pnpm/vue@3.5.11/node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "f71e9ed4",
"needsInterop": false
},
"vitepress > @vue/devtools-api": {
"src": "../../../node_modules/.pnpm/@vue+devtools-api@7.4.6/node_modules/@vue/devtools-api/dist/index.js",
"file": "vitepress___@vue_devtools-api.js",
"fileHash": "e96d8db2",
"needsInterop": false
},
"vitepress > @vueuse/core": {
"src": "../../../node_modules/.pnpm/@vueuse+core@11.1.0_vue@3.5.11/node_modules/@vueuse/core/index.mjs",
"file": "vitepress___@vueuse_core.js",
"fileHash": "692684da",
"needsInterop": false
},
"@theme/index": {
"src": "../../../node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/index.js",
"file": "@theme_index.js",
"fileHash": "9599b31e",
"needsInterop": false
}
},
"chunks": {
"chunk-WVCZVGU2": {
"file": "chunk-WVCZVGU2.js"
},
"chunk-XIDTNVOX": {
"file": "chunk-XIDTNVOX.js"
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
{
"type": "module"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,567 @@
import {
DefaultMagicKeysAliasMap,
StorageSerializers,
TransitionPresets,
assert,
breakpointsAntDesign,
breakpointsBootstrapV5,
breakpointsMasterCss,
breakpointsPrimeFlex,
breakpointsQuasar,
breakpointsSematic,
breakpointsTailwind,
breakpointsVuetify,
breakpointsVuetifyV2,
breakpointsVuetifyV3,
bypassFilter,
camelize,
clamp,
cloneFnJSON,
computedAsync,
computedEager,
computedInject,
computedWithControl,
containsProp,
controlledRef,
createEventHook,
createFetch,
createFilterWrapper,
createGlobalState,
createInjectionState,
createReusableTemplate,
createSharedComposable,
createSingletonPromise,
createTemplatePromise,
createUnrefFn,
customStorageEventName,
debounceFilter,
defaultDocument,
defaultLocation,
defaultNavigator,
defaultWindow,
directiveHooks,
executeTransition,
extendRef,
formatDate,
formatTimeAgo,
get,
getLifeCycleTarget,
getSSRHandler,
hasOwn,
hyphenate,
identity,
increaseWithUnit,
injectLocal,
invoke,
isClient,
isDef,
isDefined,
isIOS,
isObject,
isWorker,
makeDestructurable,
mapGamepadToXbox360Controller,
noop,
normalizeDate,
notNullish,
now,
objectEntries,
objectOmit,
objectPick,
onClickOutside,
onKeyDown,
onKeyPressed,
onKeyStroke,
onKeyUp,
onLongPress,
onStartTyping,
pausableFilter,
promiseTimeout,
provideLocal,
rand,
reactify,
reactifyObject,
reactiveComputed,
reactiveOmit,
reactivePick,
refAutoReset,
refDebounced,
refDefault,
refThrottled,
refWithControl,
resolveRef,
resolveUnref,
set,
setSSRHandler,
syncRef,
syncRefs,
templateRef,
throttleFilter,
timestamp,
toReactive,
toRef,
toRefs,
toValue,
tryOnBeforeMount,
tryOnBeforeUnmount,
tryOnMounted,
tryOnScopeDispose,
tryOnUnmounted,
unrefElement,
until,
useActiveElement,
useAnimate,
useArrayDifference,
useArrayEvery,
useArrayFilter,
useArrayFind,
useArrayFindIndex,
useArrayFindLast,
useArrayIncludes,
useArrayJoin,
useArrayMap,
useArrayReduce,
useArraySome,
useArrayUnique,
useAsyncQueue,
useAsyncState,
useBase64,
useBattery,
useBluetooth,
useBreakpoints,
useBroadcastChannel,
useBrowserLocation,
useCached,
useClipboard,
useClipboardItems,
useCloned,
useColorMode,
useConfirmDialog,
useCounter,
useCssVar,
useCurrentElement,
useCycleList,
useDark,
useDateFormat,
useDebounceFn,
useDebouncedRefHistory,
useDeviceMotion,
useDeviceOrientation,
useDevicePixelRatio,
useDevicesList,
useDisplayMedia,
useDocumentVisibility,
useDraggable,
useDropZone,
useElementBounding,
useElementByPoint,
useElementHover,
useElementSize,
useElementVisibility,
useEventBus,
useEventListener,
useEventSource,
useEyeDropper,
useFavicon,
useFetch,
useFileDialog,
useFileSystemAccess,
useFocus,
useFocusWithin,
useFps,
useFullscreen,
useGamepad,
useGeolocation,
useIdle,
useImage,
useInfiniteScroll,
useIntersectionObserver,
useInterval,
useIntervalFn,
useKeyModifier,
useLastChanged,
useLocalStorage,
useMagicKeys,
useManualRefHistory,
useMediaControls,
useMediaQuery,
useMemoize,
useMemory,
useMounted,
useMouse,
useMouseInElement,
useMousePressed,
useMutationObserver,
useNavigatorLanguage,
useNetwork,
useNow,
useObjectUrl,
useOffsetPagination,
useOnline,
usePageLeave,
useParallax,
useParentElement,
usePerformanceObserver,
usePermission,
usePointer,
usePointerLock,
usePointerSwipe,
usePreferredColorScheme,
usePreferredContrast,
usePreferredDark,
usePreferredLanguages,
usePreferredReducedMotion,
usePrevious,
useRafFn,
useRefHistory,
useResizeObserver,
useScreenOrientation,
useScreenSafeArea,
useScriptTag,
useScroll,
useScrollLock,
useSessionStorage,
useShare,
useSorted,
useSpeechRecognition,
useSpeechSynthesis,
useStepper,
useStorage,
useStorageAsync,
useStyleTag,
useSupported,
useSwipe,
useTemplateRefsList,
useTextDirection,
useTextSelection,
useTextareaAutosize,
useThrottleFn,
useThrottledRefHistory,
useTimeAgo,
useTimeout,
useTimeoutFn,
useTimeoutPoll,
useTimestamp,
useTitle,
useToNumber,
useToString,
useToggle,
useTransition,
useUrlSearchParams,
useUserMedia,
useVModel,
useVModels,
useVibrate,
useVirtualList,
useWakeLock,
useWebNotification,
useWebSocket,
useWebWorker,
useWebWorkerFn,
useWindowFocus,
useWindowScroll,
useWindowSize,
watchArray,
watchAtMost,
watchDebounced,
watchDeep,
watchIgnorable,
watchImmediate,
watchOnce,
watchPausable,
watchThrottled,
watchTriggerable,
watchWithFilter,
whenever
} from "./chunk-WVCZVGU2.js";
import "./chunk-XIDTNVOX.js";
export {
DefaultMagicKeysAliasMap,
StorageSerializers,
TransitionPresets,
assert,
computedAsync as asyncComputed,
refAutoReset as autoResetRef,
breakpointsAntDesign,
breakpointsBootstrapV5,
breakpointsMasterCss,
breakpointsPrimeFlex,
breakpointsQuasar,
breakpointsSematic,
breakpointsTailwind,
breakpointsVuetify,
breakpointsVuetifyV2,
breakpointsVuetifyV3,
bypassFilter,
camelize,
clamp,
cloneFnJSON,
computedAsync,
computedEager,
computedInject,
computedWithControl,
containsProp,
computedWithControl as controlledComputed,
controlledRef,
createEventHook,
createFetch,
createFilterWrapper,
createGlobalState,
createInjectionState,
reactify as createReactiveFn,
createReusableTemplate,
createSharedComposable,
createSingletonPromise,
createTemplatePromise,
createUnrefFn,
customStorageEventName,
debounceFilter,
refDebounced as debouncedRef,
watchDebounced as debouncedWatch,
defaultDocument,
defaultLocation,
defaultNavigator,
defaultWindow,
directiveHooks,
computedEager as eagerComputed,
executeTransition,
extendRef,
formatDate,
formatTimeAgo,
get,
getLifeCycleTarget,
getSSRHandler,
hasOwn,
hyphenate,
identity,
watchIgnorable as ignorableWatch,
increaseWithUnit,
injectLocal,
invoke,
isClient,
isDef,
isDefined,
isIOS,
isObject,
isWorker,
makeDestructurable,
mapGamepadToXbox360Controller,
noop,
normalizeDate,
notNullish,
now,
objectEntries,
objectOmit,
objectPick,
onClickOutside,
onKeyDown,
onKeyPressed,
onKeyStroke,
onKeyUp,
onLongPress,
onStartTyping,
pausableFilter,
watchPausable as pausableWatch,
promiseTimeout,
provideLocal,
rand,
reactify,
reactifyObject,
reactiveComputed,
reactiveOmit,
reactivePick,
refAutoReset,
refDebounced,
refDefault,
refThrottled,
refWithControl,
resolveRef,
resolveUnref,
set,
setSSRHandler,
syncRef,
syncRefs,
templateRef,
throttleFilter,
refThrottled as throttledRef,
watchThrottled as throttledWatch,
timestamp,
toReactive,
toRef,
toRefs,
toValue,
tryOnBeforeMount,
tryOnBeforeUnmount,
tryOnMounted,
tryOnScopeDispose,
tryOnUnmounted,
unrefElement,
until,
useActiveElement,
useAnimate,
useArrayDifference,
useArrayEvery,
useArrayFilter,
useArrayFind,
useArrayFindIndex,
useArrayFindLast,
useArrayIncludes,
useArrayJoin,
useArrayMap,
useArrayReduce,
useArraySome,
useArrayUnique,
useAsyncQueue,
useAsyncState,
useBase64,
useBattery,
useBluetooth,
useBreakpoints,
useBroadcastChannel,
useBrowserLocation,
useCached,
useClipboard,
useClipboardItems,
useCloned,
useColorMode,
useConfirmDialog,
useCounter,
useCssVar,
useCurrentElement,
useCycleList,
useDark,
useDateFormat,
refDebounced as useDebounce,
useDebounceFn,
useDebouncedRefHistory,
useDeviceMotion,
useDeviceOrientation,
useDevicePixelRatio,
useDevicesList,
useDisplayMedia,
useDocumentVisibility,
useDraggable,
useDropZone,
useElementBounding,
useElementByPoint,
useElementHover,
useElementSize,
useElementVisibility,
useEventBus,
useEventListener,
useEventSource,
useEyeDropper,
useFavicon,
useFetch,
useFileDialog,
useFileSystemAccess,
useFocus,
useFocusWithin,
useFps,
useFullscreen,
useGamepad,
useGeolocation,
useIdle,
useImage,
useInfiniteScroll,
useIntersectionObserver,
useInterval,
useIntervalFn,
useKeyModifier,
useLastChanged,
useLocalStorage,
useMagicKeys,
useManualRefHistory,
useMediaControls,
useMediaQuery,
useMemoize,
useMemory,
useMounted,
useMouse,
useMouseInElement,
useMousePressed,
useMutationObserver,
useNavigatorLanguage,
useNetwork,
useNow,
useObjectUrl,
useOffsetPagination,
useOnline,
usePageLeave,
useParallax,
useParentElement,
usePerformanceObserver,
usePermission,
usePointer,
usePointerLock,
usePointerSwipe,
usePreferredColorScheme,
usePreferredContrast,
usePreferredDark,
usePreferredLanguages,
usePreferredReducedMotion,
usePrevious,
useRafFn,
useRefHistory,
useResizeObserver,
useScreenOrientation,
useScreenSafeArea,
useScriptTag,
useScroll,
useScrollLock,
useSessionStorage,
useShare,
useSorted,
useSpeechRecognition,
useSpeechSynthesis,
useStepper,
useStorage,
useStorageAsync,
useStyleTag,
useSupported,
useSwipe,
useTemplateRefsList,
useTextDirection,
useTextSelection,
useTextareaAutosize,
refThrottled as useThrottle,
useThrottleFn,
useThrottledRefHistory,
useTimeAgo,
useTimeout,
useTimeoutFn,
useTimeoutPoll,
useTimestamp,
useTitle,
useToNumber,
useToString,
useToggle,
useTransition,
useUrlSearchParams,
useUserMedia,
useVModel,
useVModels,
useVibrate,
useVirtualList,
useWakeLock,
useWebNotification,
useWebSocket,
useWebWorker,
useWebWorkerFn,
useWindowFocus,
useWindowScroll,
useWindowSize,
watchArray,
watchAtMost,
watchDebounced,
watchDeep,
watchIgnorable,
watchImmediate,
watchOnce,
watchPausable,
watchThrottled,
watchTriggerable,
watchWithFilter,
whenever
};
//# sourceMappingURL=vitepress___@vueuse_core.js.map

View File

@ -0,0 +1,7 @@
{
"version": 3,
"sources": [],
"sourcesContent": [],
"mappings": "",
"names": []
}

343
docs/.vitepress/cache/deps/vue.js vendored Normal file
View File

@ -0,0 +1,343 @@
import {
BaseTransition,
BaseTransitionPropsValidators,
Comment,
DeprecationTypes,
EffectScope,
ErrorCodes,
ErrorTypeStrings,
Fragment,
KeepAlive,
ReactiveEffect,
Static,
Suspense,
Teleport,
Text,
TrackOpTypes,
Transition,
TransitionGroup,
TriggerOpTypes,
VueElement,
assertNumber,
callWithAsyncErrorHandling,
callWithErrorHandling,
camelize,
capitalize,
cloneVNode,
compatUtils,
compile,
computed,
createApp,
createBaseVNode,
createBlock,
createCommentVNode,
createElementBlock,
createHydrationRenderer,
createPropsRestProxy,
createRenderer,
createSSRApp,
createSlots,
createStaticVNode,
createTextVNode,
createVNode,
customRef,
defineAsyncComponent,
defineComponent,
defineCustomElement,
defineEmits,
defineExpose,
defineModel,
defineOptions,
defineProps,
defineSSRCustomElement,
defineSlots,
devtools,
effect,
effectScope,
getCurrentInstance,
getCurrentScope,
getCurrentWatcher,
getTransitionRawChildren,
guardReactiveProps,
h,
handleError,
hasInjectionContext,
hydrate,
hydrateOnIdle,
hydrateOnInteraction,
hydrateOnMediaQuery,
hydrateOnVisible,
initCustomFormatter,
initDirectivesForSSR,
inject,
isMemoSame,
isProxy,
isReactive,
isReadonly,
isRef,
isRuntimeOnly,
isShallow,
isVNode,
markRaw,
mergeDefaults,
mergeModels,
mergeProps,
nextTick,
normalizeClass,
normalizeProps,
normalizeStyle,
onActivated,
onBeforeMount,
onBeforeUnmount,
onBeforeUpdate,
onDeactivated,
onErrorCaptured,
onMounted,
onRenderTracked,
onRenderTriggered,
onScopeDispose,
onServerPrefetch,
onUnmounted,
onUpdated,
onWatcherCleanup,
openBlock,
popScopeId,
provide,
proxyRefs,
pushScopeId,
queuePostFlushCb,
reactive,
readonly,
ref,
registerRuntimeCompiler,
render,
renderList,
renderSlot,
resolveComponent,
resolveDirective,
resolveDynamicComponent,
resolveFilter,
resolveTransitionHooks,
setBlockTracking,
setDevtoolsHook,
setTransitionHooks,
shallowReactive,
shallowReadonly,
shallowRef,
ssrContextKey,
ssrUtils,
stop,
toDisplayString,
toHandlerKey,
toHandlers,
toRaw,
toRef,
toRefs,
toValue,
transformVNodeArgs,
triggerRef,
unref,
useAttrs,
useCssModule,
useCssVars,
useHost,
useId,
useModel,
useSSRContext,
useShadowRoot,
useSlots,
useTemplateRef,
useTransitionState,
vModelCheckbox,
vModelDynamic,
vModelRadio,
vModelSelect,
vModelText,
vShow,
version,
warn,
watch,
watchEffect,
watchPostEffect,
watchSyncEffect,
withAsyncContext,
withCtx,
withDefaults,
withDirectives,
withKeys,
withMemo,
withModifiers,
withScopeId
} from "./chunk-XIDTNVOX.js";
export {
BaseTransition,
BaseTransitionPropsValidators,
Comment,
DeprecationTypes,
EffectScope,
ErrorCodes,
ErrorTypeStrings,
Fragment,
KeepAlive,
ReactiveEffect,
Static,
Suspense,
Teleport,
Text,
TrackOpTypes,
Transition,
TransitionGroup,
TriggerOpTypes,
VueElement,
assertNumber,
callWithAsyncErrorHandling,
callWithErrorHandling,
camelize,
capitalize,
cloneVNode,
compatUtils,
compile,
computed,
createApp,
createBlock,
createCommentVNode,
createElementBlock,
createBaseVNode as createElementVNode,
createHydrationRenderer,
createPropsRestProxy,
createRenderer,
createSSRApp,
createSlots,
createStaticVNode,
createTextVNode,
createVNode,
customRef,
defineAsyncComponent,
defineComponent,
defineCustomElement,
defineEmits,
defineExpose,
defineModel,
defineOptions,
defineProps,
defineSSRCustomElement,
defineSlots,
devtools,
effect,
effectScope,
getCurrentInstance,
getCurrentScope,
getCurrentWatcher,
getTransitionRawChildren,
guardReactiveProps,
h,
handleError,
hasInjectionContext,
hydrate,
hydrateOnIdle,
hydrateOnInteraction,
hydrateOnMediaQuery,
hydrateOnVisible,
initCustomFormatter,
initDirectivesForSSR,
inject,
isMemoSame,
isProxy,
isReactive,
isReadonly,
isRef,
isRuntimeOnly,
isShallow,
isVNode,
markRaw,
mergeDefaults,
mergeModels,
mergeProps,
nextTick,
normalizeClass,
normalizeProps,
normalizeStyle,
onActivated,
onBeforeMount,
onBeforeUnmount,
onBeforeUpdate,
onDeactivated,
onErrorCaptured,
onMounted,
onRenderTracked,
onRenderTriggered,
onScopeDispose,
onServerPrefetch,
onUnmounted,
onUpdated,
onWatcherCleanup,
openBlock,
popScopeId,
provide,
proxyRefs,
pushScopeId,
queuePostFlushCb,
reactive,
readonly,
ref,
registerRuntimeCompiler,
render,
renderList,
renderSlot,
resolveComponent,
resolveDirective,
resolveDynamicComponent,
resolveFilter,
resolveTransitionHooks,
setBlockTracking,
setDevtoolsHook,
setTransitionHooks,
shallowReactive,
shallowReadonly,
shallowRef,
ssrContextKey,
ssrUtils,
stop,
toDisplayString,
toHandlerKey,
toHandlers,
toRaw,
toRef,
toRefs,
toValue,
transformVNodeArgs,
triggerRef,
unref,
useAttrs,
useCssModule,
useCssVars,
useHost,
useId,
useModel,
useSSRContext,
useShadowRoot,
useSlots,
useTemplateRef,
useTransitionState,
vModelCheckbox,
vModelDynamic,
vModelRadio,
vModelSelect,
vModelText,
vShow,
version,
warn,
watch,
watchEffect,
watchPostEffect,
watchSyncEffect,
withAsyncContext,
withCtx,
withDefaults,
withDirectives,
withKeys,
withMemo,
withModifiers,
withScopeId
};
//# sourceMappingURL=vue.js.map

7
docs/.vitepress/cache/deps/vue.js.map vendored Normal file
View File

@ -0,0 +1,7 @@
{
"version": 3,
"sources": [],
"sourcesContent": [],
"mappings": "",
"names": []
}

View File

@ -0,0 +1,20 @@
import { defineConfig } from 'vitepress'
import zh from "./zh";
import en from "./en";
// https://vitepress.dev/reference/site-config
export default defineConfig({
...zh,
locales: {
root: {
label: '简体中文',
lang: 'zh'
},
en: {
label: 'English',
lang: 'en',
link: '/en/',
...en
}
}
})

40
docs/.vitepress/en.ts Normal file
View File

@ -0,0 +1,40 @@
import {defineConfig} from "vitepress";
const en = defineConfig({
title: "MyBot",
description: "MyBot docs",
themeConfig: {
nav: [
{ text: 'Home', link: '/en/' },
{ text: 'Docs', link: '/en/deployment' }
],
sidebar: [
{
text: "For Administrator",
items: [
{ text: "Deployment", link: "/en/deployment" },
{ text: "Configuration", link: "/en/config" }
]
},
{
text: 'For Developer',
items: [
{ text: 'Quick Start', link: '/en/quick-start' },
]
},
{
text: "API Reference",
items: [
{ text: "API Overview", link: '/en/api-list' }
]
}
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/Wzp-2008/MyBot/', ariaLabel: "GitHub" },
{ icon: 'github', link: 'https://wzpmc.cn:3000/wzp/MyBot', ariaLabel: "Gitea" }
],
},
});
export default en;

41
docs/.vitepress/zh.ts Normal file
View File

@ -0,0 +1,41 @@
import {defineConfig} from "vitepress";
const zh = defineConfig({
title: "MyBot",
description: "MyBot文档",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: '主页', link: '/' },
{ text: '文档', link: '/deployment' }
],
sidebar: [
{
text: "对管理员",
items: [
{ text: "部署MyBot", link: '/deployment' },
{ text: "配置", link: "/config" }
]
},
{
text: '对开发者',
items: [
{ text: '快速开始', link: '/quick-start' },
]
},
{
text: "API参考",
items: [
{ text: "API总览", link: '/api-list' }
]
}
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/Wzp-2008/MyBot/', ariaLabel: "GitHub" },
{ icon: 'github', link: 'https://wzpmc.cn:3000/wzp/MyBot', ariaLabel: "Gitea" }
],
},
});
export default zh;

49
docs/api-list.md Normal file
View File

@ -0,0 +1,49 @@
---
outline: deep
---
# Runtime API Examples
This page demonstrates usage of some of the runtime APIs provided by VitePress.
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
```md
<script setup>
import { useData } from 'vitepress'
const { theme, page, frontmatter } = useData()
</script>
## Results
### Theme Data
<pre>{{ theme }}</pre>
### Page Data
<pre>{{ page }}</pre>
### Page Frontmatter
<pre>{{ frontmatter }}</pre>
```
<script setup>
import { useData } from 'vitepress'
const { site, theme, page, frontmatter } = useData()
</script>
## Results
### Theme Data
<pre>{{ theme }}</pre>
### Page Data
<pre>{{ page }}</pre>
### Page Frontmatter
<pre>{{ frontmatter }}</pre>
## More
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).

68
docs/config.md Normal file
View File

@ -0,0 +1,68 @@
# 主配置文件 {#main-config}
## 服务器验证 `authorization` {#authorization}
::: warning 实验性功能
此功能可能出现Bug作者的测试环境未找到token配置项若出现BUG请通过[Github Issues](https://github.com/Wzp-2008/MyBot/issues)或[Gitea 工单](https://wzpmc.cn:3000/wzp/MyBot/issues)向作者提交反馈
:::
### enable
是否启动验证
- 类型: `boolean`
- 值:`true` `false`
- 样例:
```yaml
enable: false
```
### token
验证所使用的token
- 类型: `string`
- 不启动验证则留空
- 样例:
```yaml
token: ""
```
---
## 指令执行失败提示 `fallback` {#fallback}
### command
当指令无效时发送的消息
- 类型:`string`
- 样例:
```yaml
command: 无效的指令!
```
### errorUncaught
当指令执行错误时发送的消息
- 类型:`string`
- 样例:
```yaml
errorUncaught: 指令运行时出现错误!
```
---
## 好友相关配置 `friend` {#friend}
### autoAccept
是否自动通过好友申请
- 类型:`boolean`
- 值:`true` `false`
- 样例:
```yaml
autoAccept: true
```
---
## 好友相关配置 `group` {#group}
### autoAccept
是否自动通过群邀请
- 类型:`boolean`
- 值:`true` `false`
- 样例:
```yaml
autoAccept: true
```
---
## ws连接地址 `websocket` {#websocket}
ws连接地址
- 类型:`string`
- 样例:
```yaml
websocket: ws://127.0.0.1:3001
```

47
docs/deployment.md Normal file
View File

@ -0,0 +1,47 @@
# 环境要求
- Java 11(最低) / 17(推荐)
MyBot的可执行文件可以在 [Github Release](https://github.com/Wzp-2008/MyBot/releases/latest) 或 [Gitea Release](https://wzpmc.cn:3000/wzp/MyBot/releases/latest) 下载到
你需要准备一个空文件夹来运行MyBot
::: code-group
```bat [windows (cmd)]
md mybot
cd mybot
```
```powershell [windows (powershell)]
New-Item mybot
cd mybot
```
```bash [linux / macos]
mkdir mybot
cd mybot
```
:::
并将jar文件放置到其中
接下来通过此命令首次启动MyBot
```bash
/path/to/java -jar MyBot-XXXXXX.jar
```
::: tip 注意
将/path/to/java替换为你的java可执行程序路径
:::
启动完成后将会在MyBot文件夹中创建一个config.yml即主配置文件
关于配置文件的修改,请参阅文档中的[配置](/config)一栏
完成配置文件的修改后,再次使用命令
```bash
/path/to/java -jar MyBot-XXXXXX.jar
```
启动MyBot
至此Bot已完成启动~

49
docs/en/api-list.md Normal file
View File

@ -0,0 +1,49 @@
---
outline: deep
---
# Runtime API Examples
This page demonstrates usage of some of the runtime APIs provided by VitePress.
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
```md
<script setup>
import { useData } from 'vitepress'
const { theme, page, frontmatter } = useData()
</script>
## Results
### Theme Data
<pre>{{ theme }}</pre>
### Page Data
<pre>{{ page }}</pre>
### Page Frontmatter
<pre>{{ frontmatter }}</pre>
```
<script setup>
import { useData } from 'vitepress'
const { site, theme, page, frontmatter } = useData()
</script>
## Results
### Theme Data
<pre>{{ theme }}</pre>
### Page Data
<pre>{{ page }}</pre>
### Page Frontmatter
<pre>{{ frontmatter }}</pre>
## More
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).

68
docs/en/config.md Normal file
View File

@ -0,0 +1,68 @@
# Main Configuration File {#main-config}
## `authorization` {#authorization}
::: warning Experimental
There may be a Bug in this function (the token configuration item is not found in the author's test environment). if there is a BUG, please submit feedback to the author through [Github Issues](https://github.com/Wzp-2008/MyBot/issues) or [Gitea ticket](https://wzpmc.cn:3000/wzp/MyBot/issues)
:::
### enable
should use authorization?
- type `boolean`
- value`true` `false`
- example
```yaml
enable: false
```
### token
The token used on the authorization
- type `string`
- can be empty when not using authorization
- example
```yaml
token: ""
```
---
## `fallback` {#fallback}
### command
when command executing have errors sends message
- type`string`
- example
```yaml
command: Invalid command!
```
### errorUncaught
Message sent when instruction execution fails
- type`string`
- example
```yaml
errorUncaught: Error while command is running!
```
---
## `friend` {#friend}
### autoAccept
Whether to automatically apply through friends
- type`boolean`
- values`true` `false`
- example
```yaml
autoAccept: true
```
---
## `group` {#group}
### autoAccept
Automatically through group invitation
- type`boolean`
- values`true` `false`
- example
```yaml
autoAccept: true
```
---
## `websocket` {#websocket}
ws connection address
- type`string`
- example
```yaml
websocket: ws://127.0.0.1:3001
```

0
docs/en/deployment.md Normal file
View File

25
docs/en/index.md Normal file
View File

@ -0,0 +1,25 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home
hero:
name: "MyBot"
text: "MyBot docs"
tagline: A Java-based OneBot11-compatible robot framework
actions:
- theme: brand
text: Quick Start
link: /deployment
- theme: alt
text: API Reference
link: /api-list
features:
- title: Bukkit Like Plugin Form
details: Minecraft developers can easily get started
- title: API rich
details: compatible with all onebot11 apis and events
- title: Low occupancy
details: The full version only takes up 20M of storage and less than 100M of memory.
---

85
docs/en/quick-start.md Normal file
View File

@ -0,0 +1,85 @@
# Markdown Extension Examples
This page demonstrates some of the built-in markdown extensions provided by VitePress.
## Syntax Highlighting
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
**Input**
````md
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
````
**Output**
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
## Custom Containers
**Input**
```md
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
```
**Output**
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
## More
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).

25
docs/index.md Normal file
View File

@ -0,0 +1,25 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home
hero:
name: "MyBot"
text: "MyBot 开发文档"
tagline: 一个基于 Java 的 OneBot11 兼容机器人框架
actions:
- theme: brand
text: 快速开始
link: /deployment
- theme: alt
text: API参考
link: /api-list
features:
- title: Bukkit Like插件形式
details: MC开发者可轻松上手
- title: API丰富
details: 兼容所有OneBot11 API\事件
- title: 占用低
details: 完整版仅仅占用20M存储,100M以下内存
---

18
docs/package.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "mybot-docs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"vitepress": "^1.4.0"
}
}

1491
docs/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

85
docs/quick-start.md Normal file
View File

@ -0,0 +1,85 @@
# 快速开始
This page demonstrates some of the built-in markdown extensions provided by VitePress.
## Syntax Highlighting
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
**Input**
````md
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
````
**Output**
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
## Custom Containers
**Input**
```md
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
```
**Output**
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
## More
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).

View File

@ -0,0 +1,78 @@
val projectName = rootProject.name
val groupName: String by extra
val projectArtifactId = "mybot-api"
val projectVersion: String by extra
plugins {
id("maven-publish")
}
group = "cn.wzpmc"
version = projectVersion
repositories {
mavenCentral()
}
dependencies {}
tasks.register<Jar>("javadocJar") {
archiveClassifier.set("javadoc")
from(tasks.named("javadoc"))
}
tasks.register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
groupId = groupName
artifactId = projectArtifactId
version = projectVersion
artifact(tasks.named("javadocJar"))
artifact(tasks.named("sourcesJar"))
pom {
name.set(projectName)
description.set("A Java-based OneBot11-compatible robot framework")
licenses {
license {
name.set("The MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("wzp")
name.set("wzp")
email.set("minecraftwzpmc@gmail.com")
}
}
scm {
connection.set("scm:git:https://wzpmc.cn:3000/wzp/MyBot.git")
developerConnection.set("scm:git:https://wzpmc.cn:3000/wzp/MyBot.git")
url.set("https://wzpmc.cn:3000/wzp/MyBot")
}
}
}
}
repositories {
maven {
val releasesRepoUrl = uri("https://wzpmc.cn:90/repository/maven-releases")
val snapshotsRepoUrl = uri("https://wzpmc.cn:90/repository/maven-snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = project.findProperty("repo.user") as String? ?: ""
password = project.findProperty("repo.password") as String? ?: ""
}
}
}
}
tasks.test {
useJUnitPlatform()
}

View File

@ -1,4 +1,4 @@
package cn.wzpmc.api.api; package cn.wzpmc.api;
import lombok.*; import lombok.*;
@ -6,9 +6,10 @@ import java.util.UUID;
/** /**
* 抽象请求体 * 抽象请求体
*
* @author wzp * @author wzp
* @since 2024/8/16 21:36
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/16 21:36
*/ */
@Getter @Getter
@ToString @ToString
@ -16,19 +17,22 @@ import java.util.UUID;
@NoArgsConstructor(access = AccessLevel.PROTECTED) @NoArgsConstructor(access = AccessLevel.PROTECTED)
@Setter(AccessLevel.PROTECTED) @Setter(AccessLevel.PROTECTED)
public class Action<REQUEST, RESPONSE> { public class Action<REQUEST, RESPONSE> {
/**
* 请求回调值默认随机生成不建议自己修改
*
* @since 2024/8/23 21:29 v0.0.5-dev
*/
private final UUID echo = UUID.randomUUID();
/** /**
* 请求操作类型 * 请求操作类型
*
* @since 2024/8/23 21:29 v0.0.5-dev * @since 2024/8/23 21:29 v0.0.5-dev
*/ */
private Actions action; private Actions action;
/** /**
* 请求参数 * 请求参数
*
* @since 2024/8/23 21:29 v0.0.5-dev * @since 2024/8/23 21:29 v0.0.5-dev
*/ */
private REQUEST params; private REQUEST params;
/**
* 请求回调值默认随机生成不建议自己修改
* @since 2024/8/23 21:29 v0.0.5-dev
*/
private final UUID echo = UUID.randomUUID();
} }

View File

@ -1,4 +1,4 @@
package cn.wzpmc.api.api; package cn.wzpmc.api;
import lombok.Data; import lombok.Data;
@ -6,6 +6,7 @@ import java.util.UUID;
/** /**
* 请求操作返回 * 请求操作返回
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/16 17:43 * @since 2024/8/16 17:43
@ -14,21 +15,25 @@ import java.util.UUID;
public class ActionResponse<RESPONSE> { public class ActionResponse<RESPONSE> {
/** /**
* 请求返回消息 * 请求返回消息
*
* @since 2024/8/23 21:30 v0.0.5-dev * @since 2024/8/23 21:30 v0.0.5-dev
*/ */
private final String status; private final String status;
/** /**
* 请求返回码 * 请求返回码
*
* @since 2024/8/23 21:30 v0.0.5-dev * @since 2024/8/23 21:30 v0.0.5-dev
*/ */
private final short retcode; private final short retcode;
/** /**
* 请求返回数据 * 请求返回数据
*
* @since 2024/8/23 21:31 v0.0.5-dev * @since 2024/8/23 21:31 v0.0.5-dev
*/ */
private final RESPONSE data; private final RESPONSE data;
/** /**
* 请求返回回调 * 请求返回回调
*
* @since 2024/8/23 21:31 v0.0.5-dev * @since 2024/8/23 21:31 v0.0.5-dev
*/ */
private final UUID echo; private final UUID echo;

View File

@ -1,212 +1,253 @@
package cn.wzpmc.api.api; package cn.wzpmc.api;
import cn.wzpmc.api.api.actions.message.send.SendMessageActionResponseData; import cn.wzpmc.api.actions.message.send.SendMessageActionResponseData;
import cn.wzpmc.api.entities.*; import cn.wzpmc.entities.*;
import cn.wzpmc.api.user.IBot; import cn.wzpmc.user.IBot;
import cn.wzpmc.api.user.IUser; import cn.wzpmc.user.IUser;
/** /**
* 操作类型 * 操作类型
*
* @author wzp * @author wzp
* @since 2024/8/16 22:24
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/16 22:24
*/ */
public enum Actions { public enum Actions {
/** /**
* 发送私聊消息 * 发送私聊消息
*
* @since 2024/8/23 21:07 v0.0.5-dev * @since 2024/8/23 21:07 v0.0.5-dev
*/ */
SEND_PRIVATE_MSG(SendMessageActionResponseData.class), SEND_PRIVATE_MSG(SendMessageActionResponseData.class),
/** /**
* 发送群消息 * 发送群消息
*
* @since 2024/8/23 21:07 v0.0.5-dev * @since 2024/8/23 21:07 v0.0.5-dev
*/ */
SEND_GROUP_MSG(SendMessageActionResponseData.class), SEND_GROUP_MSG(SendMessageActionResponseData.class),
/** /**
* 撤回消息 * 撤回消息
*
* @since 2024/8/23 21:07 v0.0.5-dev * @since 2024/8/23 21:07 v0.0.5-dev
*/ */
DELETE_MSG, DELETE_MSG,
/** /**
* 获取消息 * 获取消息
*
* @since 2024/8/23 21:07 v0.0.5-dev * @since 2024/8/23 21:07 v0.0.5-dev
*/ */
GET_MSG(MessageInformation.class), GET_MSG(MessageInformation.class),
/** /**
* 获取合并转发消息 * 获取合并转发消息
*
* @since 2024/8/23 21:08 v0.0.5-dev * @since 2024/8/23 21:08 v0.0.5-dev
*/ */
GET_FORWARD_MSG(MessageInformation.class), GET_FORWARD_MSG(MessageInformation.class),
/** /**
* 发送好友赞 * 发送好友赞
*
* @since 2024/8/23 21:08 v0.0.5-dev * @since 2024/8/23 21:08 v0.0.5-dev
*/ */
SEND_LIKE, SEND_LIKE,
/** /**
* 群组踢人 * 群组踢人
*
* @since 2024/8/23 21:08 v0.0.5-dev * @since 2024/8/23 21:08 v0.0.5-dev
*/ */
SET_GROUP_KICK, SET_GROUP_KICK,
/** /**
* 群组单人禁言 * 群组单人禁言
*
* @since 2024/8/23 21:08 v0.0.5-dev * @since 2024/8/23 21:08 v0.0.5-dev
*/ */
SET_GROUP_BAN, SET_GROUP_BAN,
/** /**
* 群组匿名用户禁言 * 群组匿名用户禁言
*
* @since 2024/8/23 21:08 v0.0.5-dev * @since 2024/8/23 21:08 v0.0.5-dev
*/ */
SET_GROUP_ANONYMOUS_BAN, SET_GROUP_ANONYMOUS_BAN,
/** /**
* 群组全员禁言 * 群组全员禁言
*
* @since 2024/8/23 21:09 v0.0.5-dev * @since 2024/8/23 21:09 v0.0.5-dev
*/ */
SET_GROUP_WHOLE_BAN, SET_GROUP_WHOLE_BAN,
/** /**
* 群组设置管理员 * 群组设置管理员
*
* @since 2024/8/23 21:09 v0.0.5-dev * @since 2024/8/23 21:09 v0.0.5-dev
*/ */
SET_GROUP_ADMIN, SET_GROUP_ADMIN,
/** /**
* 群组匿名 * 群组匿名
*
* @since 2024/8/23 21:09 v0.0.5-dev * @since 2024/8/23 21:09 v0.0.5-dev
*/ */
SET_GROUP_ANONYMOUS, SET_GROUP_ANONYMOUS,
/** /**
* 设置群名片群备注 * 设置群名片群备注
*
* @since 2024/8/23 21:09 v0.0.5-dev * @since 2024/8/23 21:09 v0.0.5-dev
*/ */
SET_GROUP_CARD, SET_GROUP_CARD,
/** /**
* 设置群名 * 设置群名
*
* @since 2024/8/24 19:04 v0.0.6-dev * @since 2024/8/24 19:04 v0.0.6-dev
*/ */
SET_GROUP_NAME, SET_GROUP_NAME,
/** /**
* 退出群组 * 退出群组
*
* @since 2024/8/24 20:01 v0.0.6-dev * @since 2024/8/24 20:01 v0.0.6-dev
*/ */
SET_GROUP_LEAVE, SET_GROUP_LEAVE,
/** /**
* 设置群组专属头衔 * 设置群组专属头衔
*
* @since 2024/8/24 20:01 v0.0.6-dev * @since 2024/8/24 20:01 v0.0.6-dev
*/ */
SET_GROUP_SPECIAL_TITLE, SET_GROUP_SPECIAL_TITLE,
/** /**
* 处理加好友请求 * 处理加好友请求
*
* @since 2024/8/24 20:01 v0.0.6-dev * @since 2024/8/24 20:01 v0.0.6-dev
*/ */
SET_FRIEND_ADD_REQUEST, SET_FRIEND_ADD_REQUEST,
/** /**
* 处理加群请求邀请 * 处理加群请求邀请
*
* @since 2024/8/24 20:02 v0.0.6-dev * @since 2024/8/24 20:02 v0.0.6-dev
*/ */
SET_GROUP_ADD_REQUEST, SET_GROUP_ADD_REQUEST,
/** /**
* 获取登录号信息 * 获取登录号信息
*
* @since 2024/8/24 20:02 v0.0.6-dev * @since 2024/8/24 20:02 v0.0.6-dev
*/ */
GET_LOGIN_INFO(IBot.class), GET_LOGIN_INFO(IBot.class),
/** /**
* 获取陌生人信息 * 获取陌生人信息
*
* @since 2024/8/24 20:02 v0.0.6-dev * @since 2024/8/24 20:02 v0.0.6-dev
*/ */
GET_STRANGER_INFO(IUser.class), GET_STRANGER_INFO(IUser.class),
/** /**
* 获取好友列表 * 获取好友列表
*
* @since 2024/8/24 20:02 v0.0.6-dev * @since 2024/8/24 20:02 v0.0.6-dev
*/ */
GET_FRIEND_LIST(MessageInformation.class, true), GET_FRIEND_LIST(FriendInformation.class, true),
/** /**
* 获取群信息 * 获取群信息
*
* @since 2024/8/24 20:02 v0.0.6-dev * @since 2024/8/24 20:02 v0.0.6-dev
*/ */
GET_GROUP_INFO(GroupInformation.class), GET_GROUP_INFO(GroupInformation.class),
/** /**
* 获取群列表 * 获取群列表
*
* @since 2024/8/24 20:02 v0.0.6-dev * @since 2024/8/24 20:02 v0.0.6-dev
*/ */
GET_GROUP_LIST(GroupInformation.class, true), GET_GROUP_LIST(GroupInformation.class, true),
/** /**
* 获取群成员信息 * 获取群成员信息
*
* @since 2024/8/24 20:02 v0.0.6-dev * @since 2024/8/24 20:02 v0.0.6-dev
*/ */
GET_GROUP_MEMBER_INFO(GroupMemberInformation.class), GET_GROUP_MEMBER_INFO(GroupMemberInformation.class),
/** /**
* 获取群成员列表 * 获取群成员列表
*
* @since 2024/8/24 20:03 v0.0.6-dev * @since 2024/8/24 20:03 v0.0.6-dev
*/ */
GET_GROUP_MEMBER_LIST(GroupMemberInformation.class, true), GET_GROUP_MEMBER_LIST(GroupMemberInformation.class, true),
/** /**
* 获取群荣誉信息 * 获取群荣誉信息
*
* @since 2024/8/24 20:03 v0.0.6-dev * @since 2024/8/24 20:03 v0.0.6-dev
*/ */
GET_GROUP_HONOR_INFO(HonorInformation.class), GET_GROUP_HONOR_INFO(HonorInformation.class),
/** /**
* 获取 Cookies * 获取 Cookies
*
* @since 2024/8/24 20:03 v0.0.6-dev * @since 2024/8/24 20:03 v0.0.6-dev
*/ */
GET_COOKIES(CookiesInformation.class), GET_COOKIES(CookiesInformation.class),
/** /**
* 获取 CSRF Token * 获取 CSRF Token
*
* @since 2024/8/24 20:04 v0.0.6-dev * @since 2024/8/24 20:04 v0.0.6-dev
*/ */
GET_CSRF_TOKEN(CsrfTokenInformation.class), GET_CSRF_TOKEN(CsrfTokenInformation.class),
/** /**
* 获取 QQ 相关接口凭证 * 获取 QQ 相关接口凭证
*
* @since 2024/8/24 20:04 v0.0.6-dev * @since 2024/8/24 20:04 v0.0.6-dev
*/ */
GET_CREDENTIALS(CredentialsInformation.class), GET_CREDENTIALS(CredentialsInformation.class),
/** /**
* 获取语音 * 获取语音
*
* @since 2024/8/24 20:04 v0.0.6-dev * @since 2024/8/24 20:04 v0.0.6-dev
*/ */
GET_RECORD(FilePathInformation.class), GET_RECORD(FilePathInformation.class),
/** /**
* 获取图片 * 获取图片
*
* @since 2024/8/24 20:04 v0.0.6-dev * @since 2024/8/24 20:04 v0.0.6-dev
*/ */
GET_IMAGE(FilePathInformation.class), GET_IMAGE(FilePathInformation.class),
/** /**
* 检查是否可以发送图片 * 检查是否可以发送图片
*
* @since 2024/8/24 20:04 v0.0.6-dev * @since 2024/8/24 20:04 v0.0.6-dev
*/ */
CAN_SEND_IMAGE(YesNo.class), CAN_SEND_IMAGE(YesNo.class),
/** /**
* 检查是否可以发送语音 * 检查是否可以发送语音
*
* @since 2024/8/24 20:04 v0.0.6-dev * @since 2024/8/24 20:04 v0.0.6-dev
*/ */
CAN_SEND_RECORD(YesNo.class), CAN_SEND_RECORD(YesNo.class),
/** /**
* 获取运行状态 * 获取运行状态
*
* @since 2024/8/24 20:04 v0.0.6-dev * @since 2024/8/24 20:04 v0.0.6-dev
*/ */
GET_STATUS(BotStatus.class), GET_STATUS(BotStatus.class),
/** /**
* 获取版本信息 * 获取版本信息
*
* @since 2024/8/24 20:04 v0.0.6-dev * @since 2024/8/24 20:04 v0.0.6-dev
*/ */
GET_VERSION_INFO(VersionInformation.class), GET_VERSION_INFO(VersionInformation.class),
/** /**
* 重启 OneBot 实现 * 重启 OneBot 实现
*
* @since 2024/8/24 20:05 v0.0.6-dev * @since 2024/8/24 20:05 v0.0.6-dev
*/ */
SET_RESTART, SET_RESTART,
/** /**
* 清理缓存 * 清理缓存
*
* @since 2024/8/24 20:05 v0.0.6-dev * @since 2024/8/24 20:05 v0.0.6-dev
*/ */
CLEAN_CACHE; CLEAN_CACHE;
public final Class<?> responseClass; public final Class<?> responseClass;
public final boolean array; public final boolean array;
Actions(Class<?> responseClass, boolean array) { Actions(Class<?> responseClass, boolean array) {
this.responseClass = responseClass; this.responseClass = responseClass;
this.array = array; this.array = array;
} }
Actions(Class<?> responseClass) { Actions(Class<?> responseClass) {
this(responseClass, false); this(responseClass, false);
} }
Actions(){
Actions() {
this(Void.class); this(Void.class);
} }
} }

View File

@ -0,0 +1,40 @@
package cn.wzpmc.api;
import lombok.SneakyThrows;
/**
* 主Api接口
*
* @author wzp
* @version 0.0.5-dev
* @since 2024/8/16 17:31
*/
public interface IMainApi {
/**
* 进行请求操作
*
* @param packet 请求包
* @param <REQUEST> 请求类型
* @param <RESPONSE> 返回类型
* @return 请求返回包
* @throws InterruptedException 请求过程中出现Ctrl+C时抛出
* @author wzp
* @since 2024/8/23 21:32 v0.0.5-dev
*/
<REQUEST, RESPONSE> ActionResponse<RESPONSE> doApiCall(Action<REQUEST, RESPONSE> packet) throws InterruptedException;
/**
* 进行请求操作
*
* @param packet 请求包
* @param <REQUEST> 请求类型
* @param <RESPONSE> 返回类型
* @return 请求返回包
* @author wzp
* @since 2024/8/27 15:11 v1.0.2
*/
@SneakyThrows
default <REQUEST, RESPONSE> ActionResponse<RESPONSE> doApiCallSafe(Action<REQUEST, RESPONSE> packet) {
return doApiCall(packet);
}
}

View File

@ -1,10 +1,11 @@
package cn.wzpmc.api.api.actions.message; package cn.wzpmc.api.actions.message;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
/** /**
* 清理缓存 * 清理缓存
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:46 * @since 2024/8/24 20:46
@ -12,6 +13,7 @@ import cn.wzpmc.api.api.Actions;
public class CleanCacheAction extends Action<Void, Void> { public class CleanCacheAction extends Action<Void, Void> {
/** /**
* 清理缓存 * 清理缓存
*
* @author wzp * @author wzp
* @since 2024/8/24 23:59 v0.0.6-dev * @since 2024/8/24 23:59 v0.0.6-dev
*/ */

View File

@ -1,11 +1,12 @@
package cn.wzpmc.api.api.actions.message.can; package cn.wzpmc.api.actions.message.can;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.YesNo; import cn.wzpmc.entities.YesNo;
/** /**
* 检查是否可以发送图片 * 检查是否可以发送图片
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:45 * @since 2024/8/24 20:45
@ -13,10 +14,11 @@ import cn.wzpmc.api.entities.YesNo;
public class CanSendImageAction extends Action<Void, YesNo> { public class CanSendImageAction extends Action<Void, YesNo> {
/** /**
* 检查是否可以发送图片 * 检查是否可以发送图片
*
* @author wzp * @author wzp
* @since 2024/8/24 23:51 v0.0.6-dev * @since 2024/8/24 23:51 v0.0.6-dev
*/ */
public CanSendImageAction(){ public CanSendImageAction() {
super.setAction(Actions.CAN_SEND_IMAGE); super.setAction(Actions.CAN_SEND_IMAGE);
} }
} }

View File

@ -1,11 +1,12 @@
package cn.wzpmc.api.api.actions.message.can; package cn.wzpmc.api.actions.message.can;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.YesNo; import cn.wzpmc.entities.YesNo;
/** /**
* 检查是否可以发送语音 * 检查是否可以发送语音
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:45 * @since 2024/8/24 20:45
@ -13,10 +14,11 @@ import cn.wzpmc.api.entities.YesNo;
public class CanSendRecordAction extends Action<Void, YesNo> { public class CanSendRecordAction extends Action<Void, YesNo> {
/** /**
* 检查是否可以发送语音 * 检查是否可以发送语音
*
* @author wzp * @author wzp
* @since 2024/8/24 23:51 v0.0.6-dev * @since 2024/8/24 23:51 v0.0.6-dev
*/ */
public CanSendRecordAction(){ public CanSendRecordAction() {
super.setAction(Actions.CAN_SEND_RECORD); super.setAction(Actions.CAN_SEND_RECORD);
} }
} }

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.delete; package cn.wzpmc.api.actions.message.delete;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 撤回消息 * 撤回消息
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/17 23:02 * @since 2024/8/17 23:02
@ -15,19 +16,22 @@ import lombok.Data;
public class DeleteMessageAction extends Action<DeleteMessageAction.Params, Void> { public class DeleteMessageAction extends Action<DeleteMessageAction.Params, Void> {
/** /**
* 撤回消息 * 撤回消息
*
* @param messageId 消息ID
* @author wzp * @author wzp
* @since 2024/8/23 21:09 v0.0.5-dev * @since 2024/8/23 21:09 v0.0.5-dev
* @param messageId 消息ID
*/ */
public DeleteMessageAction(Integer messageId){ public DeleteMessageAction(Integer messageId) {
super.setAction(Actions.DELETE_MSG); super.setAction(Actions.DELETE_MSG);
super.setParams(new Params(messageId)); super.setParams(new Params(messageId));
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static class Params { public static class Params {
/** /**
* 消息ID * 消息ID
*
* @since 2024/8/17 23:03 v0.0.5-dev * @since 2024/8/17 23:03 v0.0.5-dev
*/ */
@JSONField(name = "message_id") @JSONField(name = "message_id")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.CookiesInformation; import cn.wzpmc.entities.CookiesInformation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 获取 Cookies * 获取 Cookies
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:43 * @since 2024/8/24 20:43
@ -15,9 +16,10 @@ import lombok.Data;
public class GetCookiesAction extends Action<GetCookiesAction.Params, CookiesInformation> { public class GetCookiesAction extends Action<GetCookiesAction.Params, CookiesInformation> {
/** /**
* 获取 Cookies * 获取 Cookies
*
* @param domain 需要获取 cookies 的域名
* @author wzp * @author wzp
* @since 2024/8/24 23:51 v0.0.6-dev * @since 2024/8/24 23:51 v0.0.6-dev
* @param domain 需要获取 cookies 的域名
*/ */
public GetCookiesAction(String domain) { public GetCookiesAction(String domain) {
super.setAction(Actions.GET_COOKIES); super.setAction(Actions.GET_COOKIES);
@ -26,17 +28,20 @@ public class GetCookiesAction extends Action<GetCookiesAction.Params, CookiesInf
/** /**
* 获取 Cookies * 获取 Cookies
*
* @author wzp * @author wzp
* @since 2024/8/24 23:51 v0.0.6-dev * @since 2024/8/24 23:51 v0.0.6-dev
*/ */
public GetCookiesAction() { public GetCookiesAction() {
this(""); this("");
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 需要获取 cookies 的域名 * 需要获取 cookies 的域名
*
* @since 2024/8/24 23:32 v0.0.6-dev * @since 2024/8/24 23:32 v0.0.6-dev
*/ */
private String domain; private String domain;

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.CredentialsInformation; import cn.wzpmc.entities.CredentialsInformation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 获取 QQ 相关接口凭证 * 获取 QQ 相关接口凭证
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:44 * @since 2024/8/24 20:44
@ -15,9 +16,10 @@ import lombok.Data;
public class GetCredentialsAction extends Action<GetCredentialsAction.Params, CredentialsInformation> { public class GetCredentialsAction extends Action<GetCredentialsAction.Params, CredentialsInformation> {
/** /**
* 获取 QQ 相关接口凭证 * 获取 QQ 相关接口凭证
*
* @param domain 需要获取 cookies 的域名
* @author wzp * @author wzp
* @since 2024/8/24 23:51 v0.0.6-dev * @since 2024/8/24 23:51 v0.0.6-dev
* @param domain 需要获取 cookies 的域名
*/ */
public GetCredentialsAction(String domain) { public GetCredentialsAction(String domain) {
super.setAction(Actions.GET_COOKIES); super.setAction(Actions.GET_COOKIES);
@ -26,17 +28,20 @@ public class GetCredentialsAction extends Action<GetCredentialsAction.Params, Cr
/** /**
* 获取 QQ 相关接口凭证 * 获取 QQ 相关接口凭证
*
* @author wzp * @author wzp
* @since 2024/8/24 23:52 v0.0.6-dev * @since 2024/8/24 23:52 v0.0.6-dev
*/ */
public GetCredentialsAction() { public GetCredentialsAction() {
this(""); this("");
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 需要获取 cookies 的域名 * 需要获取 cookies 的域名
*
* @since 2024/8/24 23:32 v0.0.6-dev * @since 2024/8/24 23:32 v0.0.6-dev
*/ */
private String domain; private String domain;

View File

@ -1,11 +1,12 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.CsrfTokenInformation; import cn.wzpmc.entities.CsrfTokenInformation;
/** /**
* 获取 CSRF Token * 获取 CSRF Token
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:44 * @since 2024/8/24 20:44
@ -13,10 +14,11 @@ import cn.wzpmc.api.entities.CsrfTokenInformation;
public class GetCsrfTokenAction extends Action<Void, CsrfTokenInformation> { public class GetCsrfTokenAction extends Action<Void, CsrfTokenInformation> {
/** /**
* 获取 CSRF Token * 获取 CSRF Token
*
* @author wzp * @author wzp
* @since 2024/8/24 23:52 v0.0.6-dev * @since 2024/8/24 23:52 v0.0.6-dev
*/ */
public GetCsrfTokenAction(){ public GetCsrfTokenAction() {
super.setAction(Actions.GET_CSRF_TOKEN); super.setAction(Actions.GET_CSRF_TOKEN);
} }
} }

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.MessageInformation; import cn.wzpmc.entities.MessageInformation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 获取合并转发消息 * 获取合并转发消息
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/23 19:46 * @since 2024/8/23 19:46
@ -15,19 +16,22 @@ import lombok.Data;
public class GetForwardMessageAction extends Action<GetForwardMessageAction.Params, MessageInformation> { public class GetForwardMessageAction extends Action<GetForwardMessageAction.Params, MessageInformation> {
/** /**
* 获取合并转发消息 * 获取合并转发消息
*
* @param id 合并转发ID
* @author wzp * @author wzp
* @since 2024/8/23 21:10 v0.0.5-dev * @since 2024/8/23 21:10 v0.0.5-dev
* @param id 合并转发ID
*/ */
public GetForwardMessageAction(String id){ public GetForwardMessageAction(String id) {
super.setAction(Actions.GET_FORWARD_MSG); super.setAction(Actions.GET_FORWARD_MSG);
super.setParams(new GetForwardMessageAction.Params(id)); super.setParams(new GetForwardMessageAction.Params(id));
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 合并转发ID * 合并转发ID
*
* @since 2024/8/23 19:47 v0.0.5-dev * @since 2024/8/23 19:47 v0.0.5-dev
*/ */
private String id; private String id;

View File

@ -1,24 +1,26 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.MessageInformation; import cn.wzpmc.entities.FriendInformation;
import java.util.List; import java.util.List;
/** /**
* 获取好友列表 * 获取好友列表
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:41 * @since 2024/8/24 20:41
*/ */
public class GetFriendListAction extends Action<Void, List<MessageInformation>> { public class GetFriendListAction extends Action<Void, List<FriendInformation>> {
/** /**
* 获取好友列表 * 获取好友列表
*
* @author wzp * @author wzp
* @since 2024/8/24 23:52 v0.0.6-dev * @since 2024/8/24 23:52 v0.0.6-dev
*/ */
public GetFriendListAction(){ public GetFriendListAction() {
super.setAction(Actions.GET_FRIEND_LIST); super.setAction(Actions.GET_FRIEND_LIST);
} }
} }

View File

@ -1,15 +1,16 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.HonorInformation; import cn.wzpmc.entities.HonorInformation;
import cn.wzpmc.api.entities.HonorType; import cn.wzpmc.entities.HonorType;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 获取群荣誉信息 * 获取群荣誉信息
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:43 * @since 2024/8/24 20:43
@ -17,10 +18,11 @@ import lombok.Data;
public class GetGroupHonorInfoAction extends Action<GetGroupHonorInfoAction.Params, HonorInformation> { public class GetGroupHonorInfoAction extends Action<GetGroupHonorInfoAction.Params, HonorInformation> {
/** /**
* 获取群荣誉信息 * 获取群荣誉信息
*
* @param groupId 群号
* @param type 要获取的群荣誉类型可传入 talkative performer legend strong_newbie emotion 以分别获取单个类型的群荣誉数据或传入 all 获取所有数据
* @author wzp * @author wzp
* @since 2024/8/24 23:52 v0.0.6-dev * @since 2024/8/24 23:52 v0.0.6-dev
* @param groupId 群号
* @param type 要获取的群荣誉类型可传入 talkative performer legend strong_newbie emotion 以分别获取单个类型的群荣誉数据或传入 all 获取所有数据
*/ */
public GetGroupHonorInfoAction(Long groupId, HonorType type) { public GetGroupHonorInfoAction(Long groupId, HonorType type) {
this.setAction(Actions.GET_GROUP_HONOR_INFO); this.setAction(Actions.GET_GROUP_HONOR_INFO);
@ -29,24 +31,28 @@ public class GetGroupHonorInfoAction extends Action<GetGroupHonorInfoAction.Para
/** /**
* 获取群荣誉信息 * 获取群荣誉信息
*
* @param groupId 群号
* @author wzp * @author wzp
* @since 2024/8/24 23:53 v0.0.6-dev * @since 2024/8/24 23:53 v0.0.6-dev
* @param groupId 群号
*/ */
public GetGroupHonorInfoAction(Long groupId) { public GetGroupHonorInfoAction(Long groupId) {
this(groupId, HonorType.ALL); this(groupId, HonorType.ALL);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/24 23:52 v0.0.6-dev * @since 2024/8/24 23:52 v0.0.6-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 要获取的群荣誉类型可传入 talkative performer legend strong_newbie emotion 以分别获取单个类型的群荣誉数据或传入 all 获取所有数据 * 要获取的群荣誉类型可传入 talkative performer legend strong_newbie emotion 以分别获取单个类型的群荣誉数据或传入 all 获取所有数据
*
* @since 2024/8/24 23:52 v0.0.6-dev * @since 2024/8/24 23:52 v0.0.6-dev
*/ */
private HonorType type; private HonorType type;

View File

@ -1,14 +1,15 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.GroupInformation; import cn.wzpmc.entities.GroupInformation;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 获取群信息 * 获取群信息
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:41 * @since 2024/8/24 20:41
@ -16,36 +17,41 @@ import lombok.Data;
public class GetGroupInfoAction extends Action<GetGroupInfoAction.Params, GroupInformation> { public class GetGroupInfoAction extends Action<GetGroupInfoAction.Params, GroupInformation> {
/** /**
* 获取群信息 * 获取群信息
* @author wzp *
* @since 2024/8/24 23:53 v0.0.6-dev
* @param groupId 群号 * @param groupId 群号
* @param noCache 是否不使用缓存使用缓存可能更新不及时但响应更快 * @param noCache 是否不使用缓存使用缓存可能更新不及时但响应更快
* @author wzp
* @since 2024/8/24 23:53 v0.0.6-dev
*/ */
public GetGroupInfoAction(Long groupId, Boolean noCache){ public GetGroupInfoAction(Long groupId, Boolean noCache) {
super.setAction(Actions.GET_GROUP_INFO); super.setAction(Actions.GET_GROUP_INFO);
super.setParams(new Params(groupId, noCache)); super.setParams(new Params(groupId, noCache));
} }
/** /**
* 获取群信息 * 获取群信息
*
* @param groupId 群号
* @author wzp * @author wzp
* @since 2024/8/24 23:53 v0.0.6-dev * @since 2024/8/24 23:53 v0.0.6-dev
* @param groupId 群号
*/ */
public GetGroupInfoAction(Long groupId){ public GetGroupInfoAction(Long groupId) {
this(groupId, false); this(groupId, false);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/24 22:58 v0.0.6-dev * @since 2024/8/24 22:58 v0.0.6-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 是否不使用缓存使用缓存可能更新不及时但响应更快 * 是否不使用缓存使用缓存可能更新不及时但响应更快
*
* @since 2024/8/24 22:58 v0.0.6-dev * @since 2024/8/24 22:58 v0.0.6-dev
*/ */
@JSONField(name = "no_cache", defaultValue = "false") @JSONField(name = "no_cache", defaultValue = "false")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.GroupInformation; import cn.wzpmc.entities.GroupInformation;
import java.util.List; import java.util.List;
/** /**
* 获取群列表 * 获取群列表
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:42 * @since 2024/8/24 20:42
@ -15,10 +16,11 @@ import java.util.List;
public class GetGroupListAction extends Action<Void, List<GroupInformation>> { public class GetGroupListAction extends Action<Void, List<GroupInformation>> {
/** /**
* 获取群列表 * 获取群列表
*
* @author wzp * @author wzp
* @since 2024/8/24 23:54 v0.0.6-dev * @since 2024/8/24 23:54 v0.0.6-dev
*/ */
public GetGroupListAction(){ public GetGroupListAction() {
super.setAction(Actions.GET_GROUP_LIST); super.setAction(Actions.GET_GROUP_LIST);
} }
} }

View File

@ -1,14 +1,15 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.GroupMemberInformation; import cn.wzpmc.entities.GroupMemberInformation;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 获取群成员信息 * 获取群成员信息
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:42 * @since 2024/8/24 20:42
@ -16,44 +17,50 @@ import lombok.Data;
public class GetGroupMemberInfoAction extends Action<GetGroupMemberInfoAction.Params, GroupMemberInformation> { public class GetGroupMemberInfoAction extends Action<GetGroupMemberInfoAction.Params, GroupMemberInformation> {
/** /**
* 获取群成员信息 * 获取群成员信息
*
* @param groupId 群号
* @param userId QQ
* @param noCache 是否不使用缓存
* @author wzp * @author wzp
* @since 2024/8/24 23:54 v0.0.6-dev * @since 2024/8/24 23:54 v0.0.6-dev
* @param groupId 群号
* @param userId QQ
* @param noCache 是否不使用缓存
*/ */
public GetGroupMemberInfoAction(Long groupId, Long userId, Boolean noCache){ public GetGroupMemberInfoAction(Long groupId, Long userId, Boolean noCache) {
super.setAction(Actions.GET_GROUP_MEMBER_INFO); super.setAction(Actions.GET_GROUP_MEMBER_INFO);
super.setParams(new Params(groupId, userId, noCache)); super.setParams(new Params(groupId, userId, noCache));
} }
/** /**
* 获取群成员信息 * 获取群成员信息
*
* @param groupId 群号
* @param userId QQ
* @author wzp * @author wzp
* @since 2024/8/24 23:54 v0.0.6-dev * @since 2024/8/24 23:54 v0.0.6-dev
* @param groupId 群号
* @param userId QQ
*/ */
public GetGroupMemberInfoAction(Long groupId, Long userId) { public GetGroupMemberInfoAction(Long groupId, Long userId) {
this(groupId, userId, false); this(groupId, userId, false);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/24 23:02 v0.0.6-dev * @since 2024/8/24 23:02 v0.0.6-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* QQ * QQ
*
* @since 2024/8/24 23:02 v0.0.6-dev * @since 2024/8/24 23:02 v0.0.6-dev
*/ */
@JSONField(name = "user_id") @JSONField(name = "user_id")
private Long userId; private Long userId;
/** /**
* 是否不使用缓存 * 是否不使用缓存
*
* @since 2024/8/24 23:02 v0.0.6-dev * @since 2024/8/24 23:02 v0.0.6-dev
*/ */
@JSONField(name = "no_cache", defaultValue = "false") @JSONField(name = "no_cache", defaultValue = "false")

View File

@ -1,8 +1,8 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.GroupMemberInformation; import cn.wzpmc.entities.GroupMemberInformation;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@ -11,6 +11,7 @@ import java.util.List;
/** /**
* 获取群成员列表 * 获取群成员列表
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:42 * @since 2024/8/24 20:42
@ -18,19 +19,22 @@ import java.util.List;
public class GetGroupMemberListAction extends Action<GetGroupMemberListAction.Params, List<GroupMemberInformation>> { public class GetGroupMemberListAction extends Action<GetGroupMemberListAction.Params, List<GroupMemberInformation>> {
/** /**
* 获取群成员列表 * 获取群成员列表
*
* @param groupId 群号
* @author wzp * @author wzp
* @since 2024/8/24 23:54 v0.0.6-dev * @since 2024/8/24 23:54 v0.0.6-dev
* @param groupId 群号
*/ */
public GetGroupMemberListAction(Long groupId) { public GetGroupMemberListAction(Long groupId) {
super.setAction(Actions.GET_GROUP_MEMBER_LIST); super.setAction(Actions.GET_GROUP_MEMBER_LIST);
super.setParams(new Params(groupId)); super.setParams(new Params(groupId));
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/24 23:08 v0.0.6-dev * @since 2024/8/24 23:08 v0.0.6-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.FilePathInformation; import cn.wzpmc.entities.FilePathInformation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 获取图片 * 获取图片
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:44 * @since 2024/8/24 20:44
@ -15,19 +16,22 @@ import lombok.Data;
public class GetImageAction extends Action<GetImageAction.Params, FilePathInformation> { public class GetImageAction extends Action<GetImageAction.Params, FilePathInformation> {
/** /**
* 获取图片 * 获取图片
*
* @param file 收到的图片文件名消息段的 file 参数 6B4DE3DFD1BD271E3297859D41C530F5.jpg
* @author wzp * @author wzp
* @since 2024/8/24 23:55 v0.0.6-dev * @since 2024/8/24 23:55 v0.0.6-dev
* @param file 收到的图片文件名消息段的 file 参数 6B4DE3DFD1BD271E3297859D41C530F5.jpg
*/ */
public GetImageAction(String file) { public GetImageAction(String file) {
super.setAction(Actions.GET_IMAGE); super.setAction(Actions.GET_IMAGE);
super.setParams(new Params(file)); super.setParams(new Params(file));
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 收到的图片文件名消息段的 file 参数 6B4DE3DFD1BD271E3297859D41C530F5.jpg * 收到的图片文件名消息段的 file 参数 6B4DE3DFD1BD271E3297859D41C530F5.jpg
*
* @since 2024/8/24 23:41 v0.0.6-dev * @since 2024/8/24 23:41 v0.0.6-dev
*/ */
private String file; private String file;

View File

@ -1,11 +1,12 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.user.IBot; import cn.wzpmc.user.IBot;
/** /**
* 获取登录号信息 * 获取登录号信息
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:18 * @since 2024/8/24 20:18
@ -13,6 +14,7 @@ import cn.wzpmc.api.user.IBot;
public class GetLoginInfoAction extends Action<Void, IBot> { public class GetLoginInfoAction extends Action<Void, IBot> {
/** /**
* 获取登录号信息 * 获取登录号信息
*
* @author wzp * @author wzp
* @since 2024/8/24 23:55 v0.0.6-dev * @since 2024/8/24 23:55 v0.0.6-dev
*/ */

View File

@ -1,14 +1,15 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.MessageInformation; import cn.wzpmc.entities.MessageInformation;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 获取消息 * 获取消息
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/17 23:07 * @since 2024/8/17 23:07
@ -16,19 +17,22 @@ import lombok.Data;
public class GetMessageAction extends Action<GetMessageAction.Params, MessageInformation> { public class GetMessageAction extends Action<GetMessageAction.Params, MessageInformation> {
/** /**
* 获取消息 * 获取消息
*
* @param messageId 消息 ID
* @author wzp * @author wzp
* @since 2024/8/23 21:11 v0.0.5-dev * @since 2024/8/23 21:11 v0.0.5-dev
* @param messageId 消息 ID
*/ */
public GetMessageAction(Integer messageId){ public GetMessageAction(Integer messageId) {
super.setAction(Actions.GET_MSG); super.setAction(Actions.GET_MSG);
super.setParams(new Params(messageId)); super.setParams(new Params(messageId));
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static class Params { public static class Params {
/** /**
* 消息 ID * 消息 ID
*
* @since 2024/8/23 21:11 v0.0.5-dev * @since 2024/8/23 21:11 v0.0.5-dev
*/ */
@JSONField(name = "message_id") @JSONField(name = "message_id")

View File

@ -1,14 +1,15 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.FilePathInformation; import cn.wzpmc.entities.FilePathInformation;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 获取语音 * 获取语音
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:44 * @since 2024/8/24 20:44
@ -16,25 +17,29 @@ import lombok.Data;
public class GetRecordAction extends Action<GetRecordAction.Params, FilePathInformation> { public class GetRecordAction extends Action<GetRecordAction.Params, FilePathInformation> {
/** /**
* 获取语音 * 获取语音
*
* @param file 收到的语音文件名消息段的 file 参数 0B38145AA44505000B38145AA4450500.silk
* @param outFormat 要转换到的格式目前支持 mp3amrwmam4aspxoggwavflac
* @author wzp * @author wzp
* @since 2024/8/24 23:55 v0.0.6-dev * @since 2024/8/24 23:55 v0.0.6-dev
* @param file 收到的语音文件名消息段的 file 参数 0B38145AA44505000B38145AA4450500.silk
* @param outFormat 要转换到的格式目前支持 mp3amrwmam4aspxoggwavflac
*/ */
public GetRecordAction(String file, String outFormat){ public GetRecordAction(String file, String outFormat) {
super.setAction(Actions.GET_RECORD); super.setAction(Actions.GET_RECORD);
super.setParams(new Params(file, outFormat)); super.setParams(new Params(file, outFormat));
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 收到的语音文件名消息段的 file 参数 0B38145AA44505000B38145AA4450500.silk * 收到的语音文件名消息段的 file 参数 0B38145AA44505000B38145AA4450500.silk
*
* @since 2024/8/24 23:35 v0.0.6-dev * @since 2024/8/24 23:35 v0.0.6-dev
*/ */
private String file; private String file;
/** /**
* 要转换到的格式目前支持 mp3amrwmam4aspxoggwavflac * 要转换到的格式目前支持 mp3amrwmam4aspxoggwavflac
*
* @since 2024/8/24 23:35 v0.0.6-dev * @since 2024/8/24 23:35 v0.0.6-dev
*/ */
@JSONField(name = "out_format") @JSONField(name = "out_format")

View File

@ -1,11 +1,12 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.BotStatus; import cn.wzpmc.entities.BotStatus;
/** /**
* 获取运行状态 * 获取运行状态
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:45 * @since 2024/8/24 20:45
@ -13,10 +14,11 @@ import cn.wzpmc.api.entities.BotStatus;
public class GetStatusAction extends Action<Void, BotStatus> { public class GetStatusAction extends Action<Void, BotStatus> {
/** /**
* 获取运行状态 * 获取运行状态
*
* @author wzp * @author wzp
* @since 2024/8/24 23:55 v0.0.6-dev * @since 2024/8/24 23:55 v0.0.6-dev
*/ */
public GetStatusAction(){ public GetStatusAction() {
super.setAction(Actions.GET_STATUS); super.setAction(Actions.GET_STATUS);
} }
} }

View File

@ -1,14 +1,15 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.user.IUser; import cn.wzpmc.user.IUser;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 获取陌生人信息 * 获取陌生人信息
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:41 * @since 2024/8/24 20:41
@ -16,36 +17,41 @@ import lombok.Data;
public class GetStrangerInfoAction extends Action<GetStrangerInfoAction.Params, IUser> { public class GetStrangerInfoAction extends Action<GetStrangerInfoAction.Params, IUser> {
/** /**
* 获取陌生人信息 * 获取陌生人信息
*
* @param userId QQ
* @param noCache 是否不使用缓存使用缓存可能更新不及时但响应更快
* @author wzp * @author wzp
* @since 2024/8/24 23:55 v0.0.6-dev * @since 2024/8/24 23:55 v0.0.6-dev
* @param userId QQ
* @param noCache 是否不使用缓存使用缓存可能更新不及时但响应更快
*/ */
public GetStrangerInfoAction(Long userId, boolean noCache){ public GetStrangerInfoAction(Long userId, boolean noCache) {
super.setAction(Actions.GET_STRANGER_INFO); super.setAction(Actions.GET_STRANGER_INFO);
super.setParams(new GetStrangerInfoAction.Params(userId, noCache)); super.setParams(new GetStrangerInfoAction.Params(userId, noCache));
} }
/** /**
* 获取陌生人信息 * 获取陌生人信息
*
* @param userId QQ
* @author wzp * @author wzp
* @since 2024/8/24 23:55 v0.0.6-dev * @since 2024/8/24 23:55 v0.0.6-dev
* @param userId QQ
*/ */
public GetStrangerInfoAction(Long userId){ public GetStrangerInfoAction(Long userId) {
this(userId, false); this(userId, false);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* QQ * QQ
*
* @since 2024/8/24 22:52 v0.0.6-dev * @since 2024/8/24 22:52 v0.0.6-dev
*/ */
@JSONField(name = "user_id") @JSONField(name = "user_id")
private Long userId; private Long userId;
/** /**
* 是否不使用缓存使用缓存可能更新不及时但响应更快 * 是否不使用缓存使用缓存可能更新不及时但响应更快
*
* @since 2024/8/24 22:52 v0.0.6-dev * @since 2024/8/24 22:52 v0.0.6-dev
*/ */
@JSONField(name = "no_cache", defaultValue = "false") @JSONField(name = "no_cache", defaultValue = "false")

View File

@ -1,11 +1,12 @@
package cn.wzpmc.api.api.actions.message.get; package cn.wzpmc.api.actions.message.get;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.entities.VersionInformation; import cn.wzpmc.entities.VersionInformation;
/** /**
* 获取版本信息 * 获取版本信息
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:45 * @since 2024/8/24 20:45
@ -13,10 +14,11 @@ import cn.wzpmc.api.entities.VersionInformation;
public class GetVersionInfoAction extends Action<Void, VersionInformation> { public class GetVersionInfoAction extends Action<Void, VersionInformation> {
/** /**
* 获取版本信息 * 获取版本信息
*
* @author wzp * @author wzp
* @since 2024/8/24 23:55 v0.0.6-dev * @since 2024/8/24 23:55 v0.0.6-dev
*/ */
public GetVersionInfoAction(){ public GetVersionInfoAction() {
super.setAction(Actions.GET_VERSION_INFO); super.setAction(Actions.GET_VERSION_INFO);
} }

View File

@ -1,14 +1,15 @@
package cn.wzpmc.api.api.actions.message.send; package cn.wzpmc.api.actions.message.send;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.message.MessageComponent; import cn.wzpmc.message.MessageComponent;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 发送群消息 * 发送群消息
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/17 22:52 * @since 2024/8/17 22:52
@ -16,43 +17,49 @@ import lombok.Data;
public class SendGroupMessageAction extends Action<SendGroupMessageAction.Params, SendMessageActionResponseData> { public class SendGroupMessageAction extends Action<SendGroupMessageAction.Params, SendMessageActionResponseData> {
/** /**
* 发送群消息 * 发送群消息
*
* @param groupId 群号
* @param message 要发送的内容
* @param autoEscape 消息内容是否作为纯文本发送即不解析 CQ 只在 message 字段是字符串时有效
* @author wzp * @author wzp
* @since 2024/8/23 21:11 v0.0.5-dev * @since 2024/8/23 21:11 v0.0.5-dev
* @param groupId 群号
* @param message 要发送的内容
* @param autoEscape 消息内容是否作为纯文本发送即不解析 CQ 只在 message 字段是字符串时有效
*/ */
public SendGroupMessageAction(Long groupId, MessageComponent message, boolean autoEscape){ public SendGroupMessageAction(Long groupId, MessageComponent message, boolean autoEscape) {
super.setAction(Actions.SEND_GROUP_MSG); super.setAction(Actions.SEND_GROUP_MSG);
super.setParams(new SendGroupMessageAction.Params(groupId, message, autoEscape)); super.setParams(new SendGroupMessageAction.Params(groupId, message, autoEscape));
} }
/** /**
* 发送群消息 * 发送群消息
* @author wzp *
* @since 2024/8/23 21:11 v0.0.5-dev
* @param groupId 群号 * @param groupId 群号
* @param message 要发送的内容 * @param message 要发送的内容
* @author wzp
* @since 2024/8/23 21:11 v0.0.5-dev
*/ */
public SendGroupMessageAction(Long groupId, MessageComponent message){ public SendGroupMessageAction(Long groupId, MessageComponent message) {
this(groupId, message, false); this(groupId, message, false);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static class Params { public static class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/17 22:54 v0.0.5-dev * @since 2024/8/17 22:54 v0.0.5-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 要发送的内容 * 要发送的内容
*
* @since 2024/8/17 22:54 v0.0.5-dev * @since 2024/8/17 22:54 v0.0.5-dev
*/ */
private MessageComponent message; private MessageComponent message;
/** /**
* 消息内容是否作为纯文本发送即不解析 CQ 只在 message 字段是字符串时有效 * 消息内容是否作为纯文本发送即不解析 CQ 只在 message 字段是字符串时有效
*
* @since 2024/8/17 22:51 v0.0.5-dev * @since 2024/8/17 22:51 v0.0.5-dev
*/ */
@JSONField(name = "auto_escape") @JSONField(name = "auto_escape")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.send; package cn.wzpmc.api.actions.message.send;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 发送好友赞 * 发送好友赞
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/23 19:49 * @since 2024/8/23 19:49
@ -15,36 +16,41 @@ import lombok.Data;
public class SendLikeAction extends Action<SendLikeAction.Params, Void> { public class SendLikeAction extends Action<SendLikeAction.Params, Void> {
/** /**
* 发送好友赞 * 发送好友赞
*
* @param userId 对方 QQ
* @param times 赞的次数每个好友每天最多 10
* @author wzp * @author wzp
* @since 2024/8/23 21:12 v0.0.5-dev * @since 2024/8/23 21:12 v0.0.5-dev
* @param userId 对方 QQ
* @param times 赞的次数每个好友每天最多 10
*/ */
public SendLikeAction(Long userId, Long times){ public SendLikeAction(Long userId, Long times) {
super.setAction(Actions.SEND_LIKE); super.setAction(Actions.SEND_LIKE);
super.setParams(new Params(userId, times)); super.setParams(new Params(userId, times));
} }
/** /**
* 发送好友赞 * 发送好友赞
*
* @param userId 对方 QQ
* @author wzp * @author wzp
* @since 2024/8/23 21:12 v0.0.5-dev * @since 2024/8/23 21:12 v0.0.5-dev
* @param userId 对方 QQ
*/ */
public SendLikeAction(Long userId){ public SendLikeAction(Long userId) {
this(userId, 1L); this(userId, 1L);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 对方 QQ * 对方 QQ
*
* @since 2024/8/23 21:12 v0.0.5-dev * @since 2024/8/23 21:12 v0.0.5-dev
*/ */
@JSONField(name = "user_id") @JSONField(name = "user_id")
private Long userId; private Long userId;
/** /**
* 赞的次数每个好友每天最多 10 * 赞的次数每个好友每天最多 10
*
* @since 2024/8/23 21:12 v0.0.5-dev * @since 2024/8/23 21:12 v0.0.5-dev
*/ */
@JSONField(defaultValue = "1") @JSONField(defaultValue = "1")

View File

@ -1,10 +1,11 @@
package cn.wzpmc.api.api.actions.message.send; package cn.wzpmc.api.actions.message.send;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data; import lombok.Data;
/** /**
* 发送私聊消息返回 * 发送私聊消息返回
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/17 21:55 * @since 2024/8/17 21:55
@ -13,6 +14,7 @@ import lombok.Data;
public class SendMessageActionResponseData { public class SendMessageActionResponseData {
/** /**
* 消息 ID * 消息 ID
*
* @since 2024/8/17 22:51 v0.0.5-dev * @since 2024/8/17 22:51 v0.0.5-dev
*/ */
@JSONField(name = "message_id") @JSONField(name = "message_id")

View File

@ -1,14 +1,15 @@
package cn.wzpmc.api.api.actions.message.send; package cn.wzpmc.api.actions.message.send;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.message.MessageComponent; import cn.wzpmc.message.MessageComponent;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 发送私聊消息 * 发送私聊消息
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/17 21:54 * @since 2024/8/17 21:54
@ -16,43 +17,49 @@ import lombok.Data;
public class SendPrivateMessageAction extends Action<SendPrivateMessageAction.Params, SendMessageActionResponseData> { public class SendPrivateMessageAction extends Action<SendPrivateMessageAction.Params, SendMessageActionResponseData> {
/** /**
* 发送私聊消息 * 发送私聊消息
*
* @param userId 对方 QQ
* @param message 要发送的内容
* @param autoEscape 消息内容是否作为纯文本发送即不解析 CQ 只在 message 字段是字符串时有效
* @author wzp * @author wzp
* @since 2024/8/23 21:13 v0.0.5-dev * @since 2024/8/23 21:13 v0.0.5-dev
* @param userId 对方 QQ
* @param message 要发送的内容
* @param autoEscape 消息内容是否作为纯文本发送即不解析 CQ 只在 message 字段是字符串时有效
*/ */
public SendPrivateMessageAction(Long userId, MessageComponent message, boolean autoEscape){ public SendPrivateMessageAction(Long userId, MessageComponent message, boolean autoEscape) {
super.setAction(Actions.SEND_PRIVATE_MSG); super.setAction(Actions.SEND_PRIVATE_MSG);
super.setParams(new Params(userId, message, autoEscape)); super.setParams(new Params(userId, message, autoEscape));
} }
/** /**
* 发送私聊消息 * 发送私聊消息
*
* @param userId 对方 QQ
* @param message 要发送的内容
* @author wzp * @author wzp
* @since 2024/8/23 21:14 v0.0.5-dev * @since 2024/8/23 21:14 v0.0.5-dev
* @param userId 对方 QQ
* @param message 要发送的内容
*/ */
public SendPrivateMessageAction(Long userId, MessageComponent message){ public SendPrivateMessageAction(Long userId, MessageComponent message) {
this(userId, message, false); this(userId, message, false);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static class Params { public static class Params {
/** /**
* 对方 QQ * 对方 QQ
*
* @since 2024/8/17 22:51 v0.0.5-dev * @since 2024/8/17 22:51 v0.0.5-dev
*/ */
@JSONField(name = "user_id") @JSONField(name = "user_id")
private Long userId; private Long userId;
/** /**
* 要发送的内容 * 要发送的内容
*
* @since 2024/8/17 22:51 v0.0.5-dev * @since 2024/8/17 22:51 v0.0.5-dev
*/ */
private MessageComponent message; private MessageComponent message;
/** /**
* 消息内容是否作为纯文本发送即不解析 CQ 只在 message 字段是字符串时有效 * 消息内容是否作为纯文本发送即不解析 CQ 只在 message 字段是字符串时有效
*
* @since 2024/8/17 22:51 v0.0.5-dev * @since 2024/8/17 22:51 v0.0.5-dev
*/ */
@JSONField(name = "auto_escape") @JSONField(name = "auto_escape")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 处理加好友请求 * 处理加好友请求
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:08 * @since 2024/8/24 20:08
@ -15,23 +16,25 @@ import lombok.Data;
public class SetFriendAddRequestAction extends Action<SetFriendAddRequestAction.Params, Void> { public class SetFriendAddRequestAction extends Action<SetFriendAddRequestAction.Params, Void> {
/** /**
* 处理加好友请求 * 处理加好友请求
*
* @param flag 加好友请求的 flag需从上报的数据中获得
* @param approve 是否同意请求
* @param remark 添加后的好友备注仅在同意时有效
* @author wzp * @author wzp
* @since 2024/8/24 23:56 v0.0.6-dev * @since 2024/8/24 23:56 v0.0.6-dev
* @param flag 加好友请求的 flag需从上报的数据中获得
* @param approve 是否同意请求
* @param remark 添加后的好友备注仅在同意时有效
*/ */
public SetFriendAddRequestAction(String flag, boolean approve, String remark){ public SetFriendAddRequestAction(String flag, boolean approve, String remark) {
super.setAction(Actions.SET_FRIEND_ADD_REQUEST); super.setAction(Actions.SET_FRIEND_ADD_REQUEST);
super.setParams(new Params(flag, approve, remark)); super.setParams(new Params(flag, approve, remark));
} }
/** /**
* 处理加好友请求 * 处理加好友请求
*
* @param flag 加好友请求的 flag需从上报的数据中获得
* @param approve 是否同意请求
* @author wzp * @author wzp
* @since 2024/8/24 23:56 v0.0.6-dev * @since 2024/8/24 23:56 v0.0.6-dev
* @param flag 加好友请求的 flag需从上报的数据中获得
* @param approve 是否同意请求
*/ */
public SetFriendAddRequestAction(String flag, boolean approve) { public SetFriendAddRequestAction(String flag, boolean approve) {
this(flag, approve, ""); this(flag, approve, "");
@ -39,10 +42,11 @@ public class SetFriendAddRequestAction extends Action<SetFriendAddRequestAction.
/** /**
* 处理加好友请求 * 处理加好友请求
*
* @param flag 加好友请求的 flag需从上报的数据中获得
* @param remark 添加后的好友备注仅在同意时有效
* @author wzp * @author wzp
* @since 2024/8/24 23:56 v0.0.6-dev * @since 2024/8/24 23:56 v0.0.6-dev
* @param flag 加好友请求的 flag需从上报的数据中获得
* @param remark 添加后的好友备注仅在同意时有效
*/ */
public SetFriendAddRequestAction(String flag, String remark) { public SetFriendAddRequestAction(String flag, String remark) {
this(flag, true, remark); this(flag, true, remark);
@ -50,29 +54,34 @@ public class SetFriendAddRequestAction extends Action<SetFriendAddRequestAction.
/** /**
* 处理加好友请求 * 处理加好友请求
*
* @param flag 加好友请求的 flag需从上报的数据中获得
* @author wzp * @author wzp
* @since 2024/8/24 23:56 v0.0.6-dev * @since 2024/8/24 23:56 v0.0.6-dev
* @param flag 加好友请求的 flag需从上报的数据中获得
*/ */
public SetFriendAddRequestAction(String flag) { public SetFriendAddRequestAction(String flag) {
this(flag, true); this(flag, true);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 加好友请求的 flag需从上报的数据中获得 * 加好友请求的 flag需从上报的数据中获得
*
* @since 2024/8/24 21:09 v0.0.6-dev * @since 2024/8/24 21:09 v0.0.6-dev
*/ */
private String flag; private String flag;
/** /**
* 是否同意请求 * 是否同意请求
*
* @since 2024/8/24 21:09 v0.0.6-dev * @since 2024/8/24 21:09 v0.0.6-dev
*/ */
@JSONField(defaultValue = "true") @JSONField(defaultValue = "true")
private boolean approve; private boolean approve;
/** /**
* 添加后的好友备注仅在同意时有效 * 添加后的好友备注仅在同意时有效
*
* @since 2024/8/24 21:09 v0.0.6-dev * @since 2024/8/24 21:09 v0.0.6-dev
*/ */
private String remark; private String remark;

View File

@ -1,14 +1,15 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.events.request.group.GroupJoinRequestEventSubType; import cn.wzpmc.events.request.group.GroupJoinRequestEventSubType;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 处理加群请求邀请 * 处理加群请求邀请
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:18 * @since 2024/8/24 20:18
@ -16,12 +17,13 @@ import lombok.Data;
public class SetGroupAddRequestAction extends Action<SetGroupAddRequestAction.Params, Void> { public class SetGroupAddRequestAction extends Action<SetGroupAddRequestAction.Params, Void> {
/** /**
* 处理加群请求邀请 * 处理加群请求邀请
*
* @param flag 加群请求的 flag需从上报的数据中获得
* @param type 请求类型
* @param approve 是否同意请求邀请
* @param reason 拒绝理由仅在拒绝时有效
* @author wzp * @author wzp
* @since 2024/8/24 23:56 v0.0.6-dev * @since 2024/8/24 23:56 v0.0.6-dev
* @param flag 加群请求的 flag需从上报的数据中获得
* @param type 请求类型
* @param approve 是否同意请求邀请
* @param reason 拒绝理由仅在拒绝时有效
*/ */
public SetGroupAddRequestAction(String flag, GroupJoinRequestEventSubType type, boolean approve, String reason) { public SetGroupAddRequestAction(String flag, GroupJoinRequestEventSubType type, boolean approve, String reason) {
super.setAction(Actions.SET_GROUP_ADD_REQUEST); super.setAction(Actions.SET_GROUP_ADD_REQUEST);
@ -30,11 +32,12 @@ public class SetGroupAddRequestAction extends Action<SetGroupAddRequestAction.Pa
/** /**
* 处理加群请求邀请 * 处理加群请求邀请
*
* @param flag 加群请求的 flag需从上报的数据中获得
* @param type 请求类型
* @param reason 拒绝理由仅在拒绝时有效
* @author wzp * @author wzp
* @since 2024/8/24 23:56 v0.0.6-dev * @since 2024/8/24 23:56 v0.0.6-dev
* @param flag 加群请求的 flag需从上报的数据中获得
* @param type 请求类型
* @param reason 拒绝理由仅在拒绝时有效
*/ */
public SetGroupAddRequestAction(String flag, GroupJoinRequestEventSubType type, String reason) { public SetGroupAddRequestAction(String flag, GroupJoinRequestEventSubType type, String reason) {
this(flag, type, false, reason); this(flag, type, false, reason);
@ -42,35 +45,41 @@ public class SetGroupAddRequestAction extends Action<SetGroupAddRequestAction.Pa
/** /**
* 处理加群请求邀请 * 处理加群请求邀请
* @author wzp *
* @since 2024/8/24 23:56 v0.0.6-dev
* @param flag 加群请求的 flag需从上报的数据中获得 * @param flag 加群请求的 flag需从上报的数据中获得
* @param type 请求类型 * @param type 请求类型
* @author wzp
* @since 2024/8/24 23:56 v0.0.6-dev
*/ */
public SetGroupAddRequestAction(String flag, GroupJoinRequestEventSubType type) { public SetGroupAddRequestAction(String flag, GroupJoinRequestEventSubType type) {
this(flag, type, true, ""); this(flag, type, true, "");
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 加群请求的 flag需从上报的数据中获得 * 加群请求的 flag需从上报的数据中获得
*
* @since 2024/8/24 21:14 v0.0.6-dev * @since 2024/8/24 21:14 v0.0.6-dev
*/ */
private String flag; private String flag;
/** /**
* 请求类型 * 请求类型
*
* @since 2024/8/24 21:14 v0.0.6-dev * @since 2024/8/24 21:14 v0.0.6-dev
*/ */
private GroupJoinRequestEventSubType type; private GroupJoinRequestEventSubType type;
/** /**
* 是否同意请求邀请 * 是否同意请求邀请
*
* @since 2024/8/24 21:14 v0.0.6-dev * @since 2024/8/24 21:14 v0.0.6-dev
*/ */
@JSONField(defaultValue = "true") @JSONField(defaultValue = "true")
private boolean approve; private boolean approve;
/** /**
* 拒绝理由仅在拒绝时有效 * 拒绝理由仅在拒绝时有效
*
* @since 2024/8/24 21:14 v0.0.6-dev * @since 2024/8/24 21:14 v0.0.6-dev
*/ */
private String reason; private String reason;

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 群组设置管理员 * 群组设置管理员
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/23 20:51 * @since 2024/8/23 20:51
@ -15,44 +16,50 @@ import lombok.Data;
public class SetGroupAdminAction extends Action<SetGroupAdminAction.Params, Void> { public class SetGroupAdminAction extends Action<SetGroupAdminAction.Params, Void> {
/** /**
* 群组设置管理员 * 群组设置管理员
*
* @param groupId 群号
* @param userId 要设置管理员的 QQ
* @param enable true 为设置false 为取消
* @author wzp * @author wzp
* @since 2024/8/23 21:14 v0.0.5-dev * @since 2024/8/23 21:14 v0.0.5-dev
* @param groupId 群号
* @param userId 要设置管理员的 QQ
* @param enable true 为设置false 为取消
*/ */
public SetGroupAdminAction(Long groupId, Long userId, Boolean enable){ public SetGroupAdminAction(Long groupId, Long userId, Boolean enable) {
super.setAction(Actions.SET_GROUP_ADMIN); super.setAction(Actions.SET_GROUP_ADMIN);
super.setParams(new Params(groupId, userId, enable)); super.setParams(new Params(groupId, userId, enable));
} }
/** /**
* 群组设置管理员 * 群组设置管理员
*
* @param groupId 群号
* @param userId 要设置管理员的 QQ
* @author wzp * @author wzp
* @since 2024/8/23 21:14 v0.0.5-dev * @since 2024/8/23 21:14 v0.0.5-dev
* @param groupId 群号
* @param userId 要设置管理员的 QQ
*/ */
public SetGroupAdminAction(Long groupId, Long userId) { public SetGroupAdminAction(Long groupId, Long userId) {
this(groupId, userId, true); this(groupId, userId, true);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/23 21:15 v0.0.5-dev * @since 2024/8/23 21:15 v0.0.5-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 要设置管理员的 QQ * 要设置管理员的 QQ
*
* @since 2024/8/23 21:15 v0.0.5-dev * @since 2024/8/23 21:15 v0.0.5-dev
*/ */
@JSONField(name = "user_id") @JSONField(name = "user_id")
private Long userId; private Long userId;
/** /**
* true 为设置false 为取消 * true 为设置false 为取消
*
* @since 2024/8/23 21:15 v0.0.5-dev * @since 2024/8/23 21:15 v0.0.5-dev
*/ */
@JSONField(defaultValue = "true") @JSONField(defaultValue = "true")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 群组匿名 * 群组匿名
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/23 20:55 * @since 2024/8/23 20:55
@ -15,10 +16,11 @@ import lombok.Data;
public class SetGroupAnonymousAction extends Action<SetGroupAnonymousAction.Params, Void> { public class SetGroupAnonymousAction extends Action<SetGroupAnonymousAction.Params, Void> {
/** /**
* 群组匿名 * 群组匿名
*
* @param groupId 群号
* @param enable 是否允许匿名聊天
* @author wzp * @author wzp
* @since 2024/8/23 21:16 v0.0.5-dev * @since 2024/8/23 21:16 v0.0.5-dev
* @param groupId 群号
* @param enable 是否允许匿名聊天
*/ */
public SetGroupAnonymousAction(Long groupId, Boolean enable) { public SetGroupAnonymousAction(Long groupId, Boolean enable) {
super.setAction(Actions.SET_GROUP_ANONYMOUS); super.setAction(Actions.SET_GROUP_ANONYMOUS);
@ -27,24 +29,28 @@ public class SetGroupAnonymousAction extends Action<SetGroupAnonymousAction.Para
/** /**
* 群组匿名 * 群组匿名
*
* @param groupId 群号
* @author wzp * @author wzp
* @since 2024/8/23 21:16 v0.0.5-dev * @since 2024/8/23 21:16 v0.0.5-dev
* @param groupId 群号
*/ */
public SetGroupAnonymousAction(Long groupId) { public SetGroupAnonymousAction(Long groupId) {
this(groupId, true); this(groupId, true);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/23 21:16 v0.0.5-dev * @since 2024/8/23 21:16 v0.0.5-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 是否允许匿名聊天 * 是否允许匿名聊天
*
* @since 2024/8/23 21:16 v0.0.5-dev * @since 2024/8/23 21:16 v0.0.5-dev
*/ */
@JSONField(defaultValue = "true") @JSONField(defaultValue = "true")

View File

@ -1,14 +1,15 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import cn.wzpmc.api.message.json.parts.Anonymous; import cn.wzpmc.message.json.parts.Anonymous;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 群组匿名用户禁言 * 群组匿名用户禁言
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/23 20:08 * @since 2024/8/23 20:08
@ -16,12 +17,13 @@ import lombok.Data;
public class SetGroupAnonymousBanAction extends Action<SetGroupAnonymousBanAction.Params, Void> { public class SetGroupAnonymousBanAction extends Action<SetGroupAnonymousBanAction.Params, Void> {
/** /**
* 群组匿名用户禁言 * 群组匿名用户禁言
*
* @param groupId 群号
* @param anonymous 可选要禁言的匿名用户对象群消息上报的 anonymous 字段
* @param flag 可选要禁言的匿名用户的 flag需从群消息上报的数据中获得
* @param duration 禁言时长单位秒无法取消匿名用户禁言默认30 * 60
* @author wzp * @author wzp
* @since 2024/8/23 21:17 v0.0.5-dev * @since 2024/8/23 21:17 v0.0.5-dev
* @param groupId 群号
* @param anonymous 可选要禁言的匿名用户对象群消息上报的 anonymous 字段
* @param flag 可选要禁言的匿名用户的 flag需从群消息上报的数据中获得
* @param duration 禁言时长单位秒无法取消匿名用户禁言默认30 * 60
*/ */
protected SetGroupAnonymousBanAction(Long groupId, Anonymous anonymous, String flag, Long duration) { protected SetGroupAnonymousBanAction(Long groupId, Anonymous anonymous, String flag, Long duration) {
super.setAction(Actions.SET_GROUP_ANONYMOUS_BAN); super.setAction(Actions.SET_GROUP_ANONYMOUS_BAN);
@ -30,11 +32,12 @@ public class SetGroupAnonymousBanAction extends Action<SetGroupAnonymousBanActio
/** /**
* 群组匿名用户禁言 * 群组匿名用户禁言
*
* @param groupId 群号
* @param anonymous 要禁言的匿名用户对象群消息上报的 anonymous 字段
* @param duration 禁言时长单位秒无法取消匿名用户禁言
* @author wzp * @author wzp
* @since 2024/8/23 21:17 v0.0.5-dev * @since 2024/8/23 21:17 v0.0.5-dev
* @param groupId 群号
* @param anonymous 要禁言的匿名用户对象群消息上报的 anonymous 字段
* @param duration 禁言时长单位秒无法取消匿名用户禁言
*/ */
public SetGroupAnonymousBanAction(Long groupId, Anonymous anonymous, Long duration) { public SetGroupAnonymousBanAction(Long groupId, Anonymous anonymous, Long duration) {
this(groupId, anonymous, null, duration); this(groupId, anonymous, null, duration);
@ -42,10 +45,11 @@ public class SetGroupAnonymousBanAction extends Action<SetGroupAnonymousBanActio
/** /**
* 群组匿名用户禁言 * 群组匿名用户禁言
*
* @param groupId 群号
* @param anonymous 要禁言的匿名用户对象群消息上报的 anonymous 字段
* @author wzp * @author wzp
* @since 2024/8/23 21:17 v0.0.5-dev * @since 2024/8/23 21:17 v0.0.5-dev
* @param groupId 群号
* @param anonymous 要禁言的匿名用户对象群消息上报的 anonymous 字段
*/ */
public SetGroupAnonymousBanAction(Long groupId, Anonymous anonymous) { public SetGroupAnonymousBanAction(Long groupId, Anonymous anonymous) {
this(groupId, anonymous, 1800L); this(groupId, anonymous, 1800L);
@ -53,11 +57,12 @@ public class SetGroupAnonymousBanAction extends Action<SetGroupAnonymousBanActio
/** /**
* 群组匿名用户禁言 * 群组匿名用户禁言
*
* @param groupId 群号
* @param flag 要禁言的匿名用户的 flag需从群消息上报的数据中获得
* @param duration 禁言时长单位秒无法取消匿名用户禁言
* @author wzp * @author wzp
* @since 2024/8/23 21:17 v0.0.5-dev * @since 2024/8/23 21:17 v0.0.5-dev
* @param groupId 群号
* @param flag 要禁言的匿名用户的 flag需从群消息上报的数据中获得
* @param duration 禁言时长单位秒无法取消匿名用户禁言
*/ */
public SetGroupAnonymousBanAction(Long groupId, String flag, Long duration) { public SetGroupAnonymousBanAction(Long groupId, String flag, Long duration) {
this(groupId, null, flag, duration); this(groupId, null, flag, duration);
@ -65,35 +70,41 @@ public class SetGroupAnonymousBanAction extends Action<SetGroupAnonymousBanActio
/** /**
* 群组匿名用户禁言 * 群组匿名用户禁言
*
* @param groupId 群号
* @param flag 要禁言的匿名用户的 flag需从群消息上报的数据中获得
* @author wzp * @author wzp
* @since 2024/8/23 21:17 v0.0.5-dev * @since 2024/8/23 21:17 v0.0.5-dev
* @param groupId 群号
* @param flag 要禁言的匿名用户的 flag需从群消息上报的数据中获得
*/ */
public SetGroupAnonymousBanAction(Long groupId, String flag) { public SetGroupAnonymousBanAction(Long groupId, String flag) {
this(groupId, flag, 1800L); this(groupId, flag, 1800L);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/23 21:17 v0.0.5-dev * @since 2024/8/23 21:17 v0.0.5-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 可选要禁言的匿名用户对象群消息上报的 anonymous 字段 * 可选要禁言的匿名用户对象群消息上报的 anonymous 字段
*
* @since 2024/8/23 21:17 v0.0.5-dev * @since 2024/8/23 21:17 v0.0.5-dev
*/ */
private Anonymous anonymous; private Anonymous anonymous;
/** /**
* 可选要禁言的匿名用户的 flag需从群消息上报的数据中获得 * 可选要禁言的匿名用户的 flag需从群消息上报的数据中获得
*
* @since 2024/8/23 21:17 v0.0.5-dev * @since 2024/8/23 21:17 v0.0.5-dev
*/ */
private String flag; private String flag;
/** /**
* 禁言时长单位秒无法取消匿名用户禁言默认30 * 60 * 禁言时长单位秒无法取消匿名用户禁言默认30 * 60
*
* @since 2024/8/23 21:17 v0.0.5-dev * @since 2024/8/23 21:17 v0.0.5-dev
*/ */
@JSONField(defaultValue = "1800") @JSONField(defaultValue = "1800")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 群组单人禁言 * 群组单人禁言
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/23 20:03 * @since 2024/8/23 20:03
@ -15,44 +16,50 @@ import lombok.Data;
public class SetGroupBanAction extends Action<SetGroupBanAction.Params, Void> { public class SetGroupBanAction extends Action<SetGroupBanAction.Params, Void> {
/** /**
* 群组单人禁言 * 群组单人禁言
*
* @param groupId 群号
* @param userId 要禁言的 QQ
* @param duration 禁言时长单位秒0 表示取消禁言
* @author wzp * @author wzp
* @since 2024/8/23 21:20 v0.0.5-dev * @since 2024/8/23 21:20 v0.0.5-dev
* @param groupId 群号
* @param userId 要禁言的 QQ
* @param duration 禁言时长单位秒0 表示取消禁言
*/ */
public SetGroupBanAction(Long groupId, Long userId, Long duration){ public SetGroupBanAction(Long groupId, Long userId, Long duration) {
super.setAction(Actions.SET_GROUP_BAN); super.setAction(Actions.SET_GROUP_BAN);
super.setParams(new Params(groupId, userId, duration)); super.setParams(new Params(groupId, userId, duration));
} }
/** /**
* 群组单人禁言 * 群组单人禁言
*
* @param groupId 群号
* @param userId 要禁言的 QQ
* @author wzp * @author wzp
* @since 2024/8/23 21:20 v0.0.5-dev * @since 2024/8/23 21:20 v0.0.5-dev
* @param groupId 群号
* @param userId 要禁言的 QQ
*/ */
public SetGroupBanAction(Long groupId, Long userId){ public SetGroupBanAction(Long groupId, Long userId) {
this(groupId, userId, 1800L); this(groupId, userId, 1800L);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/23 21:20 v0.0.5-dev * @since 2024/8/23 21:20 v0.0.5-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 要禁言的 QQ * 要禁言的 QQ
*
* @since 2024/8/23 21:20 v0.0.5-dev * @since 2024/8/23 21:20 v0.0.5-dev
*/ */
@JSONField(name = "user_id") @JSONField(name = "user_id")
private Long userId; private Long userId;
/** /**
* 禁言时长单位秒0 表示取消禁言默认30 * 60 * 禁言时长单位秒0 表示取消禁言默认30 * 60
*
* @since 2024/8/23 21:20 v0.0.5-dev * @since 2024/8/23 21:20 v0.0.5-dev
*/ */
@JSONField(defaultValue = "1800") @JSONField(defaultValue = "1800")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 设置群名片群备注 * 设置群名片群备注
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/23 20:59 * @since 2024/8/23 20:59
@ -15,11 +16,12 @@ import lombok.Data;
public class SetGroupCardAction extends Action<SetGroupCardAction.Params, Void> { public class SetGroupCardAction extends Action<SetGroupCardAction.Params, Void> {
/** /**
* 设置群名片群备注 * 设置群名片群备注
*
* @param groupId 群号
* @param userId 要设置的 QQ
* @param card 群名片内容不填或空字符串表示删除群名片
* @author wzp * @author wzp
* @since 2024/8/23 21:22 v0.0.5-dev * @since 2024/8/23 21:22 v0.0.5-dev
* @param groupId 群号
* @param userId 要设置的 QQ
* @param card 群名片内容不填或空字符串表示删除群名片
*/ */
public SetGroupCardAction(Long groupId, Long userId, String card) { public SetGroupCardAction(Long groupId, Long userId, String card) {
super.setAction(Actions.SET_GROUP_CARD); super.setAction(Actions.SET_GROUP_CARD);
@ -28,31 +30,36 @@ public class SetGroupCardAction extends Action<SetGroupCardAction.Params, Void>
/** /**
* 设置群名片群备注 * 设置群名片群备注
*
* @param groupId 群号
* @param userId 要设置的 QQ
* @author wzp * @author wzp
* @since 2024/8/23 21:22 v0.0.5-dev * @since 2024/8/23 21:22 v0.0.5-dev
* @param groupId 群号
* @param userId 要设置的 QQ
*/ */
public SetGroupCardAction(Long groupId, Long userId) { public SetGroupCardAction(Long groupId, Long userId) {
this(groupId, userId, ""); this(groupId, userId, "");
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/23 21:23 v0.0.5-dev * @since 2024/8/23 21:23 v0.0.5-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 要设置的 QQ * 要设置的 QQ
*
* @since 2024/8/23 21:23 v0.0.5-dev * @since 2024/8/23 21:23 v0.0.5-dev
*/ */
@JSONField(name = "user_id") @JSONField(name = "user_id")
private Long userId; private Long userId;
/** /**
* 群名片内容不填或空字符串表示删除群名片默认为空 * 群名片内容不填或空字符串表示删除群名片默认为空
*
* @since 2024/8/23 21:23 v0.0.5-dev * @since 2024/8/23 21:23 v0.0.5-dev
*/ */
private String card; private String card;

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 群组踢人 * 群组踢人
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/23 19:52 * @since 2024/8/23 19:52
@ -15,11 +16,12 @@ import lombok.Data;
public class SetGroupKickAction extends Action<SetGroupKickAction.Params, Void> { public class SetGroupKickAction extends Action<SetGroupKickAction.Params, Void> {
/** /**
* 群组踢人 * 群组踢人
*
* @param groupId 群号
* @param userId 要踢的 QQ
* @param rejectAddRequest 拒绝此人的加群请求
* @author wzp * @author wzp
* @since 2024/8/23 21:24 v0.0.5-dev * @since 2024/8/23 21:24 v0.0.5-dev
* @param groupId 群号
* @param userId 要踢的 QQ
* @param rejectAddRequest 拒绝此人的加群请求
*/ */
public SetGroupKickAction(Long groupId, Long userId, Boolean rejectAddRequest) { public SetGroupKickAction(Long groupId, Long userId, Boolean rejectAddRequest) {
super.setAction(Actions.SET_GROUP_KICK); super.setAction(Actions.SET_GROUP_KICK);
@ -28,31 +30,36 @@ public class SetGroupKickAction extends Action<SetGroupKickAction.Params, Void>
/** /**
* 群组踢人 * 群组踢人
*
* @param groupId 群号
* @param userId 要踢的 QQ
* @author wzp * @author wzp
* @since 2024/8/23 21:24 v0.0.5-dev * @since 2024/8/23 21:24 v0.0.5-dev
* @param groupId 群号
* @param userId 要踢的 QQ
*/ */
public SetGroupKickAction(Long groupId, Long userId) { public SetGroupKickAction(Long groupId, Long userId) {
this(groupId, userId, false); this(groupId, userId, false);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/23 21:25 v0.0.5-dev * @since 2024/8/23 21:25 v0.0.5-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 要踢的 QQ * 要踢的 QQ
*
* @since 2024/8/23 21:25 v0.0.5-dev * @since 2024/8/23 21:25 v0.0.5-dev
*/ */
@JSONField(name = "user_id") @JSONField(name = "user_id")
private Long userId; private Long userId;
/** /**
* 拒绝此人的加群请求默认为false * 拒绝此人的加群请求默认为false
*
* @since 2024/8/23 21:25 v0.0.5-dev * @since 2024/8/23 21:25 v0.0.5-dev
*/ */
@JSONField(name = "reject_add_request", defaultValue = "false") @JSONField(name = "reject_add_request", defaultValue = "false")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 退出群组 * 退出群组
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:07 * @since 2024/8/24 20:07
@ -15,36 +16,41 @@ import lombok.Data;
public class SetGroupLeaveAction extends Action<SetGroupLeaveAction.Params, Void> { public class SetGroupLeaveAction extends Action<SetGroupLeaveAction.Params, Void> {
/** /**
* 退出群组 * 退出群组
*
* @param groupId 群号
* @param isDismiss 是否解散如果登录号是群主则仅在此项为 true 时能够解散
* @author wzp * @author wzp
* @since 2024/8/24 23:57 v0.0.6-dev * @since 2024/8/24 23:57 v0.0.6-dev
* @param groupId 群号
* @param isDismiss 是否解散如果登录号是群主则仅在此项为 true 时能够解散
*/ */
public SetGroupLeaveAction(Long groupId, boolean isDismiss){ public SetGroupLeaveAction(Long groupId, boolean isDismiss) {
super.setAction(Actions.SET_GROUP_LEAVE); super.setAction(Actions.SET_GROUP_LEAVE);
super.setParams(new Params(groupId, isDismiss)); super.setParams(new Params(groupId, isDismiss));
} }
/** /**
* 退出群组 * 退出群组
*
* @param groupId 群号
* @author wzp * @author wzp
* @since 2024/8/24 23:57 v0.0.6-dev * @since 2024/8/24 23:57 v0.0.6-dev
* @param groupId 群号
*/ */
public SetGroupLeaveAction(Long groupId){ public SetGroupLeaveAction(Long groupId) {
this(groupId, false); this(groupId, false);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/24 21:02 v0.0.6-dev * @since 2024/8/24 21:02 v0.0.6-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 是否解散如果登录号是群主则仅在此项为 true 时能够解散 * 是否解散如果登录号是群主则仅在此项为 true 时能够解散
*
* @since 2024/8/24 21:02 v0.0.6-dev * @since 2024/8/24 21:02 v0.0.6-dev
*/ */
@JSONField(name = "is_dismiss", defaultValue = "false") @JSONField(name = "is_dismiss", defaultValue = "false")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 设置群名 * 设置群名
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:07 * @since 2024/8/24 20:07
@ -15,26 +16,30 @@ import lombok.Data;
public class SetGroupNameAction extends Action<SetGroupNameAction.Params, Void> { public class SetGroupNameAction extends Action<SetGroupNameAction.Params, Void> {
/** /**
* 设置群名 * 设置群名
*
* @param groupId 群号
* @param groupName 新群名
* @author wzp * @author wzp
* @since 2024/8/24 23:57 v0.0.6-dev * @since 2024/8/24 23:57 v0.0.6-dev
* @param groupId 群号
* @param groupName 新群名
*/ */
public SetGroupNameAction(Long groupId, String groupName){ public SetGroupNameAction(Long groupId, String groupName) {
super.setAction(Actions.SET_GROUP_NAME); super.setAction(Actions.SET_GROUP_NAME);
super.setParams(new Params(groupId, groupName)); super.setParams(new Params(groupId, groupName));
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/24 20:59 v0.0.6-dev * @since 2024/8/24 20:59 v0.0.6-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 新群名 * 新群名
*
* @since 2024/8/24 21:00 v0.0.6-dev * @since 2024/8/24 21:00 v0.0.6-dev
*/ */
@JSONField(name = "group_name") @JSONField(name = "group_name")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 设置群组专属头衔 * 设置群组专属头衔
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:08 * @since 2024/8/24 20:08
@ -15,75 +16,84 @@ import lombok.Data;
public class SetGroupSpecialTitleAction extends Action<SetGroupSpecialTitleAction.Params, Void> { public class SetGroupSpecialTitleAction extends Action<SetGroupSpecialTitleAction.Params, Void> {
/** /**
* 设置群组专属头衔 * 设置群组专属头衔
*
* @param groupId 群号
* @param userId 要设置的 QQ
* @param specialTitle 专属头衔不填或空字符串表示删除专属头衔
* @param duration 专属头衔有效期单位秒-1 表示永久不过此项似乎没有效果可能是只有某些特殊的时间长度有效有待测试
* @author wzp * @author wzp
* @since 2024/8/24 23:58 v0.0.6-dev * @since 2024/8/24 23:58 v0.0.6-dev
* @param groupId 群号
* @param userId 要设置的 QQ
* @param specialTitle 专属头衔不填或空字符串表示删除专属头衔
* @param duration 专属头衔有效期单位秒-1 表示永久不过此项似乎没有效果可能是只有某些特殊的时间长度有效有待测试
*/ */
public SetGroupSpecialTitleAction(Long groupId, Long userId, String specialTitle, Long duration){ public SetGroupSpecialTitleAction(Long groupId, Long userId, String specialTitle, Long duration) {
super.setAction(Actions.SET_GROUP_SPECIAL_TITLE); super.setAction(Actions.SET_GROUP_SPECIAL_TITLE);
super.setParams(new Params(groupId, userId, specialTitle, duration)); super.setParams(new Params(groupId, userId, specialTitle, duration));
} }
/** /**
* 设置群组专属头衔 * 设置群组专属头衔
*
* @param groupId 群号
* @param userId 要设置的 QQ
* @param specialTitle 专属头衔不填或空字符串表示删除专属头衔
* @author wzp * @author wzp
* @since 2024/8/24 23:58 v0.0.6-dev * @since 2024/8/24 23:58 v0.0.6-dev
* @param groupId 群号
* @param userId 要设置的 QQ
* @param specialTitle 专属头衔不填或空字符串表示删除专属头衔
*/ */
public SetGroupSpecialTitleAction(Long groupId, Long userId, String specialTitle){ public SetGroupSpecialTitleAction(Long groupId, Long userId, String specialTitle) {
this(groupId, userId, specialTitle, -1L); this(groupId, userId, specialTitle, -1L);
} }
/** /**
* 设置群组专属头衔 * 设置群组专属头衔
*
* @param groupId 群号
* @param userId 要设置的 QQ
* @author wzp * @author wzp
* @since 2024/8/24 23:58 v0.0.6-dev * @since 2024/8/24 23:58 v0.0.6-dev
* @param groupId 群号
* @param userId 要设置的 QQ
*/ */
public SetGroupSpecialTitleAction(Long groupId, Long userId){ public SetGroupSpecialTitleAction(Long groupId, Long userId) {
this(groupId, userId, ""); this(groupId, userId, "");
} }
/** /**
* 设置群组专属头衔 * 设置群组专属头衔
*
* @param groupId 群号
* @param userId 要设置的 QQ
* @param duration 专属头衔有效期单位秒-1 表示永久不过此项似乎没有效果可能是只有某些特殊的时间长度有效有待测试
* @author wzp * @author wzp
* @since 2024/8/24 23:58 v0.0.6-dev * @since 2024/8/24 23:58 v0.0.6-dev
* @param groupId 群号
* @param userId 要设置的 QQ
* @param duration 专属头衔有效期单位秒-1 表示永久不过此项似乎没有效果可能是只有某些特殊的时间长度有效有待测试
*/ */
public SetGroupSpecialTitleAction(Long groupId, Long userId, Long duration){ public SetGroupSpecialTitleAction(Long groupId, Long userId, Long duration) {
this(groupId, userId, "", duration); this(groupId, userId, "", duration);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/24 21:04 v0.0.6-dev * @since 2024/8/24 21:04 v0.0.6-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 要设置的 QQ * 要设置的 QQ
*
* @since 2024/8/24 21:04 v0.0.6-dev * @since 2024/8/24 21:04 v0.0.6-dev
*/ */
@JSONField(name = "user_id") @JSONField(name = "user_id")
private Long userId; private Long userId;
/** /**
* 专属头衔不填或空字符串表示删除专属头衔 * 专属头衔不填或空字符串表示删除专属头衔
*
* @since 2024/8/24 21:04 v0.0.6-dev * @since 2024/8/24 21:04 v0.0.6-dev
*/ */
@JSONField(name = "special_title") @JSONField(name = "special_title")
private String specialTitle; private String specialTitle;
/** /**
* 专属头衔有效期单位秒-1 表示永久不过此项似乎没有效果可能是只有某些特殊的时间长度有效有待测试 * 专属头衔有效期单位秒-1 表示永久不过此项似乎没有效果可能是只有某些特殊的时间长度有效有待测试
*
* @since 2024/8/24 21:04 v0.0.6-dev * @since 2024/8/24 21:04 v0.0.6-dev
*/ */
@JSONField(defaultValue = "-1") @JSONField(defaultValue = "-1")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 群组全员禁言 * 群组全员禁言
*
* @author wzp * @author wzp
* @version 0.0.5-dev * @version 0.0.5-dev
* @since 2024/8/23 20:06 * @since 2024/8/23 20:06
@ -15,10 +16,11 @@ import lombok.Data;
public class SetGroupWholeBanAction extends Action<SetGroupWholeBanAction.Params, Void> { public class SetGroupWholeBanAction extends Action<SetGroupWholeBanAction.Params, Void> {
/** /**
* 群组全员禁言 * 群组全员禁言
*
* @param groupId 群号
* @param enable 是否禁言
* @author wzp * @author wzp
* @since 2024/8/23 21:27 v0.0.5-dev * @since 2024/8/23 21:27 v0.0.5-dev
* @param groupId 群号
* @param enable 是否禁言
*/ */
public SetGroupWholeBanAction(Long groupId, Boolean enable) { public SetGroupWholeBanAction(Long groupId, Boolean enable) {
super.setAction(Actions.SET_GROUP_WHOLE_BAN); super.setAction(Actions.SET_GROUP_WHOLE_BAN);
@ -27,24 +29,28 @@ public class SetGroupWholeBanAction extends Action<SetGroupWholeBanAction.Params
/** /**
* 群组全员禁言 * 群组全员禁言
*
* @param groupId 群号
* @author wzp * @author wzp
* @since 2024/8/23 21:28 v0.0.5-dev * @since 2024/8/23 21:28 v0.0.5-dev
* @param groupId 群号
*/ */
public SetGroupWholeBanAction(Long groupId) { public SetGroupWholeBanAction(Long groupId) {
this(groupId, true); this(groupId, true);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 群号 * 群号
*
* @since 2024/8/23 21:28 v0.0.5-dev * @since 2024/8/23 21:28 v0.0.5-dev
*/ */
@JSONField(name = "group_id") @JSONField(name = "group_id")
private Long groupId; private Long groupId;
/** /**
* 是否禁言默认true * 是否禁言默认true
*
* @since 2024/8/23 21:28 v0.0.5-dev * @since 2024/8/23 21:28 v0.0.5-dev
*/ */
@JSONField(defaultValue = "true") @JSONField(defaultValue = "true")

View File

@ -1,13 +1,14 @@
package cn.wzpmc.api.api.actions.message.set; package cn.wzpmc.api.actions.message.set;
import cn.wzpmc.api.api.Action; import cn.wzpmc.api.Action;
import cn.wzpmc.api.api.Actions; import cn.wzpmc.api.Actions;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* 重启 OneBot 实现 * 重启 OneBot 实现
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 20:46 * @since 2024/8/24 20:46
@ -15,9 +16,10 @@ import lombok.Data;
public class SetRestartAction extends Action<SetRestartAction.Params, Void> { public class SetRestartAction extends Action<SetRestartAction.Params, Void> {
/** /**
* 重启 OneBot 实现 * 重启 OneBot 实现
*
* @param delay 要延迟的毫秒数如果默认情况下无法重启可以尝试设置延迟为 2000 左右
* @author wzp * @author wzp
* @since 2024/8/24 23:59 v0.0.6-dev * @since 2024/8/24 23:59 v0.0.6-dev
* @param delay 要延迟的毫秒数如果默认情况下无法重启可以尝试设置延迟为 2000 左右
*/ */
public SetRestartAction(Integer delay) { public SetRestartAction(Integer delay) {
super.setAction(Actions.SET_RESTART); super.setAction(Actions.SET_RESTART);
@ -26,17 +28,20 @@ public class SetRestartAction extends Action<SetRestartAction.Params, Void> {
/** /**
* 立即重启 OneBot 实现 * 立即重启 OneBot 实现
*
* @author wzp * @author wzp
* @since 2024/8/24 23:58 v0.0.6-dev * @since 2024/8/24 23:58 v0.0.6-dev
*/ */
public SetRestartAction() { public SetRestartAction() {
this(0); this(0);
} }
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static final class Params { public static final class Params {
/** /**
* 要延迟的毫秒数如果默认情况下无法重启可以尝试设置延迟为 2000 左右 * 要延迟的毫秒数如果默认情况下无法重启可以尝试设置延迟为 2000 左右
*
* @since 2024/8/24 23:49 v0.0.6-dev * @since 2024/8/24 23:49 v0.0.6-dev
*/ */
@JSONField(defaultValue = "0") @JSONField(defaultValue = "0")

View File

@ -1,7 +1,8 @@
package cn.wzpmc.api.commands; package cn.wzpmc.commands;
/** /**
* 指令基类 * 指令基类
*
* @author wzp * @author wzp
* @version 0.0.1-dev * @version 0.0.1-dev
* @since 2024/7/31 上午3:15 * @since 2024/7/31 上午3:15

View File

@ -1,10 +1,11 @@
package cn.wzpmc.api.commands; package cn.wzpmc.commands;
import cn.wzpmc.api.user.CommandSender; import cn.wzpmc.user.CommandSender;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
/** /**
* Brigadier指令 * Brigadier指令
*
* @author wzp * @author wzp
* @version 0.0.1-dev * @version 0.0.1-dev
* @since 2024/7/31 上午2:59 * @since 2024/7/31 上午2:59
@ -12,9 +13,10 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
public interface BrigadierCommand extends BaseCommand { public interface BrigadierCommand extends BaseCommand {
/** /**
* 获取指令节点 * 获取指令节点
*
* @return 指令节点
* @author wzp * @author wzp
* @since 2024/7/31 上午3:16 v0.0.1-dev * @since 2024/7/31 上午3:16 v0.0.1-dev
* @return 指令节点
*/ */
LiteralArgumentBuilder<CommandSender> getCommandNode(); LiteralArgumentBuilder<CommandSender> getCommandNode();
} }

View File

@ -1,11 +1,12 @@
package cn.wzpmc.api.commands; package cn.wzpmc.commands;
import cn.wzpmc.api.user.CommandSender; import cn.wzpmc.user.CommandSender;
import java.util.List; import java.util.List;
/** /**
* 原始指令 * 原始指令
*
* @author wzp * @author wzp
* @version 0.0.1-dev * @version 0.0.1-dev
* @since 2024/7/31 上午2:27 * @since 2024/7/31 上午2:27
@ -13,21 +14,23 @@ import java.util.List;
public interface RawCommand extends BaseCommand { public interface RawCommand extends BaseCommand {
/** /**
* 当指令执行时 * 当指令执行时
*
* @param commandSender 指令发送者
* @param arguments 指令参数如指令foo若执行/foo a b c则arguments为{"a", "b", "c"}
* @return 指令是否执行成功
* @author wzp * @author wzp
* @since 2024/7/31 上午2:57 v0.0.1-dev * @since 2024/7/31 上午2:57 v0.0.1-dev
* @param commandSender 指令发送者
* @param arguments 指令参数如指令foo若执行/foo a b c则arguments为{"a", "b", "c"}
* @return 指令是否执行成功
*/ */
boolean onExecute(CommandSender commandSender, List<String> arguments); boolean onExecute(CommandSender commandSender, List<String> arguments);
/** /**
* 指令补全 * 指令补全
*
* @param commandSender 指令发送者
* @param arguments 指令参数如指令foo若执行/foo a b c则arguments为{"a", "b", "c"}
* @return 当前需要提示的子命令
* @author wzp * @author wzp
* @since 2024/7/31 上午2:58 v0.0.1-dev * @since 2024/7/31 上午2:58 v0.0.1-dev
* @param commandSender 指令发送者
* @param arguments 指令参数如指令foo若执行/foo a b c则arguments为{"a", "b", "c"}
* @return 当前需要提示的子命令
*/ */
default List<String> onTabComplete(CommandSender commandSender, List<String> arguments) { default List<String> onTabComplete(CommandSender commandSender, List<String> arguments) {
return List.of(); return List.of();

View File

@ -1,7 +1,7 @@
package cn.wzpmc.api.commands.arguments; package cn.wzpmc.commands.arguments;
import cn.wzpmc.api.message.json.JsonMessagePart; import cn.wzpmc.message.json.JsonMessagePart;
import cn.wzpmc.api.utils.CqCodeUtils; import cn.wzpmc.utils.CqCodeUtils;
import com.mojang.brigadier.LiteralMessage; import com.mojang.brigadier.LiteralMessage;
import com.mojang.brigadier.StringReader; import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.brigadier.arguments.ArgumentType;
@ -10,6 +10,7 @@ import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
/** /**
* 消息段参数类型 * 消息段参数类型
*
* @author wzp * @author wzp
* @version 1.0.0 * @version 1.0.0
* @since 2024/8/25 01:18 * @since 2024/8/25 01:18
@ -18,7 +19,7 @@ public class MessagePartArgument implements ArgumentType<JsonMessagePart> {
@Override @Override
public JsonMessagePart parse(StringReader stringReader) throws CommandSyntaxException { public JsonMessagePart parse(StringReader stringReader) throws CommandSyntaxException {
String s = stringReader.readStringUntil(' '); String s = stringReader.readStringUntil(' ');
if (!CqCodeUtils.isCQ(s)){ if (!CqCodeUtils.isCQ(s)) {
throw new CommandSyntaxException(new SimpleCommandExceptionType(new LiteralMessage("MessagePart")), new LiteralMessage("Cannot read message part")); throw new CommandSyntaxException(new SimpleCommandExceptionType(new LiteralMessage("MessagePart")), new LiteralMessage("Cannot read message part"));
} }
return CqCodeUtils.parseToPart(s); return CqCodeUtils.parseToPart(s);

View File

@ -1,9 +1,9 @@
package cn.wzpmc.api.commands.arguments; package cn.wzpmc.commands.arguments;
import cn.wzpmc.api.message.json.JsonMessagePart; import cn.wzpmc.commands.exceptions.CqCodeException;
import cn.wzpmc.api.message.json.parts.At; import cn.wzpmc.message.json.JsonMessagePart;
import cn.wzpmc.api.utils.CqCodeUtils; import cn.wzpmc.message.json.parts.At;
import cn.wzpmc.console.commands.exceptions.CqCodeException; import cn.wzpmc.utils.CqCodeUtils;
import com.mojang.brigadier.LiteralMessage; import com.mojang.brigadier.LiteralMessage;
import com.mojang.brigadier.StringReader; import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.brigadier.arguments.ArgumentType;
@ -12,6 +12,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
/** /**
* 用户ID消息类型 * 用户ID消息类型
*
* @author wzp * @author wzp
* @version 1.0.0 * @version 1.0.0
* @since 2024/8/25 21:02 * @since 2024/8/25 21:02
@ -33,8 +34,8 @@ public class UserIdArguments implements ArgumentType<Long> {
String s = builder.toString(); String s = builder.toString();
if (CqCodeUtils.isCQ(s)) { if (CqCodeUtils.isCQ(s)) {
JsonMessagePart jsonMessagePart = CqCodeUtils.parseToPart(s); JsonMessagePart jsonMessagePart = CqCodeUtils.parseToPart(s);
if (jsonMessagePart instanceof At){ if (jsonMessagePart instanceof At) {
return ((At) jsonMessagePart).getQq(); return Long.parseLong(((At) jsonMessagePart).getQq());
} }
throw new CqCodeException(); throw new CqCodeException();
} }
@ -43,7 +44,8 @@ public class UserIdArguments implements ArgumentType<Long> {
String s1 = read + s; String s1 = read + s;
try { try {
return Long.parseLong(s1); return Long.parseLong(s1);
}catch (NumberFormatException ignored) {} } catch (NumberFormatException ignored) {
}
} }
throw new CommandSyntaxException(new BuiltInExceptions().readerInvalidLong(), new LiteralMessage("Cannot read long from user id")); throw new CommandSyntaxException(new BuiltInExceptions().readerInvalidLong(), new LiteralMessage("Cannot read long from user id"));
} }

View File

@ -1,4 +1,4 @@
package cn.wzpmc.console.commands.exceptions; package cn.wzpmc.commands.exceptions;
import com.mojang.brigadier.LiteralMessage; import com.mojang.brigadier.LiteralMessage;
import com.mojang.brigadier.Message; import com.mojang.brigadier.Message;
@ -12,10 +12,12 @@ import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
*/ */
public class CqCodeException extends CommandSyntaxException { public class CqCodeException extends CommandSyntaxException {
private static final Message errorMessage = new LiteralMessage("Cannot read cq code"); private static final Message errorMessage = new LiteralMessage("Cannot read cq code");
public CqCodeException() { public CqCodeException() {
super(new CqCodeExceptionType(errorMessage), errorMessage); super(new CqCodeExceptionType(errorMessage), errorMessage);
} }
private static final class CqCodeExceptionType extends SimpleCommandExceptionType { private static final class CqCodeExceptionType extends SimpleCommandExceptionType {
public CqCodeExceptionType(Message message) { public CqCodeExceptionType(Message message) {
super(message); super(message);

View File

@ -1,9 +1,10 @@
package cn.wzpmc.api.entities; package cn.wzpmc.entities;
import lombok.Data; import lombok.Data;
/** /**
* bot运行状态 * bot运行状态
*
* @author wzp * @author wzp
* @version 0.0.2-dev * @version 0.0.2-dev
* @since 2024/8/1 下午10:30 * @since 2024/8/1 下午10:30
@ -12,11 +13,13 @@ import lombok.Data;
public class BotStatus { public class BotStatus {
/** /**
* 当前 QQ 在线null 表示无法查询到在线状态 * 当前 QQ 在线null 表示无法查询到在线状态
*
* @since 2024/8/23 21:33 v0.0.5-dev * @since 2024/8/23 21:33 v0.0.5-dev
*/ */
private boolean online; private boolean online;
/** /**
* 状态符合预期意味着各模块正常运行功能正常 QQ 在线 * 状态符合预期意味着各模块正常运行功能正常 QQ 在线
*
* @since 2024/8/23 21:34 v0.0.5-dev * @since 2024/8/23 21:34 v0.0.5-dev
*/ */
private boolean good; private boolean good;

View File

@ -1,10 +1,11 @@
package cn.wzpmc.api.entities; package cn.wzpmc.entities;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* Cookie信息 * Cookie信息
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 19:45 * @since 2024/8/24 19:45
@ -14,6 +15,7 @@ import lombok.Data;
public class CookiesInformation { public class CookiesInformation {
/** /**
* Cookies * Cookies
*
* @since 2024/8/24 23:59 v0.0.6-dev * @since 2024/8/24 23:59 v0.0.6-dev
*/ */
private String cookies; private String cookies;

View File

@ -1,4 +1,4 @@
package cn.wzpmc.api.entities; package cn.wzpmc.entities;
import com.alibaba.fastjson2.annotation.JSONField; import com.alibaba.fastjson2.annotation.JSONField;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -6,6 +6,7 @@ import lombok.Data;
/** /**
* QQ认证信息 * QQ认证信息
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 19:46 * @since 2024/8/24 19:46
@ -15,11 +16,13 @@ import lombok.Data;
public class CredentialsInformation { public class CredentialsInformation {
/** /**
* Cookies * Cookies
*
* @since 2024/8/24 23:59 v0.0.6-dev * @since 2024/8/24 23:59 v0.0.6-dev
*/ */
private String cookies; private String cookies;
/** /**
* CSRF Token * CSRF Token
*
* @since 2024/8/24 23:59 v0.0.6-dev * @since 2024/8/24 23:59 v0.0.6-dev
*/ */
@JSONField(name = "csrf_token") @JSONField(name = "csrf_token")

View File

@ -1,10 +1,11 @@
package cn.wzpmc.api.entities; package cn.wzpmc.entities;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
/** /**
* CSRF信息 * CSRF信息
*
* @author wzp * @author wzp
* @version 0.0.6-dev * @version 0.0.6-dev
* @since 2024/8/24 19:45 * @since 2024/8/24 19:45
@ -14,6 +15,7 @@ import lombok.Data;
public class CsrfTokenInformation { public class CsrfTokenInformation {
/** /**
* CSRF Token * CSRF Token
*
* @since 2024/8/24 23:59 v0.0.6-dev * @since 2024/8/24 23:59 v0.0.6-dev
*/ */
private Integer token; private Integer token;

Some files were not shown because too many files have changed in this diff Show More