Compare commits
No commits in common. "master" and "1.0.0" have entirely different histories.
6
.idea/ApifoxUploaderProjectSetting.xml
generated
6
.idea/ApifoxUploaderProjectSetting.xml
generated
@ -1,6 +0,0 @@
|
||||
<?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
1
.idea/compiler.xml
generated
@ -8,7 +8,6 @@
|
||||
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.34/ec547ef414ab1d2c040118fb9c1c265ada63af14/lombok-1.18.34.jar" />
|
||||
</processorPath>
|
||||
<module name="MyBot.main" />
|
||||
<module name="MyBot.mybot-api.main" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel target="11" />
|
||||
|
2
.idea/fileTemplates/includes/Version.txt
generated
2
.idea/fileTemplates/includes/Version.txt
generated
@ -1 +1 @@
|
||||
1.0.7
|
||||
1.0.0
|
4
.idea/gradle.xml
generated
4
.idea/gradle.xml
generated
@ -4,13 +4,11 @@
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="distributionType" value="LOCAL" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="$USER_HOME$/.sdkman/candidates/gradle/current" />
|
||||
<option name="gradleHome" value="" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/mybot-api" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
|
10
.idea/inspectionProfiles/Project_Default.xml
generated
10
.idea/inspectionProfiles/Project_Default.xml
generated
@ -1,10 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<Languages>
|
||||
<language minSize="58" name="Java" />
|
||||
</Languages>
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
20
.idea/jarRepositories.xml
generated
20
.idea/jarRepositories.xml
generated
@ -21,25 +21,5 @@
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://libraries.minecraft.net" />
|
||||
</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>
|
||||
</project>
|
5
.idea/misc.xml
generated
5
.idea/misc.xml
generated
@ -5,10 +5,9 @@
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="EntryPointsManager">
|
||||
<list size="3">
|
||||
<list size="2">
|
||||
<item index="0" class="java.lang.String" itemvalue="cn.wzpmc.api.plugins.event.EventHandler" />
|
||||
<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" />
|
||||
<item index="1" class="java.lang.String" itemvalue="com.alibaba.fastjson2.annotation.JSONField" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
|
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@ -3,7 +3,6 @@
|
||||
<component name="ProjectModuleManager">
|
||||
<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-api/MyBot.mybot-api.main.iml" filepath="$PROJECT_DIR$/.idea/modules/mybot-api/MyBot.mybot-api.main.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
8
.idea/modules/MyBot.iml
generated
8
.idea/modules/MyBot.iml
generated
@ -1,8 +0,0 @@
|
||||
<?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>
|
8
.idea/modules/mybot-api/MyBot.mybot-api.main.iml
generated
8
.idea/modules/mybot-api/MyBot.mybot-api.main.iml
generated
@ -1,8 +0,0 @@
|
||||
<?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>
|
95
README.md
95
README.md
@ -1,95 +1,4 @@
|
||||
# MyBot
|
||||
|
||||
### 一个基于 Java 的 OneBot11 兼容机器人框架
|
||||
|
||||
---
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 环境要求
|
||||
1. Java 运行环境(JRE)版本 ≥ 11
|
||||
2. 任意 OneBot11 协议框架的实现
|
||||
|
||||
### 使用步骤
|
||||
1. 前往 [GitHub Release](https://github.com/Wzp-2008/MyBot/releases/latest) 或 [Gitea Release](https://wzpmc.cn:3000/wzp/MyBot/releases/latest) 下载最新版本的 JAR 包。
|
||||
2. 将下载的 JAR 包放入一个空文件夹中。
|
||||
3. 启动你的 OneBot 实例。
|
||||
4. 通过以下命令启动 MyBot 服务端:
|
||||
```bash
|
||||
java -jar mybot.jar
|
||||
```
|
||||
5. 编辑生成的配置文件,将其中的 WebSocket 地址设置为你的 OneBot WebSocket 地址。
|
||||
6. 再次运行以下命令启动服务端:
|
||||
```bash
|
||||
java -jar mybot.jar
|
||||
```
|
||||
7. 现在,你可以开始使用 MyBot 啦!
|
||||
|
||||
---
|
||||
|
||||
## 开发指南
|
||||
|
||||
### 添加仓库
|
||||
|
||||
如果你需要从自定义仓库拉取依赖项,请在项目的构建文件中添加以下仓库配置:
|
||||
|
||||
#### Maven 仓库设置
|
||||
在 `pom.xml` 中添加以下仓库配置:
|
||||
```xml
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>wzpmc-maven-releases</id>
|
||||
<url>https://wzpmc.cn:90/repository/maven-public</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
```
|
||||
|
||||
#### Gradle 仓库设置
|
||||
|
||||
##### Groovy DSL
|
||||
```groovy
|
||||
repositories {
|
||||
maven {
|
||||
url "https://wzpmc.cn:90/repository/maven-public"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
##### Kotlin DSL
|
||||
```kotlin
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://wzpmc.cn:90/repository/maven-public")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 添加依赖
|
||||
|
||||
#### Maven 构建
|
||||
在你的 `pom.xml` 中添加以下依赖项:
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>cn.wzpmc</groupId>
|
||||
<artifactId>mybot-api</artifactId>
|
||||
<version>[LATEST-VERSION]</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
#### Gradle 构建
|
||||
|
||||
##### Groovy DSL
|
||||
```groovy
|
||||
implementation 'cn.wzpmc:mybot-api:[LATEST-VERSION]'
|
||||
```
|
||||
|
||||
##### Kotlin DSL
|
||||
```kotlin
|
||||
implementation("cn.wzpmc:mybot-api:[LATEST-VERSION]")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
如此设置之后,您将轻松地将 MyBot-API 集成到您的项目中,并快速构建与 OneBot11 兼容的机器人应用。Enjoy~
|
||||
|
||||
---
|
||||
## 一个基于Java的OneBot11兼容机器人框架
|
||||
#### A Java-based OneBot11-compatible robot framework
|
95
README_EN.md
95
README_EN.md
@ -1,95 +0,0 @@
|
||||
# MyBot
|
||||
|
||||
### A Java-Based OneBot11-Compatible Bot Framework
|
||||
|
||||
---
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Requirements
|
||||
1. Java Runtime Environment (JRE) version ≥ 11
|
||||
2. Implementation of any OneBot11 protocol framework
|
||||
|
||||
### 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.
|
||||
2. Place the downloaded JAR package in an empty folder.
|
||||
3. Start your OneBot instance.
|
||||
4. Start the MyBot server using the following command:
|
||||
```bash
|
||||
java -jar mybot.jar
|
||||
```
|
||||
5. Edit the generated configuration file and set the WebSocket address to your OneBot WebSocket address.
|
||||
6. Run the following command again to start the server:
|
||||
```bash
|
||||
java -jar mybot.jar
|
||||
```
|
||||
7. Now, you can start using MyBot!
|
||||
|
||||
---
|
||||
|
||||
## Development Guide
|
||||
|
||||
### Add Repositories
|
||||
|
||||
If you need to pull dependencies from custom repositories, add the following repository configurations to your project's build file:
|
||||
|
||||
#### Maven Repository Setup
|
||||
In your `pom.xml`, add the following repository configuration:
|
||||
```xml
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>wzpmc-maven-releases</id>
|
||||
<url>https://wzpmc.cn:90/repository/maven-public</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
```
|
||||
|
||||
#### Gradle Repository Setup
|
||||
|
||||
##### Groovy DSL
|
||||
```groovy
|
||||
repositories {
|
||||
maven {
|
||||
url "https://wzpmc.cn:90/repository/maven-public"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
##### Kotlin DSL
|
||||
```kotlin
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://wzpmc.cn:90/repository/maven-public")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Add Dependencies
|
||||
|
||||
#### Maven Build
|
||||
In your `pom.xml`, add the following dependency:
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>cn.wzpmc</groupId>
|
||||
<artifactId>mybot-api</artifactId>
|
||||
<version>[LATEST-VERSION]</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
#### Gradle Build
|
||||
|
||||
##### Groovy DSL
|
||||
```groovy
|
||||
implementation 'cn.wzpmc:mybot-api:[LATEST-VERSION]'
|
||||
```
|
||||
|
||||
##### Kotlin DSL
|
||||
```kotlin
|
||||
implementation("cn.wzpmc:mybot-api:[LATEST-VERSION]")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
With these settings, you'll be able to seamlessly integrate MyBot-API into your project and quickly build OneBot11-compatible bot applications. Enjoy!
|
||||
|
||||
---
|
127
build.gradle.kts
127
build.gradle.kts
@ -2,59 +2,41 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
|
||||
|
||||
val projectName = rootProject.name
|
||||
val groupName: String by extra
|
||||
val projectArtifactId: String by extra
|
||||
val projectVersion: String by extra
|
||||
val groupName by extra("cn.wzpmc")
|
||||
val projectArtifactId by extra("my-bot")
|
||||
val projectVersion by extra("1.0.0")
|
||||
|
||||
plugins {
|
||||
id("java-library")
|
||||
id("java")
|
||||
id("maven-publish")
|
||||
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
|
||||
version = projectVersion
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://libraries.minecraft.net")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":mybot-api"))
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0") {
|
||||
exclude(group = "org.apache.logging.log4j", module = "log4j-core")
|
||||
exclude(group = "org.apache.logging.log4j", module = "log4j-api")
|
||||
}
|
||||
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core
|
||||
implementation("org.apache.logging.log4j:log4j-core:2.23.1")
|
||||
// https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-jul
|
||||
implementation("org.apache.logging.log4j:log4j-jul:2.23.1")
|
||||
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
|
||||
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
|
||||
implementation("org.apache.logging.log4j:log4j-jul:2.23.1")
|
||||
// https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2
|
||||
implementation("com.alibaba.fastjson2:fastjson2:2.0.52")
|
||||
// https://mvnrepository.com/artifact/org.yaml/snakeyaml
|
||||
implementation("org.yaml:snakeyaml:2.2")
|
||||
// https://mvnrepository.com/artifact/org.jline/jline
|
||||
implementation("org.jline:jline-terminal:3.26.3")
|
||||
implementation("org.jline:jline-reader:3.26.3")
|
||||
@ -64,6 +46,22 @@ dependencies {
|
||||
implementation("org.jline:jline-terminal-jansi:3.26.3")
|
||||
// https://mvnrepository.com/artifact/org.fusesource.jansi/jansi
|
||||
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") {
|
||||
archiveClassifier.set("javadoc")
|
||||
@ -88,6 +86,57 @@ tasks.withType<ShadowJar> {
|
||||
tasks.named("build") {
|
||||
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 {
|
||||
useJUnitPlatform()
|
||||
}
|
2
docs/.gitignore
vendored
2
docs/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
.idea/
|
||||
node_modules/
|
5
docs/.idea/.gitignore
generated
vendored
5
docs/.idea/.gitignore
generated
vendored
@ -1,5 +0,0 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
12
docs/.idea/docs.iml
generated
12
docs/.idea/docs.iml
generated
@ -1,12 +0,0 @@
|
||||
<?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
8
docs/.idea/modules.xml
generated
@ -1,8 +0,0 @@
|
||||
<?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
6
docs/.idea/vcs.xml
generated
@ -1,6 +0,0 @@
|
||||
<?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
1
docs/.vitepress/.gitignore
vendored
@ -1 +0,0 @@
|
||||
cache/
|
269
docs/.vitepress/cache/deps/@theme_index.js
vendored
269
docs/.vitepress/cache/deps/@theme_index.js
vendored
@ -1,269 +0,0 @@
|
||||
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
40
docs/.vitepress/cache/deps/_metadata.json
vendored
40
docs/.vitepress/cache/deps/_metadata.json
vendored
@ -1,40 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
9311
docs/.vitepress/cache/deps/chunk-WVCZVGU2.js
vendored
9311
docs/.vitepress/cache/deps/chunk-WVCZVGU2.js
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
12526
docs/.vitepress/cache/deps/chunk-XIDTNVOX.js
vendored
12526
docs/.vitepress/cache/deps/chunk-XIDTNVOX.js
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
3
docs/.vitepress/cache/deps/package.json
vendored
3
docs/.vitepress/cache/deps/package.json
vendored
@ -1,3 +0,0 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,567 +0,0 @@
|
||||
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
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
343
docs/.vitepress/cache/deps/vue.js
vendored
343
docs/.vitepress/cache/deps/vue.js
vendored
@ -1,343 +0,0 @@
|
||||
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
7
docs/.vitepress/cache/deps/vue.js.map
vendored
@ -1,7 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
})
|
@ -1,40 +0,0 @@
|
||||
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;
|
@ -1,41 +0,0 @@
|
||||
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;
|
@ -1,49 +0,0 @@
|
||||
---
|
||||
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).
|
@ -1,68 +0,0 @@
|
||||
# 主配置文件 {#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
|
||||
```
|
@ -1,47 +0,0 @@
|
||||
# 环境要求
|
||||
- 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已完成启动~
|
@ -1,49 +0,0 @@
|
||||
---
|
||||
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).
|
@ -1,68 +0,0 @@
|
||||
# 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
|
||||
```
|
@ -1,25 +0,0 @@
|
||||
---
|
||||
# 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.
|
||||
---
|
||||
|
@ -1,85 +0,0 @@
|
||||
# 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).
|
@ -1,25 +0,0 @@
|
||||
---
|
||||
# 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以下内存
|
||||
---
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"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
1491
docs/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,85 +0,0 @@
|
||||
# 快速开始
|
||||
|
||||
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).
|
@ -1,78 +0,0 @@
|
||||
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()
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package cn.wzpmc.commands.arguments;
|
||||
|
||||
import cn.wzpmc.message.json.JsonMessagePart;
|
||||
import cn.wzpmc.utils.CqCodeUtils;
|
||||
import com.mojang.brigadier.LiteralMessage;
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
|
||||
|
||||
/**
|
||||
* 消息段参数类型
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.0
|
||||
* @since 2024/8/25 01:18
|
||||
*/
|
||||
public class MessagePartArgument implements ArgumentType<JsonMessagePart> {
|
||||
@Override
|
||||
public JsonMessagePart parse(StringReader stringReader) throws CommandSyntaxException {
|
||||
String s = stringReader.readStringUntil(' ');
|
||||
if (!CqCodeUtils.isCQ(s)) {
|
||||
throw new CommandSyntaxException(new SimpleCommandExceptionType(new LiteralMessage("MessagePart")), new LiteralMessage("Cannot read message part"));
|
||||
}
|
||||
return CqCodeUtils.parseToPart(s);
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package cn.wzpmc.commands.arguments;
|
||||
|
||||
import cn.wzpmc.commands.exceptions.CqCodeException;
|
||||
import cn.wzpmc.message.json.JsonMessagePart;
|
||||
import cn.wzpmc.message.json.parts.At;
|
||||
import cn.wzpmc.utils.CqCodeUtils;
|
||||
import com.mojang.brigadier.LiteralMessage;
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import com.mojang.brigadier.exceptions.BuiltInExceptions;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
|
||||
/**
|
||||
* 用户ID消息类型
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.0
|
||||
* @since 2024/8/25 21:02
|
||||
*/
|
||||
public class UserIdArguments implements ArgumentType<Long> {
|
||||
@Override
|
||||
public Long parse(StringReader stringReader) throws CommandSyntaxException {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
char read = stringReader.read();
|
||||
if (read == '[') {
|
||||
builder.append('[');
|
||||
while (stringReader.canRead()) {
|
||||
read = stringReader.read();
|
||||
builder.append(read);
|
||||
if (read == ']') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
String s = builder.toString();
|
||||
if (CqCodeUtils.isCQ(s)) {
|
||||
JsonMessagePart jsonMessagePart = CqCodeUtils.parseToPart(s);
|
||||
if (jsonMessagePart instanceof At) {
|
||||
return Long.parseLong(((At) jsonMessagePart).getQq());
|
||||
}
|
||||
throw new CqCodeException();
|
||||
}
|
||||
} else {
|
||||
String s = stringReader.readUnquotedString();
|
||||
String s1 = read + s;
|
||||
try {
|
||||
return Long.parseLong(s1);
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
}
|
||||
throw new CommandSyntaxException(new BuiltInExceptions().readerInvalidLong(), new LiteralMessage("Cannot read long from user id"));
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package cn.wzpmc.commands.exceptions;
|
||||
|
||||
import com.mojang.brigadier.LiteralMessage;
|
||||
import com.mojang.brigadier.Message;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
|
||||
|
||||
/**
|
||||
* @author wzp
|
||||
* @version 1.0.0
|
||||
* @since 2024/8/25 21:06
|
||||
*/
|
||||
public class CqCodeException extends CommandSyntaxException {
|
||||
private static final Message errorMessage = new LiteralMessage("Cannot read cq code");
|
||||
|
||||
public CqCodeException() {
|
||||
super(new CqCodeExceptionType(errorMessage), errorMessage);
|
||||
|
||||
}
|
||||
|
||||
private static final class CqCodeExceptionType extends SimpleCommandExceptionType {
|
||||
public CqCodeExceptionType(Message message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
package cn.wzpmc.entities;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 分群op列表
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.0
|
||||
* @since 2024/8/25 20:16
|
||||
*/
|
||||
@Getter
|
||||
public final class Ops {
|
||||
/**
|
||||
* BOT总管理员
|
||||
*
|
||||
* @since 2024/8/25 20:17 v1.0.0
|
||||
*/
|
||||
private final Set<Long> admins = new HashSet<>();
|
||||
/**
|
||||
* 群内管理员
|
||||
*
|
||||
* @since 2024/8/25 20:17 v1.0.0
|
||||
*/
|
||||
private final Map<String, List<Long>> groupAdmins = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 判断此用户在群中是否为管理
|
||||
*
|
||||
* @param groupId 群ID
|
||||
* @param id 用户ID
|
||||
* @return 是否管理
|
||||
* @author wzp
|
||||
* @since 2024/8/25 20:20 v1.0.0
|
||||
*/
|
||||
public boolean isAdmin(Long groupId, Long id) {
|
||||
if (admins.contains(id)) {
|
||||
return true;
|
||||
}
|
||||
List<Long> longs = groupAdmins.get(groupId.toString());
|
||||
if (longs == null) {
|
||||
return false;
|
||||
}
|
||||
return longs.contains(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断此用户是否为管理
|
||||
*
|
||||
* @param id 用户ID
|
||||
* @return 是否管理
|
||||
* @author wzp
|
||||
* @since 2024/8/25 20:20 v1.0.0
|
||||
*/
|
||||
public boolean isAdmin(Long id) {
|
||||
return admins.contains(id);
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package cn.wzpmc.events.notice.essence;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 添加精华消息事件
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.3
|
||||
* @since 2024/9/16 21:32
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class EssenceAddEvent extends EssenceEvent {
|
||||
/**
|
||||
* 群ID
|
||||
*
|
||||
* @since 2024/9/16 21:33 v1.0.3
|
||||
*/
|
||||
@JSONField(name = "group_id")
|
||||
private Long groupId;
|
||||
/**
|
||||
* 设置人ID
|
||||
*
|
||||
* @since 2024/9/16 21:33 v1.0.3
|
||||
*/
|
||||
@JSONField(name = "user_id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 消息ID
|
||||
*
|
||||
* @since 2024/9/16 21:33 v1.0.3
|
||||
*/
|
||||
@JSONField(name = "message_id")
|
||||
private Long messageId;
|
||||
/**
|
||||
* 消息发送者ID
|
||||
*
|
||||
* @since 2024/9/16 21:33 v1.0.3
|
||||
*/
|
||||
@JSONField(name = "sender_id")
|
||||
private Long senderId;
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package cn.wzpmc.events.notice.essence;
|
||||
|
||||
import cn.wzpmc.events.notice.NoticeEvent;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 精华消息事件
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.3
|
||||
* @since 2024/9/16 21:24
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class EssenceEvent extends NoticeEvent {
|
||||
/**
|
||||
* 群精华消息子类型
|
||||
*
|
||||
* @since 2024/8/1 下午11:26 v0.0.2-dev
|
||||
*/
|
||||
@JSONField(name = "sub_type")
|
||||
private EssenceSubType subType;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package cn.wzpmc.events.notice.essence;
|
||||
|
||||
/**
|
||||
* 精华消息子事件
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.3
|
||||
* @since 2024/9/16 21:31
|
||||
*/
|
||||
public enum EssenceSubType {
|
||||
/**
|
||||
* 添加精华消息事件
|
||||
*
|
||||
* @since 2024/9/16 21:35 v1.0.3
|
||||
*/
|
||||
ADD(EssenceAddEvent.class);
|
||||
public final Class<? extends EssenceEvent> clazz;
|
||||
|
||||
EssenceSubType(Class<? extends EssenceEvent> clazz) {
|
||||
this.clazz = clazz;
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package cn.wzpmc.events.notice.notify;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 用户正在输入事件
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.2
|
||||
* @since 2024/8/29 21:52
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class InputStatusNotifyEvent extends NotifyEvent {
|
||||
/**
|
||||
* 状态文本
|
||||
*
|
||||
* @since 2024/8/29 23:16 v1.0.2
|
||||
*/
|
||||
@JSONField(name = "status_text")
|
||||
private String statusText;
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
package cn.wzpmc.message.json.parts;
|
||||
|
||||
import cn.wzpmc.message.json.JsonMessagePart;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* "@"某人
|
||||
*
|
||||
* @author MoYiJiangNan
|
||||
* @version 0.0.3-dev
|
||||
* @since 2024/8/2 下午11:22
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@AllArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
public class At implements JsonMessagePart {
|
||||
/**
|
||||
* "@"的 QQ 号,all 表示全体成员
|
||||
*
|
||||
* @since 2024/8/2 下午11:50 v0.0.3-dev
|
||||
*/
|
||||
private String qq;
|
||||
|
||||
/**
|
||||
* 获取用于@全体成员的AT对象
|
||||
*
|
||||
* @return 全体成员的At对象
|
||||
* @author wzp
|
||||
* @since 2024/8/31 23:51 v1.0.3
|
||||
*/
|
||||
public static At all() {
|
||||
return new At("all");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用于@用户的AT对象
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 指定用户的At对象
|
||||
* @author wzp
|
||||
* @since 2024/8/31 23:50 v1.0.3
|
||||
*/
|
||||
public static At user(Long userId) {
|
||||
return new At(userId.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PartType getPartType() {
|
||||
return PartType.AT;
|
||||
}
|
||||
|
||||
public JSONObject getData() {
|
||||
return JSONObject.of("qq", this.qq);
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package cn.wzpmc.message.json.parts;
|
||||
|
||||
import cn.wzpmc.message.json.JsonMessagePart;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Markdown格式消息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.0
|
||||
* @since 2024/8/25 15:19
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class MarkdownMessage implements JsonMessagePart {
|
||||
/**
|
||||
* Markdown格式数据
|
||||
*
|
||||
* @since 2024/8/25 15:20 v1.0.0
|
||||
*/
|
||||
private String data;
|
||||
|
||||
@Override
|
||||
public PartType getPartType() {
|
||||
return PartType.MARKDOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getData() {
|
||||
return JSONObject.of("data", data);
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
package cn.wzpmc.message.json.parts;
|
||||
|
||||
import cn.wzpmc.message.json.JsonMessagePart;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 未知消息类型
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.5
|
||||
* @since 2024/11/17 17:22
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UnknownPart implements JsonMessagePart {
|
||||
/**
|
||||
* 类型文本
|
||||
*
|
||||
* @since 2024/11/17 17:32 v1.0.5
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 消息数据
|
||||
*
|
||||
* @since 2024/11/17 17:33 v1.0.5
|
||||
*/
|
||||
private JSONObject data;
|
||||
|
||||
@Override
|
||||
public PartType getPartType() {
|
||||
return PartType.UNKNOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStringPartType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getData() {
|
||||
return data;
|
||||
}
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
package cn.wzpmc.plugins.configuration;
|
||||
|
||||
/**
|
||||
* 配置
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.1-dev
|
||||
* @since 2024/7/31 上午3:42
|
||||
*/
|
||||
public interface IConfiguration {
|
||||
|
||||
/**
|
||||
* @author wzp
|
||||
* @since 2025/3/26 17:29 v1.0.7
|
||||
* @return 网络相关配置
|
||||
*/
|
||||
INetworkConfiguration getNetwork();
|
||||
/**
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2025/2/4 13:44 v1.0.5
|
||||
* @return 命令前缀
|
||||
*/
|
||||
String getCommandPrefix();
|
||||
|
||||
/**
|
||||
* @return 通信验证
|
||||
* @author wzp
|
||||
* @since 2024/7/31 上午3:48 v0.0.1-dev
|
||||
*/
|
||||
IAuthorizationConfiguration getAuthorization();
|
||||
|
||||
/**
|
||||
* @return 失败消息提示
|
||||
* @author wzp
|
||||
* @since 2024/7/31 上午3:49 v0.0.1-dev
|
||||
*/
|
||||
IFallbackConfiguration getFallback();
|
||||
|
||||
/**
|
||||
* @return 获取好友配置
|
||||
* @author wzp
|
||||
* @since 2024/8/30 15:42 v1.0.3
|
||||
*/
|
||||
IFriendConfiguration getFriend();
|
||||
|
||||
/**
|
||||
* @return 获取群聊配置
|
||||
* @author wzp
|
||||
* @since 2024/8/31 23:56 v1.0.3
|
||||
*/
|
||||
IGroupConfiguration getGroup();
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package cn.wzpmc.plugins.configuration;
|
||||
|
||||
/**
|
||||
* 好友配置
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.3
|
||||
* @since 2024/8/30 15:39
|
||||
*/
|
||||
public interface IFriendConfiguration {
|
||||
/**
|
||||
* @return 是否自动同意好友申请
|
||||
* @author wzp
|
||||
* @since 2024/8/30 15:41 v1.0.3
|
||||
*/
|
||||
Boolean isAutoAccept();
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package cn.wzpmc.plugins.configuration;
|
||||
|
||||
/**
|
||||
* 群聊相关配置
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.3
|
||||
* @since 2024/8/31 23:55
|
||||
*/
|
||||
public interface IGroupConfiguration {
|
||||
/**
|
||||
* @return 是否自动同意加群邀请
|
||||
* @author wzp
|
||||
* @since 2024/8/30 15:41 v1.0.3
|
||||
*/
|
||||
Boolean isAutoAccept();
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package cn.wzpmc.plugins.configuration;
|
||||
|
||||
/**
|
||||
* @author wzp
|
||||
* @since 2025/3/26 17:26
|
||||
* @version 1.0.7
|
||||
*/
|
||||
public interface INetworkConfiguration {
|
||||
/**
|
||||
* @return WebSocket连接URL
|
||||
* @author wzp
|
||||
* @since 2025/3/26 17:26 v1.0.7
|
||||
*/
|
||||
String getWebsocket();
|
||||
|
||||
/**
|
||||
* @author wzp
|
||||
* @since 2025/3/26 17:27 v1.0.7
|
||||
* @return 是否启用连接重试
|
||||
*/
|
||||
Boolean isRetry();
|
||||
|
||||
/**
|
||||
* @author wzp
|
||||
* @since 2025/3/26 17:27 v1.0.7
|
||||
* @return 重试最大次数(-1为无限)
|
||||
*/
|
||||
Integer getMaxRetryCount();
|
||||
|
||||
|
||||
/**
|
||||
* @author wzp
|
||||
* @since 2025/3/26 17:28 v1.0.7
|
||||
* @return 获取重试间隔(单位毫秒)
|
||||
*/
|
||||
Long getRetryInterval();
|
||||
|
||||
}
|
@ -1,172 +0,0 @@
|
||||
package cn.wzpmc.utils;
|
||||
|
||||
import cn.wzpmc.message.json.JsonMessagePart;
|
||||
import cn.wzpmc.message.json.parts.At;
|
||||
import cn.wzpmc.message.json.parts.PartType;
|
||||
import cn.wzpmc.message.json.parts.UnknownPart;
|
||||
import cn.wzpmc.message.json.parts.music.MusicType;
|
||||
import cn.wzpmc.message.json.parts.node.CustomNode;
|
||||
import cn.wzpmc.message.json.parts.node.SingleNode;
|
||||
import cn.wzpmc.message.json.parts.poke.Poke;
|
||||
import cn.wzpmc.message.json.parts.poke.PokeType;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* CQ码相关工具类
|
||||
*
|
||||
* @author wzp
|
||||
* @version 1.0.0
|
||||
* @since 2024/8/26 14:06
|
||||
*/
|
||||
@Log4j2
|
||||
public class CqCodeUtils {
|
||||
/**
|
||||
* 判断一个字符串是否为CQ码
|
||||
*
|
||||
* @param word 一个词(不包含空格)
|
||||
* @return 是否为CQ码
|
||||
* @author wzp
|
||||
* @since 2024/8/26 14:08 v1.0.0
|
||||
*/
|
||||
public static boolean isCQ(String word) {
|
||||
return word.startsWith("[") && word.endsWith("]");
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析CQ码为Map
|
||||
*
|
||||
* @param word 一个词(不包含空格)
|
||||
* @return 解析后的Map
|
||||
* @author wzp
|
||||
* @since 2024/8/26 14:08 v1.0.0
|
||||
*/
|
||||
public static Map<String, String> parse(String word) {
|
||||
StringBuilder key = new StringBuilder();
|
||||
boolean keyDone = false;
|
||||
StringBuilder value = new StringBuilder();
|
||||
Map<String, String> result = new HashMap<>();
|
||||
for (int i = 0; i < word.length(); i++) {
|
||||
char c = word.charAt(i);
|
||||
if (c == '[') continue;
|
||||
if (c == ']') {
|
||||
result.put(key.toString(), value.toString());
|
||||
}
|
||||
if (keyDone) {
|
||||
if (c == ',') {
|
||||
result.put(key.toString(), value.toString());
|
||||
key = new StringBuilder();
|
||||
value = new StringBuilder();
|
||||
keyDone = false;
|
||||
continue;
|
||||
}
|
||||
value.append(c);
|
||||
continue;
|
||||
}
|
||||
if (c == ':' || c == '=') {
|
||||
keyDone = true;
|
||||
continue;
|
||||
}
|
||||
key.append(c);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将文本转化为JsonMessagePart
|
||||
*
|
||||
* @param word 一个词(不包含空格)
|
||||
* @return 消息文本段
|
||||
* @author wzp
|
||||
* @since 2024/8/26 14:34 v1.0.0
|
||||
*/
|
||||
@SneakyThrows
|
||||
public static JsonMessagePart parseToPart(String word) {
|
||||
Map<String, String> parse = parse(word);
|
||||
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(parse));
|
||||
Object cq = jsonObject.get("CQ");
|
||||
JSONObject jsonObj = JSONObject.of("type", cq, "data", jsonObject);
|
||||
return parsePart(jsonObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将json解析为单个消息段
|
||||
*
|
||||
* @param jsonObject json数据
|
||||
* @return 消息段
|
||||
* @throws InvocationTargetException 调用构造方法失败时抛出
|
||||
* @throws InstantiationException 实例化错误时抛出
|
||||
* @throws IllegalAccessException 实例化错误时抛出
|
||||
* @throws NoSuchMethodException 找不到构造方法时抛出
|
||||
* @author wzp
|
||||
* @since 2024/8/26 14:40 v1.0.0
|
||||
*/
|
||||
public static JsonMessagePart parsePart(JSONObject jsonObject) throws InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException {
|
||||
PartType type = PartType.UNKNOWN;
|
||||
PartType resolvedType = jsonObject.getObject("type", PartType.class);
|
||||
if (resolvedType != null) {
|
||||
type = resolvedType;
|
||||
}
|
||||
Class<? extends JsonMessagePart> clazz = type.clazz;
|
||||
JSONObject dataObject = jsonObject.getJSONObject("data");
|
||||
if (type.equals(PartType.UNKNOWN)) {
|
||||
String stringType = jsonObject.getString("type");
|
||||
log.warn("发现无法解析的json消息数据,数据类型:{},数据内容:{}", stringType, dataObject);
|
||||
return new UnknownPart(stringType, dataObject);
|
||||
}
|
||||
if (type.equals(PartType.AT)) {
|
||||
String string = dataObject.getString("qq");
|
||||
if (string.equalsIgnoreCase("all")) {
|
||||
return At.all();
|
||||
}
|
||||
return At.user(Long.parseLong(string));
|
||||
}
|
||||
if (type.equals(PartType.POKE)) {
|
||||
Integer pokeType = dataObject.getInteger("type");
|
||||
Integer pokeId = dataObject.getInteger("id");
|
||||
for (PokeType value : PokeType.values()) {
|
||||
if (value.type.equals(pokeType) && value.id.equals(pokeId)) {
|
||||
return new Poke(value);
|
||||
}
|
||||
}
|
||||
log.warn("无法识别的戳一戳类型:type: {}, id: {}", pokeType, pokeId);
|
||||
return new Poke();
|
||||
}
|
||||
if (type.equals(PartType.NODE)) {
|
||||
if (jsonObject.containsKey("content")) {
|
||||
clazz = CustomNode.class;
|
||||
} else {
|
||||
clazz = SingleNode.class;
|
||||
}
|
||||
}
|
||||
if (type.equals(PartType.MUSIC)) {
|
||||
MusicType musicType = dataObject.getObject("type", MusicType.class);
|
||||
dataObject.put("musicType", musicType);
|
||||
clazz = musicType.clazz;
|
||||
}
|
||||
Constructor<? extends JsonMessagePart> declaredConstructor = clazz.getDeclaredConstructor();
|
||||
JsonMessagePart resultPart = declaredConstructor.newInstance();
|
||||
for (Field declaredField : clazz.getDeclaredFields()) {
|
||||
JSONField annotation = declaredField.getAnnotation(JSONField.class);
|
||||
String name = Objects.isNull(annotation) ? declaredField.getName() : annotation.name();
|
||||
if (!dataObject.containsKey(name)) {
|
||||
continue;
|
||||
}
|
||||
declaredField.setAccessible(true);
|
||||
Class<?> thisFieldClass = declaredField.getType();
|
||||
Object value = dataObject.getObject(name, thisFieldClass);
|
||||
declaredField.set(resultPart, value);
|
||||
}
|
||||
return resultPart;
|
||||
}
|
||||
}
|
@ -1,3 +1,2 @@
|
||||
val projectName by extra("MyBot")
|
||||
rootProject.name = projectName
|
||||
include("mybot-api")
|
||||
rootProject.name = projectName
|
@ -1,16 +1,13 @@
|
||||
package cn.wzpmc;
|
||||
|
||||
import cn.wzpmc.api.IMainApi;
|
||||
import cn.wzpmc.api.actions.message.get.GetLoginInfoAction;
|
||||
import cn.wzpmc.builtin.commands.*;
|
||||
import cn.wzpmc.builtin.event.AddGroupEventHandler;
|
||||
import cn.wzpmc.builtin.event.CommandEventHandler;
|
||||
import cn.wzpmc.builtin.event.FriendAddEventHandler;
|
||||
import cn.wzpmc.api.api.IMainApi;
|
||||
import cn.wzpmc.api.api.actions.message.get.GetLoginInfoAction;
|
||||
import cn.wzpmc.api.plugins.BasePlugin;
|
||||
import cn.wzpmc.commands.StopCommand;
|
||||
import cn.wzpmc.configuration.Configuration;
|
||||
import cn.wzpmc.console.MyBotConsole;
|
||||
import cn.wzpmc.entities.user.bot.MyBot;
|
||||
import cn.wzpmc.network.WebSocketConnectionHandler;
|
||||
import cn.wzpmc.plugins.BasePlugin;
|
||||
import cn.wzpmc.plugins.CommandManager;
|
||||
import cn.wzpmc.plugins.PluginClassLoader;
|
||||
import cn.wzpmc.plugins.PluginManager;
|
||||
@ -18,7 +15,6 @@ import cn.wzpmc.utils.JsonUtils;
|
||||
import cn.wzpmc.utils.ReflectionUtils;
|
||||
import cn.wzpmc.utils.TemplateFileUtils;
|
||||
import cn.wzpmc.utils.YamlUtils;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
||||
@ -27,89 +23,41 @@ import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Objects;
|
||||
|
||||
@Log4j2
|
||||
public class Main {
|
||||
private static final String DEFAULT_CONFIGURATION_FILE_PATH = "templates/config.yaml";
|
||||
|
||||
public static void initializeJVM() {
|
||||
public static void initializeJVM(){
|
||||
System.setProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager");
|
||||
System.setProperty("terminal.jline", "true");
|
||||
}
|
||||
|
||||
public static void initializeJsonUtils() {
|
||||
public static void initializeJsonUtils(){
|
||||
JsonUtils.initReader();
|
||||
JsonUtils.initWriter();
|
||||
}
|
||||
|
||||
public static Configuration getConfiguration() {
|
||||
File configurationFile = new File("config.yaml");
|
||||
ClassLoader classLoader = Main.class.getClassLoader();
|
||||
if (TemplateFileUtils.saveDefaultConfig(classLoader, DEFAULT_CONFIGURATION_FILE_PATH, configurationFile)) {
|
||||
if (TemplateFileUtils.saveDefaultConfig(Main.class.getClassLoader(), DEFAULT_CONFIGURATION_FILE_PATH, configurationFile)) {
|
||||
log.debug("创建日志文件成功!");
|
||||
log.info("首次启动,默认配置文件已创建,请填写后再次启动MyBot!");
|
||||
return null;
|
||||
}
|
||||
log.debug("读取配置文件 {}", configurationFile.getAbsolutePath());
|
||||
Configuration configuration = YamlUtils.readYamlFile(configurationFile, Configuration.class);
|
||||
JSONObject fullConfiguration = YamlUtils.readYamlFile(configurationFile, JSONObject.class);
|
||||
Configuration defaultConfiguration = TemplateFileUtils.readDefaultConfig(classLoader, DEFAULT_CONFIGURATION_FILE_PATH, Configuration.class);
|
||||
// 配置文件自动更新 start
|
||||
boolean isChanged = false;
|
||||
// 1.0.3 配置文件更新 start
|
||||
if (configuration.getFriend() == null) {
|
||||
configuration.setFriend(defaultConfiguration.getFriend());
|
||||
isChanged = true;
|
||||
}
|
||||
if (Objects.isNull(configuration.getFriend().isAutoAccept())) {
|
||||
configuration.getFriend().setAutoAccept(defaultConfiguration.getFriend().getAutoAccept());
|
||||
isChanged = true;
|
||||
}
|
||||
if (configuration.getGroup() == null) {
|
||||
configuration.setGroup(defaultConfiguration.getGroup());
|
||||
isChanged = true;
|
||||
}
|
||||
if (Objects.isNull(configuration.getGroup().isAutoAccept())) {
|
||||
configuration.getGroup().setAutoAccept(defaultConfiguration.getGroup().getAutoAccept());
|
||||
isChanged = true;
|
||||
}
|
||||
// end
|
||||
// 1.0.7 配置文件自动更新
|
||||
if (configuration.getCommandPrefix() == null) {
|
||||
configuration.setCommandPrefix(defaultConfiguration.getCommandPrefix());
|
||||
isChanged = true;
|
||||
}
|
||||
if (configuration.getNetwork() == null) {
|
||||
configuration.setNetwork(defaultConfiguration.getNetwork());
|
||||
configuration.getNetwork().setWebsocket(fullConfiguration.getString("websocket"));
|
||||
isChanged = true;
|
||||
}
|
||||
// end
|
||||
if (isChanged) {
|
||||
log.warn("已自动升级配置文件,请检查config.yml是否有错误的地方,有则请修改");
|
||||
YamlUtils.writeYamlFile(configurationFile, configuration);
|
||||
}
|
||||
// 配置文件自动更新end
|
||||
|
||||
|
||||
return configuration;
|
||||
return YamlUtils.readYamlFile(configurationFile, Configuration.class);
|
||||
}
|
||||
|
||||
public static MyBot createBot(Configuration configuration) {
|
||||
public static MyBot createBot(Configuration configuration){
|
||||
return new MyBot(configuration);
|
||||
}
|
||||
|
||||
public static URI getUriFromConfiguration(Configuration configuration) {
|
||||
public static URI getUriFromConfiguration(Configuration configuration){
|
||||
URI uri;
|
||||
try {
|
||||
uri = new URI(configuration.getNetwork().getWebsocket());
|
||||
uri = new URI(configuration.getWebsocket());
|
||||
} catch (URISyntaxException e) {
|
||||
return null;
|
||||
}
|
||||
return uri;
|
||||
}
|
||||
|
||||
public static void loadPlugins(MyBot myBot) throws MalformedURLException {
|
||||
File pluginsDir = new File("plugins");
|
||||
if (TemplateFileUtils.createDefaultDirectory(pluginsDir)) {
|
||||
@ -133,37 +81,36 @@ public class Main {
|
||||
URI fileURI = file.toURI();
|
||||
PluginClassLoader pluginClassLoader = new PluginClassLoader(new URL[]{fileURI.toURL()}, myBot);
|
||||
BasePlugin load = ReflectionUtils.load(pluginClassLoader, file, pluginManager);
|
||||
if (load == null) {
|
||||
if (load == null){
|
||||
log.info("插件{}加载失败!", name);
|
||||
continue;
|
||||
}
|
||||
load.onLoad();
|
||||
}
|
||||
CommandManager commandManager = myBot.getCommandManager();
|
||||
commandManager.registerCommand(new StopCommand(myBot));
|
||||
}
|
||||
|
||||
public static WebSocketConnectionHandler createConnection(MyBot myBot, URI uri) {
|
||||
WebSocketConnectionHandler webSocketConnectionHandler = new WebSocketConnectionHandler(myBot, uri);
|
||||
webSocketConnectionHandler.connect();
|
||||
public static WebSocketConnectionHandler createConnection(MyBot myBot, URI uri){
|
||||
WebSocketConnectionHandler webSocketConnectionHandler = new WebSocketConnectionHandler(myBot);
|
||||
webSocketConnectionHandler.connect(uri);
|
||||
return webSocketConnectionHandler;
|
||||
}
|
||||
|
||||
public static void startConsole(MyBot myBot, WebSocketConnectionHandler webSocketConnectionHandler) {
|
||||
public static void startConsole(MyBot myBot, WebSocketConnectionHandler webSocketConnectionHandler){
|
||||
MyBotConsole myBotConsole = new MyBotConsole(myBot, webSocketConnectionHandler);
|
||||
myBotConsole.start();
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static void main(String[] args) {
|
||||
initializeJVM();
|
||||
initializeJsonUtils();
|
||||
log.info("启动MyBot...");
|
||||
Configuration configuration = getConfiguration();
|
||||
if (configuration == null) {
|
||||
if (configuration == null){
|
||||
return;
|
||||
}
|
||||
MyBot myBot = createBot(configuration);
|
||||
URI uri = getUriFromConfiguration(configuration);
|
||||
if (uri == null) {
|
||||
if (uri == null){
|
||||
log.error("无法解析websocket地址");
|
||||
return;
|
||||
}
|
||||
@ -173,21 +120,6 @@ public class Main {
|
||||
IMainApi mainApi = myBot.getMainApi();
|
||||
// 获取Bot消息
|
||||
mainApi.doApiCall(new GetLoginInfoAction());
|
||||
myBot.registerEventHandler(new CommandEventHandler());
|
||||
if (myBot.getConfiguration().getFriend().isAutoAccept()) {
|
||||
myBot.registerEventHandler(new FriendAddEventHandler());
|
||||
}
|
||||
if (myBot.getConfiguration().getGroup().isAutoAccept()) {
|
||||
myBot.registerEventHandler(new AddGroupEventHandler());
|
||||
}
|
||||
// 注册内置指令
|
||||
CommandManager commandManager = myBot.getCommandManager();
|
||||
commandManager.registerCommand(new StopCommand(myBot));
|
||||
commandManager.registerCommand(new OpCommand());
|
||||
commandManager.registerCommand(new HelpCommand());
|
||||
commandManager.registerCommand(new DeOpCommand());
|
||||
commandManager.registerCommand(new ListCommand());
|
||||
commandManager.registerCommand(new SendCommand());
|
||||
startConsole(myBot, webSocketConnectionHandler);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.wzpmc.api;
|
||||
package cn.wzpmc.api.api;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
@ -6,10 +6,9 @@ import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 抽象请求体
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/16 21:36
|
||||
* @version 0.0.5-dev
|
||||
*/
|
||||
@Getter
|
||||
@ToString
|
||||
@ -17,22 +16,19 @@ import java.util.UUID;
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@Setter(AccessLevel.PROTECTED)
|
||||
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
|
||||
*/
|
||||
private Actions action;
|
||||
/**
|
||||
* 请求参数
|
||||
*
|
||||
* @since 2024/8/23 21:29 v0.0.5-dev
|
||||
*/
|
||||
private REQUEST params;
|
||||
/**
|
||||
* 请求回调值(默认随机生成,不建议自己修改)
|
||||
* @since 2024/8/23 21:29 v0.0.5-dev
|
||||
*/
|
||||
private final UUID echo = UUID.randomUUID();
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.wzpmc.api;
|
||||
package cn.wzpmc.api.api;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -6,7 +6,6 @@ import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 请求操作返回
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/16 17:43
|
||||
@ -15,25 +14,21 @@ import java.util.UUID;
|
||||
public class ActionResponse<RESPONSE> {
|
||||
/**
|
||||
* 请求返回消息
|
||||
*
|
||||
* @since 2024/8/23 21:30 v0.0.5-dev
|
||||
*/
|
||||
private final String status;
|
||||
/**
|
||||
* 请求返回码
|
||||
*
|
||||
* @since 2024/8/23 21:30 v0.0.5-dev
|
||||
*/
|
||||
private final short retcode;
|
||||
/**
|
||||
* 请求返回数据
|
||||
*
|
||||
* @since 2024/8/23 21:31 v0.0.5-dev
|
||||
*/
|
||||
private final RESPONSE data;
|
||||
/**
|
||||
* 请求返回回调
|
||||
*
|
||||
* @since 2024/8/23 21:31 v0.0.5-dev
|
||||
*/
|
||||
private final UUID echo;
|
@ -1,253 +1,212 @@
|
||||
package cn.wzpmc.api;
|
||||
package cn.wzpmc.api.api;
|
||||
|
||||
import cn.wzpmc.api.actions.message.send.SendMessageActionResponseData;
|
||||
import cn.wzpmc.entities.*;
|
||||
import cn.wzpmc.user.IBot;
|
||||
import cn.wzpmc.user.IUser;
|
||||
import cn.wzpmc.api.api.actions.message.send.SendMessageActionResponseData;
|
||||
import cn.wzpmc.api.entities.*;
|
||||
import cn.wzpmc.api.user.IBot;
|
||||
import cn.wzpmc.api.user.IUser;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/16 22:24
|
||||
* @version 0.0.5-dev
|
||||
*/
|
||||
public enum Actions {
|
||||
/**
|
||||
* 发送私聊消息
|
||||
*
|
||||
* @since 2024/8/23 21:07 v0.0.5-dev
|
||||
*/
|
||||
SEND_PRIVATE_MSG(SendMessageActionResponseData.class),
|
||||
/**
|
||||
* 发送群消息
|
||||
*
|
||||
* @since 2024/8/23 21:07 v0.0.5-dev
|
||||
*/
|
||||
SEND_GROUP_MSG(SendMessageActionResponseData.class),
|
||||
/**
|
||||
* 撤回消息
|
||||
*
|
||||
* @since 2024/8/23 21:07 v0.0.5-dev
|
||||
*/
|
||||
DELETE_MSG,
|
||||
/**
|
||||
* 获取消息
|
||||
*
|
||||
* @since 2024/8/23 21:07 v0.0.5-dev
|
||||
*/
|
||||
GET_MSG(MessageInformation.class),
|
||||
/**
|
||||
* 获取合并转发消息
|
||||
*
|
||||
* @since 2024/8/23 21:08 v0.0.5-dev
|
||||
*/
|
||||
GET_FORWARD_MSG(MessageInformation.class),
|
||||
/**
|
||||
* 发送好友赞
|
||||
*
|
||||
* @since 2024/8/23 21:08 v0.0.5-dev
|
||||
*/
|
||||
SEND_LIKE,
|
||||
/**
|
||||
* 群组踢人
|
||||
*
|
||||
* @since 2024/8/23 21:08 v0.0.5-dev
|
||||
*/
|
||||
SET_GROUP_KICK,
|
||||
/**
|
||||
* 群组单人禁言
|
||||
*
|
||||
* @since 2024/8/23 21:08 v0.0.5-dev
|
||||
*/
|
||||
SET_GROUP_BAN,
|
||||
/**
|
||||
* 群组匿名用户禁言
|
||||
*
|
||||
* @since 2024/8/23 21:08 v0.0.5-dev
|
||||
*/
|
||||
SET_GROUP_ANONYMOUS_BAN,
|
||||
/**
|
||||
* 群组全员禁言
|
||||
*
|
||||
* @since 2024/8/23 21:09 v0.0.5-dev
|
||||
*/
|
||||
SET_GROUP_WHOLE_BAN,
|
||||
/**
|
||||
* 群组设置管理员
|
||||
*
|
||||
* @since 2024/8/23 21:09 v0.0.5-dev
|
||||
*/
|
||||
SET_GROUP_ADMIN,
|
||||
/**
|
||||
* 群组匿名
|
||||
*
|
||||
* @since 2024/8/23 21:09 v0.0.5-dev
|
||||
*/
|
||||
SET_GROUP_ANONYMOUS,
|
||||
/**
|
||||
* 设置群名片(群备注)
|
||||
*
|
||||
* @since 2024/8/23 21:09 v0.0.5-dev
|
||||
*/
|
||||
SET_GROUP_CARD,
|
||||
/**
|
||||
* 设置群名
|
||||
*
|
||||
* @since 2024/8/24 19:04 v0.0.6-dev
|
||||
*/
|
||||
SET_GROUP_NAME,
|
||||
/**
|
||||
* 退出群组
|
||||
*
|
||||
* @since 2024/8/24 20:01 v0.0.6-dev
|
||||
*/
|
||||
SET_GROUP_LEAVE,
|
||||
/**
|
||||
* 设置群组专属头衔
|
||||
*
|
||||
* @since 2024/8/24 20:01 v0.0.6-dev
|
||||
*/
|
||||
SET_GROUP_SPECIAL_TITLE,
|
||||
/**
|
||||
* 处理加好友请求
|
||||
*
|
||||
* @since 2024/8/24 20:01 v0.0.6-dev
|
||||
*/
|
||||
SET_FRIEND_ADD_REQUEST,
|
||||
/**
|
||||
* 处理加群请求/邀请
|
||||
*
|
||||
* @since 2024/8/24 20:02 v0.0.6-dev
|
||||
*/
|
||||
SET_GROUP_ADD_REQUEST,
|
||||
/**
|
||||
* 获取登录号信息
|
||||
*
|
||||
* @since 2024/8/24 20:02 v0.0.6-dev
|
||||
*/
|
||||
GET_LOGIN_INFO(IBot.class),
|
||||
/**
|
||||
* 获取陌生人信息
|
||||
*
|
||||
* @since 2024/8/24 20:02 v0.0.6-dev
|
||||
*/
|
||||
GET_STRANGER_INFO(IUser.class),
|
||||
/**
|
||||
* 获取好友列表
|
||||
*
|
||||
* @since 2024/8/24 20:02 v0.0.6-dev
|
||||
*/
|
||||
GET_FRIEND_LIST(FriendInformation.class, true),
|
||||
GET_FRIEND_LIST(MessageInformation.class, true),
|
||||
/**
|
||||
* 获取群信息
|
||||
*
|
||||
* @since 2024/8/24 20:02 v0.0.6-dev
|
||||
*/
|
||||
GET_GROUP_INFO(GroupInformation.class),
|
||||
/**
|
||||
* 获取群列表
|
||||
*
|
||||
* @since 2024/8/24 20:02 v0.0.6-dev
|
||||
*/
|
||||
GET_GROUP_LIST(GroupInformation.class, true),
|
||||
/**
|
||||
* 获取群成员信息
|
||||
*
|
||||
* @since 2024/8/24 20:02 v0.0.6-dev
|
||||
*/
|
||||
GET_GROUP_MEMBER_INFO(GroupMemberInformation.class),
|
||||
/**
|
||||
* 获取群成员列表
|
||||
*
|
||||
* @since 2024/8/24 20:03 v0.0.6-dev
|
||||
*/
|
||||
GET_GROUP_MEMBER_LIST(GroupMemberInformation.class, true),
|
||||
/**
|
||||
* 获取群荣誉信息
|
||||
*
|
||||
* @since 2024/8/24 20:03 v0.0.6-dev
|
||||
*/
|
||||
GET_GROUP_HONOR_INFO(HonorInformation.class),
|
||||
/**
|
||||
* 获取 Cookies
|
||||
*
|
||||
* @since 2024/8/24 20:03 v0.0.6-dev
|
||||
*/
|
||||
GET_COOKIES(CookiesInformation.class),
|
||||
/**
|
||||
* 获取 CSRF Token
|
||||
*
|
||||
* @since 2024/8/24 20:04 v0.0.6-dev
|
||||
*/
|
||||
GET_CSRF_TOKEN(CsrfTokenInformation.class),
|
||||
/**
|
||||
* 获取 QQ 相关接口凭证
|
||||
*
|
||||
* @since 2024/8/24 20:04 v0.0.6-dev
|
||||
*/
|
||||
GET_CREDENTIALS(CredentialsInformation.class),
|
||||
/**
|
||||
* 获取语音
|
||||
*
|
||||
* @since 2024/8/24 20:04 v0.0.6-dev
|
||||
*/
|
||||
GET_RECORD(FilePathInformation.class),
|
||||
/**
|
||||
* 获取图片
|
||||
*
|
||||
* @since 2024/8/24 20:04 v0.0.6-dev
|
||||
*/
|
||||
GET_IMAGE(FilePathInformation.class),
|
||||
/**
|
||||
* 检查是否可以发送图片
|
||||
*
|
||||
* @since 2024/8/24 20:04 v0.0.6-dev
|
||||
*/
|
||||
CAN_SEND_IMAGE(YesNo.class),
|
||||
/**
|
||||
* 检查是否可以发送语音
|
||||
*
|
||||
* @since 2024/8/24 20:04 v0.0.6-dev
|
||||
*/
|
||||
CAN_SEND_RECORD(YesNo.class),
|
||||
/**
|
||||
* 获取运行状态
|
||||
*
|
||||
* @since 2024/8/24 20:04 v0.0.6-dev
|
||||
*/
|
||||
GET_STATUS(BotStatus.class),
|
||||
/**
|
||||
* 获取版本信息
|
||||
*
|
||||
* @since 2024/8/24 20:04 v0.0.6-dev
|
||||
*/
|
||||
GET_VERSION_INFO(VersionInformation.class),
|
||||
/**
|
||||
* 重启 OneBot 实现
|
||||
*
|
||||
* @since 2024/8/24 20:05 v0.0.6-dev
|
||||
*/
|
||||
SET_RESTART,
|
||||
/**
|
||||
* 清理缓存
|
||||
*
|
||||
* @since 2024/8/24 20:05 v0.0.6-dev
|
||||
*/
|
||||
CLEAN_CACHE;
|
||||
public final Class<?> responseClass;
|
||||
public final boolean array;
|
||||
|
||||
Actions(Class<?> responseClass, boolean array) {
|
||||
this.responseClass = responseClass;
|
||||
this.array = array;
|
||||
}
|
||||
|
||||
Actions(Class<?> responseClass) {
|
||||
this(responseClass, false);
|
||||
}
|
||||
|
||||
Actions() {
|
||||
Actions(){
|
||||
this(Void.class);
|
||||
}
|
||||
}
|
21
src/main/java/cn/wzpmc/api/api/IMainApi.java
Normal file
21
src/main/java/cn/wzpmc/api/api/IMainApi.java
Normal file
@ -0,0 +1,21 @@
|
||||
package cn.wzpmc.api.api;
|
||||
|
||||
/**
|
||||
* 主Api接口
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/16 17:31
|
||||
*/
|
||||
public interface IMainApi {
|
||||
/**
|
||||
* 进行请求操作
|
||||
* @author wzp
|
||||
* @since 2024/8/23 21:32 v0.0.5-dev
|
||||
* @param packet 请求包
|
||||
* @return 请求返回包
|
||||
* @param <REQUEST> 请求类型
|
||||
* @param <RESPONSE> 返回类型
|
||||
* @throws InterruptedException 请求过程中出现Ctrl+C时抛出
|
||||
*/
|
||||
<REQUEST, RESPONSE> ActionResponse<RESPONSE> doApiCall(Action<REQUEST, RESPONSE> packet) throws InterruptedException;
|
||||
}
|
@ -1,11 +1,10 @@
|
||||
package cn.wzpmc.api.actions.message;
|
||||
package cn.wzpmc.api.api.actions.message;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
|
||||
/**
|
||||
* 清理缓存
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:46
|
||||
@ -13,7 +12,6 @@ import cn.wzpmc.api.Actions;
|
||||
public class CleanCacheAction extends Action<Void, Void> {
|
||||
/**
|
||||
* 清理缓存
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:59 v0.0.6-dev
|
||||
*/
|
@ -1,12 +1,11 @@
|
||||
package cn.wzpmc.api.actions.message.can;
|
||||
package cn.wzpmc.api.api.actions.message.can;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.YesNo;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.YesNo;
|
||||
|
||||
/**
|
||||
* 检查是否可以发送图片
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:45
|
||||
@ -14,11 +13,10 @@ import cn.wzpmc.entities.YesNo;
|
||||
public class CanSendImageAction extends Action<Void, YesNo> {
|
||||
/**
|
||||
* 检查是否可以发送图片
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:51 v0.0.6-dev
|
||||
*/
|
||||
public CanSendImageAction() {
|
||||
public CanSendImageAction(){
|
||||
super.setAction(Actions.CAN_SEND_IMAGE);
|
||||
}
|
||||
}
|
@ -1,12 +1,11 @@
|
||||
package cn.wzpmc.api.actions.message.can;
|
||||
package cn.wzpmc.api.api.actions.message.can;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.YesNo;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.YesNo;
|
||||
|
||||
/**
|
||||
* 检查是否可以发送语音
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:45
|
||||
@ -14,11 +13,10 @@ import cn.wzpmc.entities.YesNo;
|
||||
public class CanSendRecordAction extends Action<Void, YesNo> {
|
||||
/**
|
||||
* 检查是否可以发送语音
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:51 v0.0.6-dev
|
||||
*/
|
||||
public CanSendRecordAction() {
|
||||
public CanSendRecordAction(){
|
||||
super.setAction(Actions.CAN_SEND_RECORD);
|
||||
}
|
||||
}
|
@ -1,14 +1,13 @@
|
||||
package cn.wzpmc.api.actions.message.delete;
|
||||
package cn.wzpmc.api.api.actions.message.delete;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 撤回消息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/17 23:02
|
||||
@ -16,22 +15,19 @@ import lombok.Data;
|
||||
public class DeleteMessageAction extends Action<DeleteMessageAction.Params, Void> {
|
||||
/**
|
||||
* 撤回消息
|
||||
*
|
||||
* @param messageId 消息ID
|
||||
* @author wzp
|
||||
* @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.setParams(new Params(messageId));
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class Params {
|
||||
/**
|
||||
* 消息ID
|
||||
*
|
||||
* @since 2024/8/17 23:03 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(name = "message_id")
|
@ -1,14 +1,13 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.CookiesInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.CookiesInformation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取 Cookies
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:43
|
||||
@ -16,10 +15,9 @@ import lombok.Data;
|
||||
public class GetCookiesAction extends Action<GetCookiesAction.Params, CookiesInformation> {
|
||||
/**
|
||||
* 获取 Cookies
|
||||
*
|
||||
* @param domain 需要获取 cookies 的域名
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:51 v0.0.6-dev
|
||||
* @param domain 需要获取 cookies 的域名
|
||||
*/
|
||||
public GetCookiesAction(String domain) {
|
||||
super.setAction(Actions.GET_COOKIES);
|
||||
@ -28,20 +26,17 @@ public class GetCookiesAction extends Action<GetCookiesAction.Params, CookiesInf
|
||||
|
||||
/**
|
||||
* 获取 Cookies
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:51 v0.0.6-dev
|
||||
*/
|
||||
public GetCookiesAction() {
|
||||
this("");
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 需要获取 cookies 的域名
|
||||
*
|
||||
* @since 2024/8/24 23:32 v0.0.6-dev
|
||||
*/
|
||||
private String domain;
|
@ -1,14 +1,13 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.CredentialsInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.CredentialsInformation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取 QQ 相关接口凭证
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:44
|
||||
@ -16,10 +15,9 @@ import lombok.Data;
|
||||
public class GetCredentialsAction extends Action<GetCredentialsAction.Params, CredentialsInformation> {
|
||||
/**
|
||||
* 获取 QQ 相关接口凭证
|
||||
*
|
||||
* @param domain 需要获取 cookies 的域名
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:51 v0.0.6-dev
|
||||
* @param domain 需要获取 cookies 的域名
|
||||
*/
|
||||
public GetCredentialsAction(String domain) {
|
||||
super.setAction(Actions.GET_COOKIES);
|
||||
@ -28,20 +26,17 @@ public class GetCredentialsAction extends Action<GetCredentialsAction.Params, Cr
|
||||
|
||||
/**
|
||||
* 获取 QQ 相关接口凭证
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:52 v0.0.6-dev
|
||||
*/
|
||||
public GetCredentialsAction() {
|
||||
this("");
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 需要获取 cookies 的域名
|
||||
*
|
||||
* @since 2024/8/24 23:32 v0.0.6-dev
|
||||
*/
|
||||
private String domain;
|
@ -1,12 +1,11 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.CsrfTokenInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.CsrfTokenInformation;
|
||||
|
||||
/**
|
||||
* 获取 CSRF Token
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:44
|
||||
@ -14,11 +13,10 @@ import cn.wzpmc.entities.CsrfTokenInformation;
|
||||
public class GetCsrfTokenAction extends Action<Void, CsrfTokenInformation> {
|
||||
/**
|
||||
* 获取 CSRF Token
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:52 v0.0.6-dev
|
||||
*/
|
||||
public GetCsrfTokenAction() {
|
||||
public GetCsrfTokenAction(){
|
||||
super.setAction(Actions.GET_CSRF_TOKEN);
|
||||
}
|
||||
}
|
@ -1,14 +1,13 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.MessageInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.MessageInformation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取合并转发消息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/23 19:46
|
||||
@ -16,22 +15,19 @@ import lombok.Data;
|
||||
public class GetForwardMessageAction extends Action<GetForwardMessageAction.Params, MessageInformation> {
|
||||
/**
|
||||
* 获取合并转发消息
|
||||
*
|
||||
* @param id 合并转发ID
|
||||
* @author wzp
|
||||
* @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.setParams(new GetForwardMessageAction.Params(id));
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 合并转发ID
|
||||
*
|
||||
* @since 2024/8/23 19:47 v0.0.5-dev
|
||||
*/
|
||||
private String id;
|
@ -1,26 +1,24 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.FriendInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.MessageInformation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取好友列表
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:41
|
||||
*/
|
||||
public class GetFriendListAction extends Action<Void, List<FriendInformation>> {
|
||||
public class GetFriendListAction extends Action<Void, List<MessageInformation>> {
|
||||
/**
|
||||
* 获取好友列表
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:52 v0.0.6-dev
|
||||
*/
|
||||
public GetFriendListAction() {
|
||||
public GetFriendListAction(){
|
||||
super.setAction(Actions.GET_FRIEND_LIST);
|
||||
}
|
||||
}
|
@ -1,16 +1,15 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.HonorInformation;
|
||||
import cn.wzpmc.entities.HonorType;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.HonorInformation;
|
||||
import cn.wzpmc.api.entities.HonorType;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取群荣誉信息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:43
|
||||
@ -18,11 +17,10 @@ import lombok.Data;
|
||||
public class GetGroupHonorInfoAction extends Action<GetGroupHonorInfoAction.Params, HonorInformation> {
|
||||
/**
|
||||
* 获取群荣誉信息
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @param type 要获取的群荣誉类型,可传入 talkative performer legend strong_newbie emotion 以分别获取单个类型的群荣誉数据,或传入 all 获取所有数据
|
||||
* @author wzp
|
||||
* @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) {
|
||||
this.setAction(Actions.GET_GROUP_HONOR_INFO);
|
||||
@ -31,28 +29,24 @@ public class GetGroupHonorInfoAction extends Action<GetGroupHonorInfoAction.Para
|
||||
|
||||
/**
|
||||
* 获取群荣誉信息
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:53 v0.0.6-dev
|
||||
* @param groupId 群号
|
||||
*/
|
||||
public GetGroupHonorInfoAction(Long groupId) {
|
||||
this(groupId, HonorType.ALL);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 群号
|
||||
*
|
||||
* @since 2024/8/24 23:52 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "group_id")
|
||||
private Long groupId;
|
||||
/**
|
||||
* 要获取的群荣誉类型,可传入 talkative performer legend strong_newbie emotion 以分别获取单个类型的群荣誉数据,或传入 all 获取所有数据
|
||||
*
|
||||
* @since 2024/8/24 23:52 v0.0.6-dev
|
||||
*/
|
||||
private HonorType type;
|
@ -1,15 +1,14 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.GroupInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.GroupInformation;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取群信息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:41
|
||||
@ -17,41 +16,36 @@ import lombok.Data;
|
||||
public class GetGroupInfoAction extends Action<GetGroupInfoAction.Params, GroupInformation> {
|
||||
/**
|
||||
* 获取群信息
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @param noCache 是否不使用缓存(使用缓存可能更新不及时,但响应更快)
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:53 v0.0.6-dev
|
||||
* @param groupId 群号
|
||||
* @param noCache 是否不使用缓存(使用缓存可能更新不及时,但响应更快)
|
||||
*/
|
||||
public GetGroupInfoAction(Long groupId, Boolean noCache) {
|
||||
public GetGroupInfoAction(Long groupId, Boolean noCache){
|
||||
super.setAction(Actions.GET_GROUP_INFO);
|
||||
super.setParams(new Params(groupId, noCache));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取群信息
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:53 v0.0.6-dev
|
||||
* @param groupId 群号
|
||||
*/
|
||||
public GetGroupInfoAction(Long groupId) {
|
||||
public GetGroupInfoAction(Long groupId){
|
||||
this(groupId, false);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 群号
|
||||
*
|
||||
* @since 2024/8/24 22:58 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "group_id")
|
||||
private Long groupId;
|
||||
/**
|
||||
* 是否不使用缓存(使用缓存可能更新不及时,但响应更快)
|
||||
*
|
||||
* @since 2024/8/24 22:58 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "no_cache", defaultValue = "false")
|
@ -1,14 +1,13 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.GroupInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.GroupInformation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取群列表
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:42
|
||||
@ -16,11 +15,10 @@ import java.util.List;
|
||||
public class GetGroupListAction extends Action<Void, List<GroupInformation>> {
|
||||
/**
|
||||
* 获取群列表
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:54 v0.0.6-dev
|
||||
*/
|
||||
public GetGroupListAction() {
|
||||
public GetGroupListAction(){
|
||||
super.setAction(Actions.GET_GROUP_LIST);
|
||||
}
|
||||
}
|
@ -1,15 +1,14 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.GroupMemberInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.GroupMemberInformation;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取群成员信息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:42
|
||||
@ -17,50 +16,44 @@ import lombok.Data;
|
||||
public class GetGroupMemberInfoAction extends Action<GetGroupMemberInfoAction.Params, GroupMemberInformation> {
|
||||
/**
|
||||
* 获取群成员信息
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @param userId QQ 号
|
||||
* @param noCache 是否不使用缓存
|
||||
* @author wzp
|
||||
* @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.setParams(new Params(groupId, userId, noCache));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取群成员信息
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @param userId QQ 号
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:54 v0.0.6-dev
|
||||
* @param groupId 群号
|
||||
* @param userId QQ 号
|
||||
*/
|
||||
public GetGroupMemberInfoAction(Long groupId, Long userId) {
|
||||
this(groupId, userId, false);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 群号
|
||||
*
|
||||
* @since 2024/8/24 23:02 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "group_id")
|
||||
private Long groupId;
|
||||
/**
|
||||
* QQ 号
|
||||
*
|
||||
* @since 2024/8/24 23:02 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "user_id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 是否不使用缓存
|
||||
*
|
||||
* @since 2024/8/24 23:02 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "no_cache", defaultValue = "false")
|
@ -1,8 +1,8 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.GroupMemberInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.GroupMemberInformation;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -11,7 +11,6 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取群成员列表
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:42
|
||||
@ -19,22 +18,19 @@ import java.util.List;
|
||||
public class GetGroupMemberListAction extends Action<GetGroupMemberListAction.Params, List<GroupMemberInformation>> {
|
||||
/**
|
||||
* 获取群成员列表
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:54 v0.0.6-dev
|
||||
* @param groupId 群号
|
||||
*/
|
||||
public GetGroupMemberListAction(Long groupId) {
|
||||
super.setAction(Actions.GET_GROUP_MEMBER_LIST);
|
||||
super.setParams(new Params(groupId));
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 群号
|
||||
*
|
||||
* @since 2024/8/24 23:08 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "group_id")
|
@ -1,14 +1,13 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.FilePathInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.FilePathInformation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取图片
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:44
|
||||
@ -16,22 +15,19 @@ import lombok.Data;
|
||||
public class GetImageAction extends Action<GetImageAction.Params, FilePathInformation> {
|
||||
/**
|
||||
* 获取图片
|
||||
*
|
||||
* @param file 收到的图片文件名(消息段的 file 参数),如 6B4DE3DFD1BD271E3297859D41C530F5.jpg
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:55 v0.0.6-dev
|
||||
* @param file 收到的图片文件名(消息段的 file 参数),如 6B4DE3DFD1BD271E3297859D41C530F5.jpg
|
||||
*/
|
||||
public GetImageAction(String file) {
|
||||
super.setAction(Actions.GET_IMAGE);
|
||||
super.setParams(new Params(file));
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 收到的图片文件名(消息段的 file 参数),如 6B4DE3DFD1BD271E3297859D41C530F5.jpg
|
||||
*
|
||||
* @since 2024/8/24 23:41 v0.0.6-dev
|
||||
*/
|
||||
private String file;
|
@ -1,12 +1,11 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.user.IBot;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.user.IBot;
|
||||
|
||||
/**
|
||||
* 获取登录号信息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:18
|
||||
@ -14,7 +13,6 @@ import cn.wzpmc.user.IBot;
|
||||
public class GetLoginInfoAction extends Action<Void, IBot> {
|
||||
/**
|
||||
* 获取登录号信息
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:55 v0.0.6-dev
|
||||
*/
|
@ -1,15 +1,14 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.MessageInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.MessageInformation;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取消息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/17 23:07
|
||||
@ -17,22 +16,19 @@ import lombok.Data;
|
||||
public class GetMessageAction extends Action<GetMessageAction.Params, MessageInformation> {
|
||||
/**
|
||||
* 获取消息
|
||||
*
|
||||
* @param messageId 消息 ID
|
||||
* @author wzp
|
||||
* @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.setParams(new Params(messageId));
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class Params {
|
||||
/**
|
||||
* 消息 ID
|
||||
*
|
||||
* @since 2024/8/23 21:11 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(name = "message_id")
|
@ -1,15 +1,14 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.FilePathInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.FilePathInformation;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取语音
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:44
|
||||
@ -17,29 +16,25 @@ import lombok.Data;
|
||||
public class GetRecordAction extends Action<GetRecordAction.Params, FilePathInformation> {
|
||||
/**
|
||||
* 获取语音
|
||||
*
|
||||
* @param file 收到的语音文件名(消息段的 file 参数),如 0B38145AA44505000B38145AA4450500.silk
|
||||
* @param outFormat 要转换到的格式,目前支持 mp3、amr、wma、m4a、spx、ogg、wav、flac
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:55 v0.0.6-dev
|
||||
* @param file 收到的语音文件名(消息段的 file 参数),如 0B38145AA44505000B38145AA4450500.silk
|
||||
* @param outFormat 要转换到的格式,目前支持 mp3、amr、wma、m4a、spx、ogg、wav、flac
|
||||
*/
|
||||
public GetRecordAction(String file, String outFormat) {
|
||||
public GetRecordAction(String file, String outFormat){
|
||||
super.setAction(Actions.GET_RECORD);
|
||||
super.setParams(new Params(file, outFormat));
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 收到的语音文件名(消息段的 file 参数),如 0B38145AA44505000B38145AA4450500.silk
|
||||
*
|
||||
* @since 2024/8/24 23:35 v0.0.6-dev
|
||||
*/
|
||||
private String file;
|
||||
/**
|
||||
* 要转换到的格式,目前支持 mp3、amr、wma、m4a、spx、ogg、wav、flac
|
||||
*
|
||||
* @since 2024/8/24 23:35 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "out_format")
|
@ -1,12 +1,11 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.BotStatus;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.BotStatus;
|
||||
|
||||
/**
|
||||
* 获取运行状态
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:45
|
||||
@ -14,11 +13,10 @@ import cn.wzpmc.entities.BotStatus;
|
||||
public class GetStatusAction extends Action<Void, BotStatus> {
|
||||
/**
|
||||
* 获取运行状态
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:55 v0.0.6-dev
|
||||
*/
|
||||
public GetStatusAction() {
|
||||
public GetStatusAction(){
|
||||
super.setAction(Actions.GET_STATUS);
|
||||
}
|
||||
}
|
@ -1,15 +1,14 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.user.IUser;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.user.IUser;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 获取陌生人信息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:41
|
||||
@ -17,41 +16,36 @@ import lombok.Data;
|
||||
public class GetStrangerInfoAction extends Action<GetStrangerInfoAction.Params, IUser> {
|
||||
/**
|
||||
* 获取陌生人信息
|
||||
*
|
||||
* @param userId QQ 号
|
||||
* @param noCache 是否不使用缓存(使用缓存可能更新不及时,但响应更快)
|
||||
* @author wzp
|
||||
* @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.setParams(new GetStrangerInfoAction.Params(userId, noCache));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取陌生人信息
|
||||
*
|
||||
* @param userId QQ 号
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:55 v0.0.6-dev
|
||||
* @param userId QQ 号
|
||||
*/
|
||||
public GetStrangerInfoAction(Long userId) {
|
||||
public GetStrangerInfoAction(Long userId){
|
||||
this(userId, false);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* QQ 号
|
||||
*
|
||||
* @since 2024/8/24 22:52 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "user_id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 是否不使用缓存(使用缓存可能更新不及时,但响应更快)
|
||||
*
|
||||
* @since 2024/8/24 22:52 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "no_cache", defaultValue = "false")
|
@ -1,12 +1,11 @@
|
||||
package cn.wzpmc.api.actions.message.get;
|
||||
package cn.wzpmc.api.api.actions.message.get;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.entities.VersionInformation;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.entities.VersionInformation;
|
||||
|
||||
/**
|
||||
* 获取版本信息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:45
|
||||
@ -14,11 +13,10 @@ import cn.wzpmc.entities.VersionInformation;
|
||||
public class GetVersionInfoAction extends Action<Void, VersionInformation> {
|
||||
/**
|
||||
* 获取版本信息
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:55 v0.0.6-dev
|
||||
*/
|
||||
public GetVersionInfoAction() {
|
||||
public GetVersionInfoAction(){
|
||||
super.setAction(Actions.GET_VERSION_INFO);
|
||||
|
||||
}
|
@ -1,15 +1,14 @@
|
||||
package cn.wzpmc.api.actions.message.send;
|
||||
package cn.wzpmc.api.api.actions.message.send;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.message.MessageComponent;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.message.MessageComponent;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 发送群消息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/17 22:52
|
||||
@ -17,49 +16,43 @@ import lombok.Data;
|
||||
public class SendGroupMessageAction extends Action<SendGroupMessageAction.Params, SendMessageActionResponseData> {
|
||||
/**
|
||||
* 发送群消息
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @param message 要发送的内容
|
||||
* @param autoEscape 消息内容是否作为纯文本发送(即不解析 CQ 码),只在 message 字段是字符串时有效
|
||||
* @author wzp
|
||||
* @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.setParams(new SendGroupMessageAction.Params(groupId, message, autoEscape));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送群消息
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @param message 要发送的内容
|
||||
* @author wzp
|
||||
* @since 2024/8/23 21:11 v0.0.5-dev
|
||||
* @param groupId 群号
|
||||
* @param message 要发送的内容
|
||||
*/
|
||||
public SendGroupMessageAction(Long groupId, MessageComponent message) {
|
||||
public SendGroupMessageAction(Long groupId, MessageComponent message){
|
||||
this(groupId, message, false);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class Params {
|
||||
/**
|
||||
* 群号
|
||||
*
|
||||
* @since 2024/8/17 22:54 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(name = "group_id")
|
||||
private Long groupId;
|
||||
/**
|
||||
* 要发送的内容
|
||||
*
|
||||
* @since 2024/8/17 22:54 v0.0.5-dev
|
||||
*/
|
||||
private MessageComponent message;
|
||||
/**
|
||||
* 消息内容是否作为纯文本发送(即不解析 CQ 码),只在 message 字段是字符串时有效
|
||||
*
|
||||
* @since 2024/8/17 22:51 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(name = "auto_escape")
|
@ -1,14 +1,13 @@
|
||||
package cn.wzpmc.api.actions.message.send;
|
||||
package cn.wzpmc.api.api.actions.message.send;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 发送好友赞
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/23 19:49
|
||||
@ -16,41 +15,36 @@ import lombok.Data;
|
||||
public class SendLikeAction extends Action<SendLikeAction.Params, Void> {
|
||||
/**
|
||||
* 发送好友赞
|
||||
*
|
||||
* @param userId 对方 QQ 号
|
||||
* @param times 赞的次数,每个好友每天最多 10 次
|
||||
* @author wzp
|
||||
* @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.setParams(new Params(userId, times));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送好友赞
|
||||
*
|
||||
* @param userId 对方 QQ 号
|
||||
* @author wzp
|
||||
* @since 2024/8/23 21:12 v0.0.5-dev
|
||||
* @param userId 对方 QQ 号
|
||||
*/
|
||||
public SendLikeAction(Long userId) {
|
||||
public SendLikeAction(Long userId){
|
||||
this(userId, 1L);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 对方 QQ 号
|
||||
*
|
||||
* @since 2024/8/23 21:12 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(name = "user_id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 赞的次数,每个好友每天最多 10 次
|
||||
*
|
||||
* @since 2024/8/23 21:12 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(defaultValue = "1")
|
@ -1,11 +1,10 @@
|
||||
package cn.wzpmc.api.actions.message.send;
|
||||
package cn.wzpmc.api.api.actions.message.send;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 发送私聊消息返回
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/17 21:55
|
||||
@ -14,7 +13,6 @@ import lombok.Data;
|
||||
public class SendMessageActionResponseData {
|
||||
/**
|
||||
* 消息 ID
|
||||
*
|
||||
* @since 2024/8/17 22:51 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(name = "message_id")
|
@ -1,15 +1,14 @@
|
||||
package cn.wzpmc.api.actions.message.send;
|
||||
package cn.wzpmc.api.api.actions.message.send;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.message.MessageComponent;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.message.MessageComponent;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 发送私聊消息
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/17 21:54
|
||||
@ -17,49 +16,43 @@ import lombok.Data;
|
||||
public class SendPrivateMessageAction extends Action<SendPrivateMessageAction.Params, SendMessageActionResponseData> {
|
||||
/**
|
||||
* 发送私聊消息
|
||||
*
|
||||
* @param userId 对方 QQ 号
|
||||
* @param message 要发送的内容
|
||||
* @param autoEscape 消息内容是否作为纯文本发送(即不解析 CQ 码),只在 message 字段是字符串时有效
|
||||
* @author wzp
|
||||
* @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.setParams(new Params(userId, message, autoEscape));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送私聊消息
|
||||
*
|
||||
* @param userId 对方 QQ 号
|
||||
* @param message 要发送的内容
|
||||
* @author wzp
|
||||
* @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);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static class Params {
|
||||
/**
|
||||
* 对方 QQ 号
|
||||
*
|
||||
* @since 2024/8/17 22:51 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(name = "user_id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 要发送的内容
|
||||
*
|
||||
* @since 2024/8/17 22:51 v0.0.5-dev
|
||||
*/
|
||||
private MessageComponent message;
|
||||
/**
|
||||
* 消息内容是否作为纯文本发送(即不解析 CQ 码),只在 message 字段是字符串时有效
|
||||
*
|
||||
* @since 2024/8/17 22:51 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(name = "auto_escape")
|
@ -1,14 +1,13 @@
|
||||
package cn.wzpmc.api.actions.message.set;
|
||||
package cn.wzpmc.api.api.actions.message.set;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 处理加好友请求
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:08
|
||||
@ -16,25 +15,23 @@ import lombok.Data;
|
||||
public class SetFriendAddRequestAction extends Action<SetFriendAddRequestAction.Params, Void> {
|
||||
/**
|
||||
* 处理加好友请求
|
||||
*
|
||||
* @param flag 加好友请求的 flag(需从上报的数据中获得)
|
||||
* @param approve 是否同意请求
|
||||
* @param remark 添加后的好友备注(仅在同意时有效)
|
||||
* @author wzp
|
||||
* @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.setParams(new Params(flag, approve, remark));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理加好友请求
|
||||
*
|
||||
* @param flag 加好友请求的 flag(需从上报的数据中获得)
|
||||
* @param approve 是否同意请求
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:56 v0.0.6-dev
|
||||
* @param flag 加好友请求的 flag(需从上报的数据中获得)
|
||||
* @param approve 是否同意请求
|
||||
*/
|
||||
public SetFriendAddRequestAction(String flag, boolean approve) {
|
||||
this(flag, approve, "");
|
||||
@ -42,11 +39,10 @@ public class SetFriendAddRequestAction extends Action<SetFriendAddRequestAction.
|
||||
|
||||
/**
|
||||
* 处理加好友请求
|
||||
*
|
||||
* @param flag 加好友请求的 flag(需从上报的数据中获得)
|
||||
* @param remark 添加后的好友备注(仅在同意时有效)
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:56 v0.0.6-dev
|
||||
* @param flag 加好友请求的 flag(需从上报的数据中获得)
|
||||
* @param remark 添加后的好友备注(仅在同意时有效)
|
||||
*/
|
||||
public SetFriendAddRequestAction(String flag, String remark) {
|
||||
this(flag, true, remark);
|
||||
@ -54,34 +50,29 @@ public class SetFriendAddRequestAction extends Action<SetFriendAddRequestAction.
|
||||
|
||||
/**
|
||||
* 处理加好友请求
|
||||
*
|
||||
* @param flag 加好友请求的 flag(需从上报的数据中获得)
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:56 v0.0.6-dev
|
||||
* @param flag 加好友请求的 flag(需从上报的数据中获得)
|
||||
*/
|
||||
public SetFriendAddRequestAction(String flag) {
|
||||
this(flag, true);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 加好友请求的 flag(需从上报的数据中获得)
|
||||
*
|
||||
* @since 2024/8/24 21:09 v0.0.6-dev
|
||||
*/
|
||||
private String flag;
|
||||
/**
|
||||
* 是否同意请求
|
||||
*
|
||||
* @since 2024/8/24 21:09 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(defaultValue = "true")
|
||||
private boolean approve;
|
||||
/**
|
||||
* 添加后的好友备注(仅在同意时有效)
|
||||
*
|
||||
* @since 2024/8/24 21:09 v0.0.6-dev
|
||||
*/
|
||||
private String remark;
|
@ -1,15 +1,14 @@
|
||||
package cn.wzpmc.api.actions.message.set;
|
||||
package cn.wzpmc.api.api.actions.message.set;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.events.request.group.GroupJoinRequestEventSubType;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import cn.wzpmc.api.events.request.group.GroupJoinRequestEventSubType;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 处理加群请求/邀请
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.6-dev
|
||||
* @since 2024/8/24 20:18
|
||||
@ -17,13 +16,12 @@ import lombok.Data;
|
||||
public class SetGroupAddRequestAction extends Action<SetGroupAddRequestAction.Params, Void> {
|
||||
/**
|
||||
* 处理加群请求/邀请
|
||||
*
|
||||
* @param flag 加群请求的 flag(需从上报的数据中获得)
|
||||
* @param type 请求类型
|
||||
* @param approve 是否同意请求/邀请
|
||||
* @param reason 拒绝理由(仅在拒绝时有效)
|
||||
* @author wzp
|
||||
* @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) {
|
||||
super.setAction(Actions.SET_GROUP_ADD_REQUEST);
|
||||
@ -32,12 +30,11 @@ public class SetGroupAddRequestAction extends Action<SetGroupAddRequestAction.Pa
|
||||
|
||||
/**
|
||||
* 处理加群请求/邀请
|
||||
*
|
||||
* @param flag 加群请求的 flag(需从上报的数据中获得)
|
||||
* @param type 请求类型
|
||||
* @param reason 拒绝理由(仅在拒绝时有效)
|
||||
* @author wzp
|
||||
* @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) {
|
||||
this(flag, type, false, reason);
|
||||
@ -45,41 +42,35 @@ public class SetGroupAddRequestAction extends Action<SetGroupAddRequestAction.Pa
|
||||
|
||||
/**
|
||||
* 处理加群请求/邀请
|
||||
*
|
||||
* @param flag 加群请求的 flag(需从上报的数据中获得)
|
||||
* @param type 请求类型
|
||||
* @author wzp
|
||||
* @since 2024/8/24 23:56 v0.0.6-dev
|
||||
* @param flag 加群请求的 flag(需从上报的数据中获得)
|
||||
* @param type 请求类型
|
||||
*/
|
||||
public SetGroupAddRequestAction(String flag, GroupJoinRequestEventSubType type) {
|
||||
this(flag, type, true, "");
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 加群请求的 flag(需从上报的数据中获得)
|
||||
*
|
||||
* @since 2024/8/24 21:14 v0.0.6-dev
|
||||
*/
|
||||
private String flag;
|
||||
/**
|
||||
* 请求类型
|
||||
*
|
||||
* @since 2024/8/24 21:14 v0.0.6-dev
|
||||
*/
|
||||
private GroupJoinRequestEventSubType type;
|
||||
/**
|
||||
* 是否同意请求/邀请
|
||||
*
|
||||
* @since 2024/8/24 21:14 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(defaultValue = "true")
|
||||
private boolean approve;
|
||||
/**
|
||||
* 拒绝理由(仅在拒绝时有效)
|
||||
*
|
||||
* @since 2024/8/24 21:14 v0.0.6-dev
|
||||
*/
|
||||
private String reason;
|
@ -1,14 +1,13 @@
|
||||
package cn.wzpmc.api.actions.message.set;
|
||||
package cn.wzpmc.api.api.actions.message.set;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.Actions;
|
||||
import cn.wzpmc.api.api.Action;
|
||||
import cn.wzpmc.api.api.Actions;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 群组设置管理员
|
||||
*
|
||||
* @author wzp
|
||||
* @version 0.0.5-dev
|
||||
* @since 2024/8/23 20:51
|
||||
@ -16,50 +15,44 @@ import lombok.Data;
|
||||
public class SetGroupAdminAction extends Action<SetGroupAdminAction.Params, Void> {
|
||||
/**
|
||||
* 群组设置管理员
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @param userId 要设置管理员的 QQ 号
|
||||
* @param enable true 为设置,false 为取消
|
||||
* @author wzp
|
||||
* @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.setParams(new Params(groupId, userId, enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* 群组设置管理员
|
||||
*
|
||||
* @param groupId 群号
|
||||
* @param userId 要设置管理员的 QQ 号
|
||||
* @author wzp
|
||||
* @since 2024/8/23 21:14 v0.0.5-dev
|
||||
* @param groupId 群号
|
||||
* @param userId 要设置管理员的 QQ 号
|
||||
*/
|
||||
public SetGroupAdminAction(Long groupId, Long userId) {
|
||||
this(groupId, userId, true);
|
||||
}
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public static final class Params {
|
||||
/**
|
||||
* 群号
|
||||
*
|
||||
* @since 2024/8/23 21:15 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(name = "group_id")
|
||||
private Long groupId;
|
||||
/**
|
||||
* 要设置管理员的 QQ 号
|
||||
*
|
||||
* @since 2024/8/23 21:15 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(name = "user_id")
|
||||
private Long userId;
|
||||
/**
|
||||
* true 为设置,false 为取消
|
||||
*
|
||||
* @since 2024/8/23 21:15 v0.0.5-dev
|
||||
*/
|
||||
@JSONField(defaultValue = "true")
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user