Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
e5788822ed | |||
d9d3bb2a5b | |||
6eea40e134 | |||
d2cb0728cd | |||
c6c119da39 | |||
2bdb11622f | |||
3e1b71c149 | |||
9b9b55ed85 | |||
8b729519b0 | |||
57177510d5 | |||
ad2d5a085e | |||
94937e990e | |||
6526af0437 | |||
dc1f35ca0d | |||
bc57932783 | |||
4c5fc7a673 | |||
a8c46c6ef7 |
6
.idea/ApifoxUploaderProjectSetting.xml
generated
Normal file
6
.idea/ApifoxUploaderProjectSetting.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ApifoxUploaderProjectSetting">
|
||||
<option name="apiAccessToken" value="APS-QWelq6AktQqByilNWeWZgKoPT7a4ml1d" />
|
||||
</component>
|
||||
</project>
|
2
.idea/fileTemplates/includes/Version.txt
generated
2
.idea/fileTemplates/includes/Version.txt
generated
@ -1 +1 @@
|
||||
1.0.3
|
||||
1.0.7
|
3
.idea/gradle.xml
generated
3
.idea/gradle.xml
generated
@ -4,8 +4,9 @@
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="distributionType" value="LOCAL" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="" />
|
||||
<option name="gradleHome" value="$USER_HOME$/.sdkman/candidates/gradle/current" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
20
.idea/jarRepositories.xml
generated
20
.idea/jarRepositories.xml
generated
@ -21,5 +21,25 @@
|
||||
<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>
|
9
.idea/modules.xml
generated
Normal file
9
.idea/modules.xml
generated
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<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
Normal file
8
.idea/modules/MyBot.iml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$/../.." dumb="true">
|
||||
<excludeFolder url="file://$MODULE_DIR$/../../run" />
|
||||
</content>
|
||||
</component>
|
||||
</module>
|
8
.idea/modules/MyBot.main.iml
generated
Normal file
8
.idea/modules/MyBot.main.iml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$/../../build/generated/sources/annotationProcessor/java/main">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../build/generated/sources/annotationProcessor/java/main" isTestSource="false" generated="true" />
|
||||
</content>
|
||||
</component>
|
||||
</module>
|
8
.idea/modules/mybot-api/MyBot.mybot-api.main.iml
generated
Normal file
8
.idea/modules/mybot-api/MyBot.mybot-api.main.iml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$/../../../mybot-api/build/generated/sources/annotationProcessor/java/main">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../../mybot-api/build/generated/sources/annotationProcessor/java/main" isTestSource="false" generated="true" />
|
||||
</content>
|
||||
</component>
|
||||
</module>
|
@ -14,7 +14,7 @@ allprojects {
|
||||
apply(plugin = "java-library")
|
||||
val groupName by extra("cn.wzpmc")
|
||||
val projectArtifactId by extra("my-bot")
|
||||
val projectVersion by extra("1.0.4")
|
||||
val projectVersion by extra("1.0.7-SNAPSHOT")
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://libraries.minecraft.net")
|
||||
@ -31,7 +31,7 @@ allprojects {
|
||||
testImplementation(platform("org.junit:junit-bom:5.10.0"))
|
||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||
// https://mvnrepository.com/artifact/org.yaml/snakeyaml
|
||||
implementation("org.yaml:snakeyaml:2.2")
|
||||
api("org.yaml:snakeyaml:2.2")
|
||||
}
|
||||
tasks.compileJava {
|
||||
options.encoding = "UTF-8"
|
||||
|
2
docs/.gitignore
vendored
Normal file
2
docs/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.idea/
|
||||
node_modules/
|
5
docs/.idea/.gitignore
generated
vendored
Normal file
5
docs/.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
12
docs/.idea/docs.iml
generated
Normal file
12
docs/.idea/docs.iml
generated
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
8
docs/.idea/modules.xml
generated
Normal file
8
docs/.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/docs.iml" filepath="$PROJECT_DIR$/.idea/docs.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
6
docs/.idea/vcs.xml
generated
Normal file
6
docs/.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
1
docs/.vitepress/.gitignore
vendored
Normal file
1
docs/.vitepress/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
cache/
|
269
docs/.vitepress/cache/deps/@theme_index.js
vendored
Normal file
269
docs/.vitepress/cache/deps/@theme_index.js
vendored
Normal file
@ -0,0 +1,269 @@
|
||||
import {
|
||||
useMediaQuery
|
||||
} from "./chunk-WVCZVGU2.js";
|
||||
import {
|
||||
computed,
|
||||
ref,
|
||||
shallowRef,
|
||||
watch
|
||||
} from "./chunk-XIDTNVOX.js";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/index.js
|
||||
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/fonts.css";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/without-fonts.js
|
||||
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/vars.css";
|
||||
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/base.css";
|
||||
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/icons.css";
|
||||
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/utils.css";
|
||||
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/components/custom-block.css";
|
||||
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code.css";
|
||||
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code-group.css";
|
||||
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/components/vp-doc.css";
|
||||
import "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/styles/components/vp-sponsor.css";
|
||||
import VPBadge from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue";
|
||||
import Layout from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/Layout.vue";
|
||||
import { default as default2 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue";
|
||||
import { default as default3 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPImage.vue";
|
||||
import { default as default4 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPButton.vue";
|
||||
import { default as default5 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPHomeContent.vue";
|
||||
import { default as default6 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPHomeHero.vue";
|
||||
import { default as default7 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPHomeFeatures.vue";
|
||||
import { default as default8 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPHomeSponsors.vue";
|
||||
import { default as default9 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPLink.vue";
|
||||
import { default as default10 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPDocAsideSponsors.vue";
|
||||
import { default as default11 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPSocialLink.vue";
|
||||
import { default as default12 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPSocialLinks.vue";
|
||||
import { default as default13 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPSponsors.vue";
|
||||
import { default as default14 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPTeamPage.vue";
|
||||
import { default as default15 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageTitle.vue";
|
||||
import { default as default16 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageSection.vue";
|
||||
import { default as default17 } from "D:/ProjectsAfter240630/Java/Frameworks/MyBot/docs/node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/components/VPTeamMembers.vue";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/support/utils.js
|
||||
import { withBase } from "vitepress";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/composables/data.js
|
||||
import { useData as useData$ } from "vitepress";
|
||||
var useData = useData$;
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/support/utils.js
|
||||
function ensureStartingSlash(path) {
|
||||
return /^\//.test(path) ? path : `/${path}`;
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/support/sidebar.js
|
||||
function getSidebar(_sidebar, path) {
|
||||
if (Array.isArray(_sidebar))
|
||||
return addBase(_sidebar);
|
||||
if (_sidebar == null)
|
||||
return [];
|
||||
path = ensureStartingSlash(path);
|
||||
const dir = Object.keys(_sidebar).sort((a, b) => {
|
||||
return b.split("/").length - a.split("/").length;
|
||||
}).find((dir2) => {
|
||||
return path.startsWith(ensureStartingSlash(dir2));
|
||||
});
|
||||
const sidebar = dir ? _sidebar[dir] : [];
|
||||
return Array.isArray(sidebar) ? addBase(sidebar) : addBase(sidebar.items, sidebar.base);
|
||||
}
|
||||
function getSidebarGroups(sidebar) {
|
||||
const groups = [];
|
||||
let lastGroupIndex = 0;
|
||||
for (const index in sidebar) {
|
||||
const item = sidebar[index];
|
||||
if (item.items) {
|
||||
lastGroupIndex = groups.push(item);
|
||||
continue;
|
||||
}
|
||||
if (!groups[lastGroupIndex]) {
|
||||
groups.push({ items: [] });
|
||||
}
|
||||
groups[lastGroupIndex].items.push(item);
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
function addBase(items, _base) {
|
||||
return [...items].map((_item) => {
|
||||
const item = { ..._item };
|
||||
const base = item.base || _base;
|
||||
if (base && item.link)
|
||||
item.link = base + item.link;
|
||||
if (item.items)
|
||||
item.items = addBase(item.items, base);
|
||||
return item;
|
||||
});
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/composables/sidebar.js
|
||||
function useSidebar() {
|
||||
const { frontmatter, page, theme: theme2 } = useData();
|
||||
const is960 = useMediaQuery("(min-width: 960px)");
|
||||
const isOpen = ref(false);
|
||||
const _sidebar = computed(() => {
|
||||
const sidebarConfig = theme2.value.sidebar;
|
||||
const relativePath = page.value.relativePath;
|
||||
return sidebarConfig ? getSidebar(sidebarConfig, relativePath) : [];
|
||||
});
|
||||
const sidebar = ref(_sidebar.value);
|
||||
watch(_sidebar, (next, prev) => {
|
||||
if (JSON.stringify(next) !== JSON.stringify(prev))
|
||||
sidebar.value = _sidebar.value;
|
||||
});
|
||||
const hasSidebar = computed(() => {
|
||||
return frontmatter.value.sidebar !== false && sidebar.value.length > 0 && frontmatter.value.layout !== "home";
|
||||
});
|
||||
const leftAside = computed(() => {
|
||||
if (hasAside)
|
||||
return frontmatter.value.aside == null ? theme2.value.aside === "left" : frontmatter.value.aside === "left";
|
||||
return false;
|
||||
});
|
||||
const hasAside = computed(() => {
|
||||
if (frontmatter.value.layout === "home")
|
||||
return false;
|
||||
if (frontmatter.value.aside != null)
|
||||
return !!frontmatter.value.aside;
|
||||
return theme2.value.aside !== false;
|
||||
});
|
||||
const isSidebarEnabled = computed(() => hasSidebar.value && is960.value);
|
||||
const sidebarGroups = computed(() => {
|
||||
return hasSidebar.value ? getSidebarGroups(sidebar.value) : [];
|
||||
});
|
||||
function open() {
|
||||
isOpen.value = true;
|
||||
}
|
||||
function close() {
|
||||
isOpen.value = false;
|
||||
}
|
||||
function toggle() {
|
||||
isOpen.value ? close() : open();
|
||||
}
|
||||
return {
|
||||
isOpen,
|
||||
sidebar,
|
||||
sidebarGroups,
|
||||
hasSidebar,
|
||||
hasAside,
|
||||
leftAside,
|
||||
isSidebarEnabled,
|
||||
open,
|
||||
close,
|
||||
toggle
|
||||
};
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/composables/local-nav.js
|
||||
import { onContentUpdated } from "vitepress";
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/composables/outline.js
|
||||
import { getScrollOffset } from "vitepress";
|
||||
var resolvedHeaders = [];
|
||||
function getHeaders(range) {
|
||||
const headers = [
|
||||
...document.querySelectorAll(".VPDoc :where(h1,h2,h3,h4,h5,h6)")
|
||||
].filter((el) => el.id && el.hasChildNodes()).map((el) => {
|
||||
const level = Number(el.tagName[1]);
|
||||
return {
|
||||
element: el,
|
||||
title: serializeHeader(el),
|
||||
link: "#" + el.id,
|
||||
level
|
||||
};
|
||||
});
|
||||
return resolveHeaders(headers, range);
|
||||
}
|
||||
function serializeHeader(h) {
|
||||
let ret = "";
|
||||
for (const node of h.childNodes) {
|
||||
if (node.nodeType === 1) {
|
||||
if (node.classList.contains("VPBadge") || node.classList.contains("header-anchor") || node.classList.contains("ignore-header")) {
|
||||
continue;
|
||||
}
|
||||
ret += node.textContent;
|
||||
} else if (node.nodeType === 3) {
|
||||
ret += node.textContent;
|
||||
}
|
||||
}
|
||||
return ret.trim();
|
||||
}
|
||||
function resolveHeaders(headers, range) {
|
||||
if (range === false) {
|
||||
return [];
|
||||
}
|
||||
const levelsRange = (typeof range === "object" && !Array.isArray(range) ? range.level : range) || 2;
|
||||
const [high, low] = typeof levelsRange === "number" ? [levelsRange, levelsRange] : levelsRange === "deep" ? [2, 6] : levelsRange;
|
||||
return buildTree(headers, high, low);
|
||||
}
|
||||
function buildTree(data, min, max) {
|
||||
resolvedHeaders.length = 0;
|
||||
const result = [];
|
||||
const stack = [];
|
||||
data.forEach((item) => {
|
||||
const node = { ...item, children: [] };
|
||||
let parent = stack[stack.length - 1];
|
||||
while (parent && parent.level >= node.level) {
|
||||
stack.pop();
|
||||
parent = stack[stack.length - 1];
|
||||
}
|
||||
if (node.element.classList.contains("ignore-header") || parent && "shouldIgnore" in parent) {
|
||||
stack.push({ level: node.level, shouldIgnore: true });
|
||||
return;
|
||||
}
|
||||
if (node.level > max || node.level < min)
|
||||
return;
|
||||
resolvedHeaders.push({ element: node.element, link: node.link });
|
||||
if (parent)
|
||||
parent.children.push(node);
|
||||
else
|
||||
result.push(node);
|
||||
stack.push(node);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/composables/local-nav.js
|
||||
function useLocalNav() {
|
||||
const { theme: theme2, frontmatter } = useData();
|
||||
const headers = shallowRef([]);
|
||||
const hasLocalNav = computed(() => {
|
||||
return headers.value.length > 0;
|
||||
});
|
||||
onContentUpdated(() => {
|
||||
headers.value = getHeaders(frontmatter.value.outline ?? theme2.value.outline);
|
||||
});
|
||||
return {
|
||||
headers,
|
||||
hasLocalNav
|
||||
};
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/without-fonts.js
|
||||
var theme = {
|
||||
Layout,
|
||||
enhanceApp: ({ app }) => {
|
||||
app.component("Badge", VPBadge);
|
||||
}
|
||||
};
|
||||
var without_fonts_default = theme;
|
||||
export {
|
||||
default2 as VPBadge,
|
||||
default4 as VPButton,
|
||||
default10 as VPDocAsideSponsors,
|
||||
default5 as VPHomeContent,
|
||||
default7 as VPHomeFeatures,
|
||||
default6 as VPHomeHero,
|
||||
default8 as VPHomeSponsors,
|
||||
default3 as VPImage,
|
||||
default9 as VPLink,
|
||||
default11 as VPSocialLink,
|
||||
default12 as VPSocialLinks,
|
||||
default13 as VPSponsors,
|
||||
default17 as VPTeamMembers,
|
||||
default14 as VPTeamPage,
|
||||
default16 as VPTeamPageSection,
|
||||
default15 as VPTeamPageTitle,
|
||||
without_fonts_default as default,
|
||||
useLocalNav,
|
||||
useSidebar
|
||||
};
|
||||
//# sourceMappingURL=@theme_index.js.map
|
7
docs/.vitepress/cache/deps/@theme_index.js.map
vendored
Normal file
7
docs/.vitepress/cache/deps/@theme_index.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
40
docs/.vitepress/cache/deps/_metadata.json
vendored
Normal file
40
docs/.vitepress/cache/deps/_metadata.json
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"hash": "30a63267",
|
||||
"configHash": "2c9c0d33",
|
||||
"lockfileHash": "de33837a",
|
||||
"browserHash": "7755b019",
|
||||
"optimized": {
|
||||
"vue": {
|
||||
"src": "../../../node_modules/.pnpm/vue@3.5.11/node_modules/vue/dist/vue.runtime.esm-bundler.js",
|
||||
"file": "vue.js",
|
||||
"fileHash": "f71e9ed4",
|
||||
"needsInterop": false
|
||||
},
|
||||
"vitepress > @vue/devtools-api": {
|
||||
"src": "../../../node_modules/.pnpm/@vue+devtools-api@7.4.6/node_modules/@vue/devtools-api/dist/index.js",
|
||||
"file": "vitepress___@vue_devtools-api.js",
|
||||
"fileHash": "e96d8db2",
|
||||
"needsInterop": false
|
||||
},
|
||||
"vitepress > @vueuse/core": {
|
||||
"src": "../../../node_modules/.pnpm/@vueuse+core@11.1.0_vue@3.5.11/node_modules/@vueuse/core/index.mjs",
|
||||
"file": "vitepress___@vueuse_core.js",
|
||||
"fileHash": "692684da",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@theme/index": {
|
||||
"src": "../../../node_modules/.pnpm/vitepress@1.4.0_@algolia+client-search@4.24.0_postcss@8.4.47_search-insights@2.17.2/node_modules/vitepress/dist/client/theme-default/index.js",
|
||||
"file": "@theme_index.js",
|
||||
"fileHash": "9599b31e",
|
||||
"needsInterop": false
|
||||
}
|
||||
},
|
||||
"chunks": {
|
||||
"chunk-WVCZVGU2": {
|
||||
"file": "chunk-WVCZVGU2.js"
|
||||
},
|
||||
"chunk-XIDTNVOX": {
|
||||
"file": "chunk-XIDTNVOX.js"
|
||||
}
|
||||
}
|
||||
}
|
9311
docs/.vitepress/cache/deps/chunk-WVCZVGU2.js
vendored
Normal file
9311
docs/.vitepress/cache/deps/chunk-WVCZVGU2.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
docs/.vitepress/cache/deps/chunk-WVCZVGU2.js.map
vendored
Normal file
7
docs/.vitepress/cache/deps/chunk-WVCZVGU2.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
12526
docs/.vitepress/cache/deps/chunk-XIDTNVOX.js
vendored
Normal file
12526
docs/.vitepress/cache/deps/chunk-XIDTNVOX.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
docs/.vitepress/cache/deps/chunk-XIDTNVOX.js.map
vendored
Normal file
7
docs/.vitepress/cache/deps/chunk-XIDTNVOX.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3
docs/.vitepress/cache/deps/package.json
vendored
Normal file
3
docs/.vitepress/cache/deps/package.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
4428
docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js
vendored
Normal file
4428
docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map
vendored
Normal file
7
docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
567
docs/.vitepress/cache/deps/vitepress___@vueuse_core.js
vendored
Normal file
567
docs/.vitepress/cache/deps/vitepress___@vueuse_core.js
vendored
Normal file
@ -0,0 +1,567 @@
|
||||
import {
|
||||
DefaultMagicKeysAliasMap,
|
||||
StorageSerializers,
|
||||
TransitionPresets,
|
||||
assert,
|
||||
breakpointsAntDesign,
|
||||
breakpointsBootstrapV5,
|
||||
breakpointsMasterCss,
|
||||
breakpointsPrimeFlex,
|
||||
breakpointsQuasar,
|
||||
breakpointsSematic,
|
||||
breakpointsTailwind,
|
||||
breakpointsVuetify,
|
||||
breakpointsVuetifyV2,
|
||||
breakpointsVuetifyV3,
|
||||
bypassFilter,
|
||||
camelize,
|
||||
clamp,
|
||||
cloneFnJSON,
|
||||
computedAsync,
|
||||
computedEager,
|
||||
computedInject,
|
||||
computedWithControl,
|
||||
containsProp,
|
||||
controlledRef,
|
||||
createEventHook,
|
||||
createFetch,
|
||||
createFilterWrapper,
|
||||
createGlobalState,
|
||||
createInjectionState,
|
||||
createReusableTemplate,
|
||||
createSharedComposable,
|
||||
createSingletonPromise,
|
||||
createTemplatePromise,
|
||||
createUnrefFn,
|
||||
customStorageEventName,
|
||||
debounceFilter,
|
||||
defaultDocument,
|
||||
defaultLocation,
|
||||
defaultNavigator,
|
||||
defaultWindow,
|
||||
directiveHooks,
|
||||
executeTransition,
|
||||
extendRef,
|
||||
formatDate,
|
||||
formatTimeAgo,
|
||||
get,
|
||||
getLifeCycleTarget,
|
||||
getSSRHandler,
|
||||
hasOwn,
|
||||
hyphenate,
|
||||
identity,
|
||||
increaseWithUnit,
|
||||
injectLocal,
|
||||
invoke,
|
||||
isClient,
|
||||
isDef,
|
||||
isDefined,
|
||||
isIOS,
|
||||
isObject,
|
||||
isWorker,
|
||||
makeDestructurable,
|
||||
mapGamepadToXbox360Controller,
|
||||
noop,
|
||||
normalizeDate,
|
||||
notNullish,
|
||||
now,
|
||||
objectEntries,
|
||||
objectOmit,
|
||||
objectPick,
|
||||
onClickOutside,
|
||||
onKeyDown,
|
||||
onKeyPressed,
|
||||
onKeyStroke,
|
||||
onKeyUp,
|
||||
onLongPress,
|
||||
onStartTyping,
|
||||
pausableFilter,
|
||||
promiseTimeout,
|
||||
provideLocal,
|
||||
rand,
|
||||
reactify,
|
||||
reactifyObject,
|
||||
reactiveComputed,
|
||||
reactiveOmit,
|
||||
reactivePick,
|
||||
refAutoReset,
|
||||
refDebounced,
|
||||
refDefault,
|
||||
refThrottled,
|
||||
refWithControl,
|
||||
resolveRef,
|
||||
resolveUnref,
|
||||
set,
|
||||
setSSRHandler,
|
||||
syncRef,
|
||||
syncRefs,
|
||||
templateRef,
|
||||
throttleFilter,
|
||||
timestamp,
|
||||
toReactive,
|
||||
toRef,
|
||||
toRefs,
|
||||
toValue,
|
||||
tryOnBeforeMount,
|
||||
tryOnBeforeUnmount,
|
||||
tryOnMounted,
|
||||
tryOnScopeDispose,
|
||||
tryOnUnmounted,
|
||||
unrefElement,
|
||||
until,
|
||||
useActiveElement,
|
||||
useAnimate,
|
||||
useArrayDifference,
|
||||
useArrayEvery,
|
||||
useArrayFilter,
|
||||
useArrayFind,
|
||||
useArrayFindIndex,
|
||||
useArrayFindLast,
|
||||
useArrayIncludes,
|
||||
useArrayJoin,
|
||||
useArrayMap,
|
||||
useArrayReduce,
|
||||
useArraySome,
|
||||
useArrayUnique,
|
||||
useAsyncQueue,
|
||||
useAsyncState,
|
||||
useBase64,
|
||||
useBattery,
|
||||
useBluetooth,
|
||||
useBreakpoints,
|
||||
useBroadcastChannel,
|
||||
useBrowserLocation,
|
||||
useCached,
|
||||
useClipboard,
|
||||
useClipboardItems,
|
||||
useCloned,
|
||||
useColorMode,
|
||||
useConfirmDialog,
|
||||
useCounter,
|
||||
useCssVar,
|
||||
useCurrentElement,
|
||||
useCycleList,
|
||||
useDark,
|
||||
useDateFormat,
|
||||
useDebounceFn,
|
||||
useDebouncedRefHistory,
|
||||
useDeviceMotion,
|
||||
useDeviceOrientation,
|
||||
useDevicePixelRatio,
|
||||
useDevicesList,
|
||||
useDisplayMedia,
|
||||
useDocumentVisibility,
|
||||
useDraggable,
|
||||
useDropZone,
|
||||
useElementBounding,
|
||||
useElementByPoint,
|
||||
useElementHover,
|
||||
useElementSize,
|
||||
useElementVisibility,
|
||||
useEventBus,
|
||||
useEventListener,
|
||||
useEventSource,
|
||||
useEyeDropper,
|
||||
useFavicon,
|
||||
useFetch,
|
||||
useFileDialog,
|
||||
useFileSystemAccess,
|
||||
useFocus,
|
||||
useFocusWithin,
|
||||
useFps,
|
||||
useFullscreen,
|
||||
useGamepad,
|
||||
useGeolocation,
|
||||
useIdle,
|
||||
useImage,
|
||||
useInfiniteScroll,
|
||||
useIntersectionObserver,
|
||||
useInterval,
|
||||
useIntervalFn,
|
||||
useKeyModifier,
|
||||
useLastChanged,
|
||||
useLocalStorage,
|
||||
useMagicKeys,
|
||||
useManualRefHistory,
|
||||
useMediaControls,
|
||||
useMediaQuery,
|
||||
useMemoize,
|
||||
useMemory,
|
||||
useMounted,
|
||||
useMouse,
|
||||
useMouseInElement,
|
||||
useMousePressed,
|
||||
useMutationObserver,
|
||||
useNavigatorLanguage,
|
||||
useNetwork,
|
||||
useNow,
|
||||
useObjectUrl,
|
||||
useOffsetPagination,
|
||||
useOnline,
|
||||
usePageLeave,
|
||||
useParallax,
|
||||
useParentElement,
|
||||
usePerformanceObserver,
|
||||
usePermission,
|
||||
usePointer,
|
||||
usePointerLock,
|
||||
usePointerSwipe,
|
||||
usePreferredColorScheme,
|
||||
usePreferredContrast,
|
||||
usePreferredDark,
|
||||
usePreferredLanguages,
|
||||
usePreferredReducedMotion,
|
||||
usePrevious,
|
||||
useRafFn,
|
||||
useRefHistory,
|
||||
useResizeObserver,
|
||||
useScreenOrientation,
|
||||
useScreenSafeArea,
|
||||
useScriptTag,
|
||||
useScroll,
|
||||
useScrollLock,
|
||||
useSessionStorage,
|
||||
useShare,
|
||||
useSorted,
|
||||
useSpeechRecognition,
|
||||
useSpeechSynthesis,
|
||||
useStepper,
|
||||
useStorage,
|
||||
useStorageAsync,
|
||||
useStyleTag,
|
||||
useSupported,
|
||||
useSwipe,
|
||||
useTemplateRefsList,
|
||||
useTextDirection,
|
||||
useTextSelection,
|
||||
useTextareaAutosize,
|
||||
useThrottleFn,
|
||||
useThrottledRefHistory,
|
||||
useTimeAgo,
|
||||
useTimeout,
|
||||
useTimeoutFn,
|
||||
useTimeoutPoll,
|
||||
useTimestamp,
|
||||
useTitle,
|
||||
useToNumber,
|
||||
useToString,
|
||||
useToggle,
|
||||
useTransition,
|
||||
useUrlSearchParams,
|
||||
useUserMedia,
|
||||
useVModel,
|
||||
useVModels,
|
||||
useVibrate,
|
||||
useVirtualList,
|
||||
useWakeLock,
|
||||
useWebNotification,
|
||||
useWebSocket,
|
||||
useWebWorker,
|
||||
useWebWorkerFn,
|
||||
useWindowFocus,
|
||||
useWindowScroll,
|
||||
useWindowSize,
|
||||
watchArray,
|
||||
watchAtMost,
|
||||
watchDebounced,
|
||||
watchDeep,
|
||||
watchIgnorable,
|
||||
watchImmediate,
|
||||
watchOnce,
|
||||
watchPausable,
|
||||
watchThrottled,
|
||||
watchTriggerable,
|
||||
watchWithFilter,
|
||||
whenever
|
||||
} from "./chunk-WVCZVGU2.js";
|
||||
import "./chunk-XIDTNVOX.js";
|
||||
export {
|
||||
DefaultMagicKeysAliasMap,
|
||||
StorageSerializers,
|
||||
TransitionPresets,
|
||||
assert,
|
||||
computedAsync as asyncComputed,
|
||||
refAutoReset as autoResetRef,
|
||||
breakpointsAntDesign,
|
||||
breakpointsBootstrapV5,
|
||||
breakpointsMasterCss,
|
||||
breakpointsPrimeFlex,
|
||||
breakpointsQuasar,
|
||||
breakpointsSematic,
|
||||
breakpointsTailwind,
|
||||
breakpointsVuetify,
|
||||
breakpointsVuetifyV2,
|
||||
breakpointsVuetifyV3,
|
||||
bypassFilter,
|
||||
camelize,
|
||||
clamp,
|
||||
cloneFnJSON,
|
||||
computedAsync,
|
||||
computedEager,
|
||||
computedInject,
|
||||
computedWithControl,
|
||||
containsProp,
|
||||
computedWithControl as controlledComputed,
|
||||
controlledRef,
|
||||
createEventHook,
|
||||
createFetch,
|
||||
createFilterWrapper,
|
||||
createGlobalState,
|
||||
createInjectionState,
|
||||
reactify as createReactiveFn,
|
||||
createReusableTemplate,
|
||||
createSharedComposable,
|
||||
createSingletonPromise,
|
||||
createTemplatePromise,
|
||||
createUnrefFn,
|
||||
customStorageEventName,
|
||||
debounceFilter,
|
||||
refDebounced as debouncedRef,
|
||||
watchDebounced as debouncedWatch,
|
||||
defaultDocument,
|
||||
defaultLocation,
|
||||
defaultNavigator,
|
||||
defaultWindow,
|
||||
directiveHooks,
|
||||
computedEager as eagerComputed,
|
||||
executeTransition,
|
||||
extendRef,
|
||||
formatDate,
|
||||
formatTimeAgo,
|
||||
get,
|
||||
getLifeCycleTarget,
|
||||
getSSRHandler,
|
||||
hasOwn,
|
||||
hyphenate,
|
||||
identity,
|
||||
watchIgnorable as ignorableWatch,
|
||||
increaseWithUnit,
|
||||
injectLocal,
|
||||
invoke,
|
||||
isClient,
|
||||
isDef,
|
||||
isDefined,
|
||||
isIOS,
|
||||
isObject,
|
||||
isWorker,
|
||||
makeDestructurable,
|
||||
mapGamepadToXbox360Controller,
|
||||
noop,
|
||||
normalizeDate,
|
||||
notNullish,
|
||||
now,
|
||||
objectEntries,
|
||||
objectOmit,
|
||||
objectPick,
|
||||
onClickOutside,
|
||||
onKeyDown,
|
||||
onKeyPressed,
|
||||
onKeyStroke,
|
||||
onKeyUp,
|
||||
onLongPress,
|
||||
onStartTyping,
|
||||
pausableFilter,
|
||||
watchPausable as pausableWatch,
|
||||
promiseTimeout,
|
||||
provideLocal,
|
||||
rand,
|
||||
reactify,
|
||||
reactifyObject,
|
||||
reactiveComputed,
|
||||
reactiveOmit,
|
||||
reactivePick,
|
||||
refAutoReset,
|
||||
refDebounced,
|
||||
refDefault,
|
||||
refThrottled,
|
||||
refWithControl,
|
||||
resolveRef,
|
||||
resolveUnref,
|
||||
set,
|
||||
setSSRHandler,
|
||||
syncRef,
|
||||
syncRefs,
|
||||
templateRef,
|
||||
throttleFilter,
|
||||
refThrottled as throttledRef,
|
||||
watchThrottled as throttledWatch,
|
||||
timestamp,
|
||||
toReactive,
|
||||
toRef,
|
||||
toRefs,
|
||||
toValue,
|
||||
tryOnBeforeMount,
|
||||
tryOnBeforeUnmount,
|
||||
tryOnMounted,
|
||||
tryOnScopeDispose,
|
||||
tryOnUnmounted,
|
||||
unrefElement,
|
||||
until,
|
||||
useActiveElement,
|
||||
useAnimate,
|
||||
useArrayDifference,
|
||||
useArrayEvery,
|
||||
useArrayFilter,
|
||||
useArrayFind,
|
||||
useArrayFindIndex,
|
||||
useArrayFindLast,
|
||||
useArrayIncludes,
|
||||
useArrayJoin,
|
||||
useArrayMap,
|
||||
useArrayReduce,
|
||||
useArraySome,
|
||||
useArrayUnique,
|
||||
useAsyncQueue,
|
||||
useAsyncState,
|
||||
useBase64,
|
||||
useBattery,
|
||||
useBluetooth,
|
||||
useBreakpoints,
|
||||
useBroadcastChannel,
|
||||
useBrowserLocation,
|
||||
useCached,
|
||||
useClipboard,
|
||||
useClipboardItems,
|
||||
useCloned,
|
||||
useColorMode,
|
||||
useConfirmDialog,
|
||||
useCounter,
|
||||
useCssVar,
|
||||
useCurrentElement,
|
||||
useCycleList,
|
||||
useDark,
|
||||
useDateFormat,
|
||||
refDebounced as useDebounce,
|
||||
useDebounceFn,
|
||||
useDebouncedRefHistory,
|
||||
useDeviceMotion,
|
||||
useDeviceOrientation,
|
||||
useDevicePixelRatio,
|
||||
useDevicesList,
|
||||
useDisplayMedia,
|
||||
useDocumentVisibility,
|
||||
useDraggable,
|
||||
useDropZone,
|
||||
useElementBounding,
|
||||
useElementByPoint,
|
||||
useElementHover,
|
||||
useElementSize,
|
||||
useElementVisibility,
|
||||
useEventBus,
|
||||
useEventListener,
|
||||
useEventSource,
|
||||
useEyeDropper,
|
||||
useFavicon,
|
||||
useFetch,
|
||||
useFileDialog,
|
||||
useFileSystemAccess,
|
||||
useFocus,
|
||||
useFocusWithin,
|
||||
useFps,
|
||||
useFullscreen,
|
||||
useGamepad,
|
||||
useGeolocation,
|
||||
useIdle,
|
||||
useImage,
|
||||
useInfiniteScroll,
|
||||
useIntersectionObserver,
|
||||
useInterval,
|
||||
useIntervalFn,
|
||||
useKeyModifier,
|
||||
useLastChanged,
|
||||
useLocalStorage,
|
||||
useMagicKeys,
|
||||
useManualRefHistory,
|
||||
useMediaControls,
|
||||
useMediaQuery,
|
||||
useMemoize,
|
||||
useMemory,
|
||||
useMounted,
|
||||
useMouse,
|
||||
useMouseInElement,
|
||||
useMousePressed,
|
||||
useMutationObserver,
|
||||
useNavigatorLanguage,
|
||||
useNetwork,
|
||||
useNow,
|
||||
useObjectUrl,
|
||||
useOffsetPagination,
|
||||
useOnline,
|
||||
usePageLeave,
|
||||
useParallax,
|
||||
useParentElement,
|
||||
usePerformanceObserver,
|
||||
usePermission,
|
||||
usePointer,
|
||||
usePointerLock,
|
||||
usePointerSwipe,
|
||||
usePreferredColorScheme,
|
||||
usePreferredContrast,
|
||||
usePreferredDark,
|
||||
usePreferredLanguages,
|
||||
usePreferredReducedMotion,
|
||||
usePrevious,
|
||||
useRafFn,
|
||||
useRefHistory,
|
||||
useResizeObserver,
|
||||
useScreenOrientation,
|
||||
useScreenSafeArea,
|
||||
useScriptTag,
|
||||
useScroll,
|
||||
useScrollLock,
|
||||
useSessionStorage,
|
||||
useShare,
|
||||
useSorted,
|
||||
useSpeechRecognition,
|
||||
useSpeechSynthesis,
|
||||
useStepper,
|
||||
useStorage,
|
||||
useStorageAsync,
|
||||
useStyleTag,
|
||||
useSupported,
|
||||
useSwipe,
|
||||
useTemplateRefsList,
|
||||
useTextDirection,
|
||||
useTextSelection,
|
||||
useTextareaAutosize,
|
||||
refThrottled as useThrottle,
|
||||
useThrottleFn,
|
||||
useThrottledRefHistory,
|
||||
useTimeAgo,
|
||||
useTimeout,
|
||||
useTimeoutFn,
|
||||
useTimeoutPoll,
|
||||
useTimestamp,
|
||||
useTitle,
|
||||
useToNumber,
|
||||
useToString,
|
||||
useToggle,
|
||||
useTransition,
|
||||
useUrlSearchParams,
|
||||
useUserMedia,
|
||||
useVModel,
|
||||
useVModels,
|
||||
useVibrate,
|
||||
useVirtualList,
|
||||
useWakeLock,
|
||||
useWebNotification,
|
||||
useWebSocket,
|
||||
useWebWorker,
|
||||
useWebWorkerFn,
|
||||
useWindowFocus,
|
||||
useWindowScroll,
|
||||
useWindowSize,
|
||||
watchArray,
|
||||
watchAtMost,
|
||||
watchDebounced,
|
||||
watchDeep,
|
||||
watchIgnorable,
|
||||
watchImmediate,
|
||||
watchOnce,
|
||||
watchPausable,
|
||||
watchThrottled,
|
||||
watchTriggerable,
|
||||
watchWithFilter,
|
||||
whenever
|
||||
};
|
||||
//# sourceMappingURL=vitepress___@vueuse_core.js.map
|
7
docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map
vendored
Normal file
7
docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
343
docs/.vitepress/cache/deps/vue.js
vendored
Normal file
343
docs/.vitepress/cache/deps/vue.js
vendored
Normal file
@ -0,0 +1,343 @@
|
||||
import {
|
||||
BaseTransition,
|
||||
BaseTransitionPropsValidators,
|
||||
Comment,
|
||||
DeprecationTypes,
|
||||
EffectScope,
|
||||
ErrorCodes,
|
||||
ErrorTypeStrings,
|
||||
Fragment,
|
||||
KeepAlive,
|
||||
ReactiveEffect,
|
||||
Static,
|
||||
Suspense,
|
||||
Teleport,
|
||||
Text,
|
||||
TrackOpTypes,
|
||||
Transition,
|
||||
TransitionGroup,
|
||||
TriggerOpTypes,
|
||||
VueElement,
|
||||
assertNumber,
|
||||
callWithAsyncErrorHandling,
|
||||
callWithErrorHandling,
|
||||
camelize,
|
||||
capitalize,
|
||||
cloneVNode,
|
||||
compatUtils,
|
||||
compile,
|
||||
computed,
|
||||
createApp,
|
||||
createBaseVNode,
|
||||
createBlock,
|
||||
createCommentVNode,
|
||||
createElementBlock,
|
||||
createHydrationRenderer,
|
||||
createPropsRestProxy,
|
||||
createRenderer,
|
||||
createSSRApp,
|
||||
createSlots,
|
||||
createStaticVNode,
|
||||
createTextVNode,
|
||||
createVNode,
|
||||
customRef,
|
||||
defineAsyncComponent,
|
||||
defineComponent,
|
||||
defineCustomElement,
|
||||
defineEmits,
|
||||
defineExpose,
|
||||
defineModel,
|
||||
defineOptions,
|
||||
defineProps,
|
||||
defineSSRCustomElement,
|
||||
defineSlots,
|
||||
devtools,
|
||||
effect,
|
||||
effectScope,
|
||||
getCurrentInstance,
|
||||
getCurrentScope,
|
||||
getCurrentWatcher,
|
||||
getTransitionRawChildren,
|
||||
guardReactiveProps,
|
||||
h,
|
||||
handleError,
|
||||
hasInjectionContext,
|
||||
hydrate,
|
||||
hydrateOnIdle,
|
||||
hydrateOnInteraction,
|
||||
hydrateOnMediaQuery,
|
||||
hydrateOnVisible,
|
||||
initCustomFormatter,
|
||||
initDirectivesForSSR,
|
||||
inject,
|
||||
isMemoSame,
|
||||
isProxy,
|
||||
isReactive,
|
||||
isReadonly,
|
||||
isRef,
|
||||
isRuntimeOnly,
|
||||
isShallow,
|
||||
isVNode,
|
||||
markRaw,
|
||||
mergeDefaults,
|
||||
mergeModels,
|
||||
mergeProps,
|
||||
nextTick,
|
||||
normalizeClass,
|
||||
normalizeProps,
|
||||
normalizeStyle,
|
||||
onActivated,
|
||||
onBeforeMount,
|
||||
onBeforeUnmount,
|
||||
onBeforeUpdate,
|
||||
onDeactivated,
|
||||
onErrorCaptured,
|
||||
onMounted,
|
||||
onRenderTracked,
|
||||
onRenderTriggered,
|
||||
onScopeDispose,
|
||||
onServerPrefetch,
|
||||
onUnmounted,
|
||||
onUpdated,
|
||||
onWatcherCleanup,
|
||||
openBlock,
|
||||
popScopeId,
|
||||
provide,
|
||||
proxyRefs,
|
||||
pushScopeId,
|
||||
queuePostFlushCb,
|
||||
reactive,
|
||||
readonly,
|
||||
ref,
|
||||
registerRuntimeCompiler,
|
||||
render,
|
||||
renderList,
|
||||
renderSlot,
|
||||
resolveComponent,
|
||||
resolveDirective,
|
||||
resolveDynamicComponent,
|
||||
resolveFilter,
|
||||
resolveTransitionHooks,
|
||||
setBlockTracking,
|
||||
setDevtoolsHook,
|
||||
setTransitionHooks,
|
||||
shallowReactive,
|
||||
shallowReadonly,
|
||||
shallowRef,
|
||||
ssrContextKey,
|
||||
ssrUtils,
|
||||
stop,
|
||||
toDisplayString,
|
||||
toHandlerKey,
|
||||
toHandlers,
|
||||
toRaw,
|
||||
toRef,
|
||||
toRefs,
|
||||
toValue,
|
||||
transformVNodeArgs,
|
||||
triggerRef,
|
||||
unref,
|
||||
useAttrs,
|
||||
useCssModule,
|
||||
useCssVars,
|
||||
useHost,
|
||||
useId,
|
||||
useModel,
|
||||
useSSRContext,
|
||||
useShadowRoot,
|
||||
useSlots,
|
||||
useTemplateRef,
|
||||
useTransitionState,
|
||||
vModelCheckbox,
|
||||
vModelDynamic,
|
||||
vModelRadio,
|
||||
vModelSelect,
|
||||
vModelText,
|
||||
vShow,
|
||||
version,
|
||||
warn,
|
||||
watch,
|
||||
watchEffect,
|
||||
watchPostEffect,
|
||||
watchSyncEffect,
|
||||
withAsyncContext,
|
||||
withCtx,
|
||||
withDefaults,
|
||||
withDirectives,
|
||||
withKeys,
|
||||
withMemo,
|
||||
withModifiers,
|
||||
withScopeId
|
||||
} from "./chunk-XIDTNVOX.js";
|
||||
export {
|
||||
BaseTransition,
|
||||
BaseTransitionPropsValidators,
|
||||
Comment,
|
||||
DeprecationTypes,
|
||||
EffectScope,
|
||||
ErrorCodes,
|
||||
ErrorTypeStrings,
|
||||
Fragment,
|
||||
KeepAlive,
|
||||
ReactiveEffect,
|
||||
Static,
|
||||
Suspense,
|
||||
Teleport,
|
||||
Text,
|
||||
TrackOpTypes,
|
||||
Transition,
|
||||
TransitionGroup,
|
||||
TriggerOpTypes,
|
||||
VueElement,
|
||||
assertNumber,
|
||||
callWithAsyncErrorHandling,
|
||||
callWithErrorHandling,
|
||||
camelize,
|
||||
capitalize,
|
||||
cloneVNode,
|
||||
compatUtils,
|
||||
compile,
|
||||
computed,
|
||||
createApp,
|
||||
createBlock,
|
||||
createCommentVNode,
|
||||
createElementBlock,
|
||||
createBaseVNode as createElementVNode,
|
||||
createHydrationRenderer,
|
||||
createPropsRestProxy,
|
||||
createRenderer,
|
||||
createSSRApp,
|
||||
createSlots,
|
||||
createStaticVNode,
|
||||
createTextVNode,
|
||||
createVNode,
|
||||
customRef,
|
||||
defineAsyncComponent,
|
||||
defineComponent,
|
||||
defineCustomElement,
|
||||
defineEmits,
|
||||
defineExpose,
|
||||
defineModel,
|
||||
defineOptions,
|
||||
defineProps,
|
||||
defineSSRCustomElement,
|
||||
defineSlots,
|
||||
devtools,
|
||||
effect,
|
||||
effectScope,
|
||||
getCurrentInstance,
|
||||
getCurrentScope,
|
||||
getCurrentWatcher,
|
||||
getTransitionRawChildren,
|
||||
guardReactiveProps,
|
||||
h,
|
||||
handleError,
|
||||
hasInjectionContext,
|
||||
hydrate,
|
||||
hydrateOnIdle,
|
||||
hydrateOnInteraction,
|
||||
hydrateOnMediaQuery,
|
||||
hydrateOnVisible,
|
||||
initCustomFormatter,
|
||||
initDirectivesForSSR,
|
||||
inject,
|
||||
isMemoSame,
|
||||
isProxy,
|
||||
isReactive,
|
||||
isReadonly,
|
||||
isRef,
|
||||
isRuntimeOnly,
|
||||
isShallow,
|
||||
isVNode,
|
||||
markRaw,
|
||||
mergeDefaults,
|
||||
mergeModels,
|
||||
mergeProps,
|
||||
nextTick,
|
||||
normalizeClass,
|
||||
normalizeProps,
|
||||
normalizeStyle,
|
||||
onActivated,
|
||||
onBeforeMount,
|
||||
onBeforeUnmount,
|
||||
onBeforeUpdate,
|
||||
onDeactivated,
|
||||
onErrorCaptured,
|
||||
onMounted,
|
||||
onRenderTracked,
|
||||
onRenderTriggered,
|
||||
onScopeDispose,
|
||||
onServerPrefetch,
|
||||
onUnmounted,
|
||||
onUpdated,
|
||||
onWatcherCleanup,
|
||||
openBlock,
|
||||
popScopeId,
|
||||
provide,
|
||||
proxyRefs,
|
||||
pushScopeId,
|
||||
queuePostFlushCb,
|
||||
reactive,
|
||||
readonly,
|
||||
ref,
|
||||
registerRuntimeCompiler,
|
||||
render,
|
||||
renderList,
|
||||
renderSlot,
|
||||
resolveComponent,
|
||||
resolveDirective,
|
||||
resolveDynamicComponent,
|
||||
resolveFilter,
|
||||
resolveTransitionHooks,
|
||||
setBlockTracking,
|
||||
setDevtoolsHook,
|
||||
setTransitionHooks,
|
||||
shallowReactive,
|
||||
shallowReadonly,
|
||||
shallowRef,
|
||||
ssrContextKey,
|
||||
ssrUtils,
|
||||
stop,
|
||||
toDisplayString,
|
||||
toHandlerKey,
|
||||
toHandlers,
|
||||
toRaw,
|
||||
toRef,
|
||||
toRefs,
|
||||
toValue,
|
||||
transformVNodeArgs,
|
||||
triggerRef,
|
||||
unref,
|
||||
useAttrs,
|
||||
useCssModule,
|
||||
useCssVars,
|
||||
useHost,
|
||||
useId,
|
||||
useModel,
|
||||
useSSRContext,
|
||||
useShadowRoot,
|
||||
useSlots,
|
||||
useTemplateRef,
|
||||
useTransitionState,
|
||||
vModelCheckbox,
|
||||
vModelDynamic,
|
||||
vModelRadio,
|
||||
vModelSelect,
|
||||
vModelText,
|
||||
vShow,
|
||||
version,
|
||||
warn,
|
||||
watch,
|
||||
watchEffect,
|
||||
watchPostEffect,
|
||||
watchSyncEffect,
|
||||
withAsyncContext,
|
||||
withCtx,
|
||||
withDefaults,
|
||||
withDirectives,
|
||||
withKeys,
|
||||
withMemo,
|
||||
withModifiers,
|
||||
withScopeId
|
||||
};
|
||||
//# sourceMappingURL=vue.js.map
|
7
docs/.vitepress/cache/deps/vue.js.map
vendored
Normal file
7
docs/.vitepress/cache/deps/vue.js.map
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
20
docs/.vitepress/config.mts
Normal file
20
docs/.vitepress/config.mts
Normal file
@ -0,0 +1,20 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
import zh from "./zh";
|
||||
import en from "./en";
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
...zh,
|
||||
locales: {
|
||||
root: {
|
||||
label: '简体中文',
|
||||
lang: 'zh'
|
||||
},
|
||||
en: {
|
||||
label: 'English',
|
||||
lang: 'en',
|
||||
link: '/en/',
|
||||
...en
|
||||
}
|
||||
}
|
||||
})
|
40
docs/.vitepress/en.ts
Normal file
40
docs/.vitepress/en.ts
Normal file
@ -0,0 +1,40 @@
|
||||
import {defineConfig} from "vitepress";
|
||||
|
||||
const en = defineConfig({
|
||||
title: "MyBot",
|
||||
description: "MyBot docs",
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{ text: 'Home', link: '/en/' },
|
||||
{ text: 'Docs', link: '/en/deployment' }
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
{
|
||||
text: "For Administrator",
|
||||
items: [
|
||||
{ text: "Deployment", link: "/en/deployment" },
|
||||
{ text: "Configuration", link: "/en/config" }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'For Developer',
|
||||
items: [
|
||||
{ text: 'Quick Start', link: '/en/quick-start' },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: "API Reference",
|
||||
items: [
|
||||
{ text: "API Overview", link: '/en/api-list' }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: 'https://github.com/Wzp-2008/MyBot/', ariaLabel: "GitHub" },
|
||||
{ icon: 'github', link: 'https://wzpmc.cn:3000/wzp/MyBot', ariaLabel: "Gitea" }
|
||||
],
|
||||
},
|
||||
});
|
||||
export default en;
|
41
docs/.vitepress/zh.ts
Normal file
41
docs/.vitepress/zh.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import {defineConfig} from "vitepress";
|
||||
|
||||
const zh = defineConfig({
|
||||
title: "MyBot",
|
||||
description: "MyBot文档",
|
||||
themeConfig: {
|
||||
// https://vitepress.dev/reference/default-theme-config
|
||||
nav: [
|
||||
{ text: '主页', link: '/' },
|
||||
{ text: '文档', link: '/deployment' }
|
||||
],
|
||||
|
||||
sidebar: [
|
||||
{
|
||||
text: "对管理员",
|
||||
items: [
|
||||
{ text: "部署MyBot", link: '/deployment' },
|
||||
{ text: "配置", link: "/config" }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '对开发者',
|
||||
items: [
|
||||
{ text: '快速开始', link: '/quick-start' },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: "API参考",
|
||||
items: [
|
||||
{ text: "API总览", link: '/api-list' }
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: 'https://github.com/Wzp-2008/MyBot/', ariaLabel: "GitHub" },
|
||||
{ icon: 'github', link: 'https://wzpmc.cn:3000/wzp/MyBot', ariaLabel: "Gitea" }
|
||||
],
|
||||
},
|
||||
});
|
||||
export default zh;
|
49
docs/api-list.md
Normal file
49
docs/api-list.md
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Runtime API Examples
|
||||
|
||||
This page demonstrates usage of some of the runtime APIs provided by VitePress.
|
||||
|
||||
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
|
||||
|
||||
```md
|
||||
<script setup>
|
||||
import { useData } from 'vitepress'
|
||||
|
||||
const { theme, page, frontmatter } = useData()
|
||||
</script>
|
||||
|
||||
## Results
|
||||
|
||||
### Theme Data
|
||||
<pre>{{ theme }}</pre>
|
||||
|
||||
### Page Data
|
||||
<pre>{{ page }}</pre>
|
||||
|
||||
### Page Frontmatter
|
||||
<pre>{{ frontmatter }}</pre>
|
||||
```
|
||||
|
||||
<script setup>
|
||||
import { useData } from 'vitepress'
|
||||
|
||||
const { site, theme, page, frontmatter } = useData()
|
||||
</script>
|
||||
|
||||
## Results
|
||||
|
||||
### Theme Data
|
||||
<pre>{{ theme }}</pre>
|
||||
|
||||
### Page Data
|
||||
<pre>{{ page }}</pre>
|
||||
|
||||
### Page Frontmatter
|
||||
<pre>{{ frontmatter }}</pre>
|
||||
|
||||
## More
|
||||
|
||||
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
|
68
docs/config.md
Normal file
68
docs/config.md
Normal file
@ -0,0 +1,68 @@
|
||||
# 主配置文件 {#main-config}
|
||||
## 服务器验证 `authorization` {#authorization}
|
||||
::: warning 实验性功能
|
||||
|
||||
此功能可能出现Bug(作者的测试环境未找到token配置项),若出现BUG,请通过[Github Issues](https://github.com/Wzp-2008/MyBot/issues)或[Gitea 工单](https://wzpmc.cn:3000/wzp/MyBot/issues)向作者提交反馈
|
||||
|
||||
:::
|
||||
### enable
|
||||
是否启动验证
|
||||
- 类型: `boolean`
|
||||
- 值:`true` `false`
|
||||
- 样例:
|
||||
```yaml
|
||||
enable: false
|
||||
```
|
||||
### token
|
||||
验证所使用的token
|
||||
- 类型: `string`
|
||||
- 不启动验证则留空
|
||||
- 样例:
|
||||
```yaml
|
||||
token: ""
|
||||
```
|
||||
---
|
||||
|
||||
## 指令执行失败提示 `fallback` {#fallback}
|
||||
### command
|
||||
当指令无效时发送的消息
|
||||
- 类型:`string`
|
||||
- 样例:
|
||||
```yaml
|
||||
command: 无效的指令!
|
||||
```
|
||||
### errorUncaught
|
||||
当指令执行错误时发送的消息
|
||||
- 类型:`string`
|
||||
- 样例:
|
||||
```yaml
|
||||
errorUncaught: 指令运行时出现错误!
|
||||
```
|
||||
---
|
||||
## 好友相关配置 `friend` {#friend}
|
||||
### autoAccept
|
||||
是否自动通过好友申请
|
||||
- 类型:`boolean`
|
||||
- 值:`true` `false`
|
||||
- 样例:
|
||||
```yaml
|
||||
autoAccept: true
|
||||
```
|
||||
---
|
||||
## 好友相关配置 `group` {#group}
|
||||
### autoAccept
|
||||
是否自动通过群邀请
|
||||
- 类型:`boolean`
|
||||
- 值:`true` `false`
|
||||
- 样例:
|
||||
```yaml
|
||||
autoAccept: true
|
||||
```
|
||||
---
|
||||
## ws连接地址 `websocket` {#websocket}
|
||||
ws连接地址
|
||||
- 类型:`string`
|
||||
- 样例:
|
||||
```yaml
|
||||
websocket: ws://127.0.0.1:3001
|
||||
```
|
47
docs/deployment.md
Normal file
47
docs/deployment.md
Normal file
@ -0,0 +1,47 @@
|
||||
# 环境要求
|
||||
- Java 11(最低) / 17(推荐)
|
||||
|
||||
MyBot的可执行文件可以在 [Github Release](https://github.com/Wzp-2008/MyBot/releases/latest) 或 [Gitea Release](https://wzpmc.cn:3000/wzp/MyBot/releases/latest) 下载到
|
||||
|
||||
你需要准备一个空文件夹来运行MyBot:
|
||||
::: code-group
|
||||
```bat [windows (cmd)]
|
||||
md mybot
|
||||
cd mybot
|
||||
```
|
||||
```powershell [windows (powershell)]
|
||||
New-Item mybot
|
||||
cd mybot
|
||||
```
|
||||
```bash [linux / macos]
|
||||
mkdir mybot
|
||||
cd mybot
|
||||
```
|
||||
:::
|
||||
|
||||
并将jar文件放置到其中
|
||||
|
||||
接下来通过此命令首次启动MyBot
|
||||
|
||||
```bash
|
||||
/path/to/java -jar MyBot-XXXXXX.jar
|
||||
```
|
||||
::: tip 注意
|
||||
|
||||
将/path/to/java替换为你的java可执行程序路径
|
||||
|
||||
:::
|
||||
|
||||
启动完成后,将会在MyBot文件夹中创建一个config.yml,即主配置文件
|
||||
|
||||
关于配置文件的修改,请参阅文档中的[配置](/config)一栏
|
||||
|
||||
完成配置文件的修改后,再次使用命令
|
||||
|
||||
```bash
|
||||
/path/to/java -jar MyBot-XXXXXX.jar
|
||||
```
|
||||
|
||||
启动MyBot
|
||||
|
||||
至此,Bot已完成启动~
|
49
docs/en/api-list.md
Normal file
49
docs/en/api-list.md
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Runtime API Examples
|
||||
|
||||
This page demonstrates usage of some of the runtime APIs provided by VitePress.
|
||||
|
||||
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
|
||||
|
||||
```md
|
||||
<script setup>
|
||||
import { useData } from 'vitepress'
|
||||
|
||||
const { theme, page, frontmatter } = useData()
|
||||
</script>
|
||||
|
||||
## Results
|
||||
|
||||
### Theme Data
|
||||
<pre>{{ theme }}</pre>
|
||||
|
||||
### Page Data
|
||||
<pre>{{ page }}</pre>
|
||||
|
||||
### Page Frontmatter
|
||||
<pre>{{ frontmatter }}</pre>
|
||||
```
|
||||
|
||||
<script setup>
|
||||
import { useData } from 'vitepress'
|
||||
|
||||
const { site, theme, page, frontmatter } = useData()
|
||||
</script>
|
||||
|
||||
## Results
|
||||
|
||||
### Theme Data
|
||||
<pre>{{ theme }}</pre>
|
||||
|
||||
### Page Data
|
||||
<pre>{{ page }}</pre>
|
||||
|
||||
### Page Frontmatter
|
||||
<pre>{{ frontmatter }}</pre>
|
||||
|
||||
## More
|
||||
|
||||
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
|
68
docs/en/config.md
Normal file
68
docs/en/config.md
Normal file
@ -0,0 +1,68 @@
|
||||
# Main Configuration File {#main-config}
|
||||
## `authorization` {#authorization}
|
||||
::: warning Experimental
|
||||
|
||||
There may be a Bug in this function (the token configuration item is not found in the author's test environment). if there is a BUG, please submit feedback to the author through [Github Issues](https://github.com/Wzp-2008/MyBot/issues) or [Gitea ticket](https://wzpmc.cn:3000/wzp/MyBot/issues)
|
||||
|
||||
:::
|
||||
### enable
|
||||
should use authorization?
|
||||
- type: `boolean`
|
||||
- value:`true` `false`
|
||||
- example:
|
||||
```yaml
|
||||
enable: false
|
||||
```
|
||||
### token
|
||||
The token used on the authorization
|
||||
- type: `string`
|
||||
- can be empty when not using authorization
|
||||
- example:
|
||||
```yaml
|
||||
token: ""
|
||||
```
|
||||
---
|
||||
|
||||
## `fallback` {#fallback}
|
||||
### command
|
||||
when command executing have errors sends message
|
||||
- type:`string`
|
||||
- example:
|
||||
```yaml
|
||||
command: Invalid command!
|
||||
```
|
||||
### errorUncaught
|
||||
Message sent when instruction execution fails
|
||||
- type:`string`
|
||||
- example:
|
||||
```yaml
|
||||
errorUncaught: Error while command is running!
|
||||
```
|
||||
---
|
||||
## `friend` {#friend}
|
||||
### autoAccept
|
||||
Whether to automatically apply through friends
|
||||
- type:`boolean`
|
||||
- values:`true` `false`
|
||||
- example:
|
||||
```yaml
|
||||
autoAccept: true
|
||||
```
|
||||
---
|
||||
## `group` {#group}
|
||||
### autoAccept
|
||||
Automatically through group invitation
|
||||
- type:`boolean`
|
||||
- values:`true` `false`
|
||||
- example:
|
||||
```yaml
|
||||
autoAccept: true
|
||||
```
|
||||
---
|
||||
## `websocket` {#websocket}
|
||||
ws connection address
|
||||
- type:`string`
|
||||
- example:
|
||||
```yaml
|
||||
websocket: ws://127.0.0.1:3001
|
||||
```
|
0
docs/en/deployment.md
Normal file
0
docs/en/deployment.md
Normal file
25
docs/en/index.md
Normal file
25
docs/en/index.md
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
# https://vitepress.dev/reference/default-theme-home-page
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: "MyBot"
|
||||
text: "MyBot docs"
|
||||
tagline: A Java-based OneBot11-compatible robot framework
|
||||
actions:
|
||||
- theme: brand
|
||||
text: Quick Start
|
||||
link: /deployment
|
||||
- theme: alt
|
||||
text: API Reference
|
||||
link: /api-list
|
||||
|
||||
features:
|
||||
- title: Bukkit Like Plugin Form
|
||||
details: Minecraft developers can easily get started
|
||||
- title: API rich
|
||||
details: compatible with all onebot11 apis and events
|
||||
- title: Low occupancy
|
||||
details: The full version only takes up 20M of storage and less than 100M of memory.
|
||||
---
|
||||
|
85
docs/en/quick-start.md
Normal file
85
docs/en/quick-start.md
Normal file
@ -0,0 +1,85 @@
|
||||
# Markdown Extension Examples
|
||||
|
||||
This page demonstrates some of the built-in markdown extensions provided by VitePress.
|
||||
|
||||
## Syntax Highlighting
|
||||
|
||||
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
|
||||
|
||||
**Input**
|
||||
|
||||
````md
|
||||
```js{4}
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
msg: 'Highlighted!'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
````
|
||||
|
||||
**Output**
|
||||
|
||||
```js{4}
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
msg: 'Highlighted!'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Custom Containers
|
||||
|
||||
**Input**
|
||||
|
||||
```md
|
||||
::: info
|
||||
This is an info box.
|
||||
:::
|
||||
|
||||
::: tip
|
||||
This is a tip.
|
||||
:::
|
||||
|
||||
::: warning
|
||||
This is a warning.
|
||||
:::
|
||||
|
||||
::: danger
|
||||
This is a dangerous warning.
|
||||
:::
|
||||
|
||||
::: details
|
||||
This is a details block.
|
||||
:::
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
::: info
|
||||
This is an info box.
|
||||
:::
|
||||
|
||||
::: tip
|
||||
This is a tip.
|
||||
:::
|
||||
|
||||
::: warning
|
||||
This is a warning.
|
||||
:::
|
||||
|
||||
::: danger
|
||||
This is a dangerous warning.
|
||||
:::
|
||||
|
||||
::: details
|
||||
This is a details block.
|
||||
:::
|
||||
|
||||
## More
|
||||
|
||||
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).
|
25
docs/index.md
Normal file
25
docs/index.md
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
# https://vitepress.dev/reference/default-theme-home-page
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: "MyBot"
|
||||
text: "MyBot 开发文档"
|
||||
tagline: 一个基于 Java 的 OneBot11 兼容机器人框架
|
||||
actions:
|
||||
- theme: brand
|
||||
text: 快速开始
|
||||
link: /deployment
|
||||
- theme: alt
|
||||
text: API参考
|
||||
link: /api-list
|
||||
|
||||
features:
|
||||
- title: Bukkit Like插件形式
|
||||
details: MC开发者可轻松上手
|
||||
- title: API丰富
|
||||
details: 兼容所有OneBot11 API\事件
|
||||
- title: 占用低
|
||||
details: 完整版仅仅占用20M存储,100M以下内存
|
||||
---
|
||||
|
18
docs/package.json
Normal file
18
docs/package.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "mybot-docs",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"docs:dev": "vitepress dev",
|
||||
"docs:build": "vitepress build",
|
||||
"docs:preview": "vitepress preview"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"vitepress": "^1.4.0"
|
||||
}
|
||||
}
|
1491
docs/pnpm-lock.yaml
generated
Normal file
1491
docs/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
85
docs/quick-start.md
Normal file
85
docs/quick-start.md
Normal file
@ -0,0 +1,85 @@
|
||||
# 快速开始
|
||||
|
||||
This page demonstrates some of the built-in markdown extensions provided by VitePress.
|
||||
|
||||
## Syntax Highlighting
|
||||
|
||||
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
|
||||
|
||||
**Input**
|
||||
|
||||
````md
|
||||
```js{4}
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
msg: 'Highlighted!'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
````
|
||||
|
||||
**Output**
|
||||
|
||||
```js{4}
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
msg: 'Highlighted!'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Custom Containers
|
||||
|
||||
**Input**
|
||||
|
||||
```md
|
||||
::: info
|
||||
This is an info box.
|
||||
:::
|
||||
|
||||
::: tip
|
||||
This is a tip.
|
||||
:::
|
||||
|
||||
::: warning
|
||||
This is a warning.
|
||||
:::
|
||||
|
||||
::: danger
|
||||
This is a dangerous warning.
|
||||
:::
|
||||
|
||||
::: details
|
||||
This is a details block.
|
||||
:::
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
::: info
|
||||
This is an info box.
|
||||
:::
|
||||
|
||||
::: tip
|
||||
This is a tip.
|
||||
:::
|
||||
|
||||
::: warning
|
||||
This is a warning.
|
||||
:::
|
||||
|
||||
::: danger
|
||||
This is a dangerous warning.
|
||||
:::
|
||||
|
||||
::: details
|
||||
This is a details block.
|
||||
:::
|
||||
|
||||
## More
|
||||
|
||||
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).
|
@ -6,8 +6,6 @@ import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 群成员信息
|
||||
*
|
||||
@ -63,19 +61,19 @@ public class GroupMemberInformation {
|
||||
*/
|
||||
private String area;
|
||||
/**
|
||||
* 加群时间
|
||||
* 加群时间时间戳
|
||||
*
|
||||
* @since 2024/8/24 19:30 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "join_time")
|
||||
private Date joinTime;
|
||||
private Long joinTime;
|
||||
/**
|
||||
* 最后发言时间
|
||||
* 最后发言时间时间戳
|
||||
*
|
||||
* @since 2024/8/24 19:30 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "last_sent_time")
|
||||
private Date lastSentTime;
|
||||
private Long lastSentTime;
|
||||
/**
|
||||
* 成员等级
|
||||
*
|
||||
@ -101,12 +99,12 @@ public class GroupMemberInformation {
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 专属头衔过期时间
|
||||
* 专属头衔过期时间时间戳
|
||||
*
|
||||
* @since 2024/8/24 19:30 v0.0.6-dev
|
||||
*/
|
||||
@JSONField(name = "title_expire_time")
|
||||
private Date titleExpireTime;
|
||||
private Long titleExpireTime;
|
||||
/**
|
||||
* 是否允许修改群名片
|
||||
*
|
||||
|
@ -21,6 +21,7 @@ public interface JsonMessagePart {
|
||||
* @author wzp
|
||||
* @since 2024/7/31 上午2:40 v0.0.1-dev
|
||||
*/
|
||||
@JSONField(serialize = false, deserialize = false)
|
||||
PartType getPartType();
|
||||
|
||||
@JSONField(name = "type")
|
||||
|
@ -140,7 +140,13 @@ public enum PartType {
|
||||
*
|
||||
* @since 2024/8/25 15:20 v1.0.0
|
||||
*/
|
||||
MARKDOWN(MarkdownMessage.class);
|
||||
MARKDOWN(MarkdownMessage.class),
|
||||
/**
|
||||
* 未知消息类型
|
||||
*
|
||||
* @since 2024/11/17 17:23 v1.0.5
|
||||
*/
|
||||
UNKNOWN(UnknownPart.class);
|
||||
public final Class<? extends JsonMessagePart> clazz;
|
||||
|
||||
PartType(Class<? extends JsonMessagePart> clazz) {
|
||||
|
@ -0,0 +1,47 @@
|
||||
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,6 +1,7 @@
|
||||
package cn.wzpmc.plugins;
|
||||
|
||||
import cn.wzpmc.user.IBot;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
@ -115,4 +116,19 @@ public interface BasePlugin {
|
||||
* @since 2024/8/16 13:16 v0.0.5-dev
|
||||
*/
|
||||
void saveDefaultConfig();
|
||||
|
||||
/**
|
||||
* 重载配置文件
|
||||
* @author wzp
|
||||
* @since 2024/10/10 09:36 v1.0.3
|
||||
*/
|
||||
void reloadConfig();
|
||||
|
||||
/**
|
||||
* 获取配置文件内容
|
||||
* @author wzp
|
||||
* @since 2024/10/10 09:37 v1.0.3
|
||||
* @return 配置文件内容
|
||||
*/
|
||||
JSONObject getConfig();
|
||||
}
|
@ -1,16 +1,15 @@
|
||||
package cn.wzpmc.plugins;
|
||||
|
||||
import cn.wzpmc.user.IBot;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* Java插件基类
|
||||
@ -29,6 +28,11 @@ public abstract class JavaPlugin implements BasePlugin {
|
||||
* @since 2024/8/23 21:42 v0.0.5-dev
|
||||
*/
|
||||
private Logger logger;
|
||||
/**
|
||||
* 配置文件缓存
|
||||
* @since 2024/10/10 09:35 v1.0.3
|
||||
*/
|
||||
private JSONObject config;
|
||||
|
||||
@Override
|
||||
public IPluginClassLoader getClassLoader() {
|
||||
@ -89,12 +93,36 @@ public abstract class JavaPlugin implements BasePlugin {
|
||||
@Override
|
||||
public void saveDefaultConfig() {
|
||||
try (InputStream resourceAsStream = this.getResourceAsStream("config.yml")) {
|
||||
if (resourceAsStream == null){
|
||||
log.error("config.yml no found");
|
||||
return;
|
||||
}
|
||||
File defaultConfigFile = this.getDefaultConfigFile();
|
||||
if (!defaultConfigFile.exists()) {
|
||||
try (FileOutputStream fileOutputStream = new FileOutputStream(defaultConfigFile)) {
|
||||
resourceAsStream.transferTo(fileOutputStream);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e);
|
||||
}
|
||||
}
|
||||
public void reloadConfig() {
|
||||
File file = new File(this.getDataFolder(), "config.yml");
|
||||
if (!file.exists()) {
|
||||
saveDefaultConfig();
|
||||
}
|
||||
try(FileInputStream fis = new FileInputStream(file)) {
|
||||
this.config = new Yaml().loadAs(fis, JSONObject.class);
|
||||
} catch (IOException e) {
|
||||
this.logger.error("加载配置文件时出错!");
|
||||
this.logger.throwing(e);
|
||||
}
|
||||
}
|
||||
public JSONObject getConfig() {
|
||||
if (this.config == null) {
|
||||
reloadConfig();
|
||||
}
|
||||
return this.config;
|
||||
}
|
||||
}
|
@ -8,12 +8,20 @@ package cn.wzpmc.plugins.configuration;
|
||||
* @since 2024/7/31 上午3:42
|
||||
*/
|
||||
public interface IConfiguration {
|
||||
|
||||
/**
|
||||
* @return WebSocket连接URL
|
||||
* @author wzp
|
||||
* @since 2024/7/31 上午3:48 v0.0.1-dev
|
||||
* @since 2025/3/26 17:29 v1.0.7
|
||||
* @return 网络相关配置
|
||||
*/
|
||||
String getWebsocket();
|
||||
INetworkConfiguration getNetwork();
|
||||
/**
|
||||
*
|
||||
* @author wzp
|
||||
* @since 2025/2/4 13:44 v1.0.5
|
||||
* @return 命令前缀
|
||||
*/
|
||||
String getCommandPrefix();
|
||||
|
||||
/**
|
||||
* @return 通信验证
|
||||
|
@ -0,0 +1,38 @@
|
||||
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();
|
||||
|
||||
}
|
@ -3,6 +3,7 @@ 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;
|
||||
@ -111,9 +112,18 @@ public class CqCodeUtils {
|
||||
* @since 2024/8/26 14:40 v1.0.0
|
||||
*/
|
||||
public static JsonMessagePart parsePart(JSONObject jsonObject) throws InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException {
|
||||
PartType type = jsonObject.getObject("type", PartType.class);
|
||||
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")) {
|
||||
|
@ -18,6 +18,7 @@ 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;
|
||||
|
||||
@ -52,6 +53,7 @@ public class Main {
|
||||
}
|
||||
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;
|
||||
@ -73,11 +75,24 @@ public class Main {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -88,7 +103,7 @@ public class Main {
|
||||
public static URI getUriFromConfiguration(Configuration configuration) {
|
||||
URI uri;
|
||||
try {
|
||||
uri = new URI(configuration.getWebsocket());
|
||||
uri = new URI(configuration.getNetwork().getWebsocket());
|
||||
} catch (URISyntaxException e) {
|
||||
return null;
|
||||
}
|
||||
@ -127,8 +142,8 @@ public class Main {
|
||||
}
|
||||
|
||||
public static WebSocketConnectionHandler createConnection(MyBot myBot, URI uri) {
|
||||
WebSocketConnectionHandler webSocketConnectionHandler = new WebSocketConnectionHandler(myBot);
|
||||
webSocketConnectionHandler.connect(uri);
|
||||
WebSocketConnectionHandler webSocketConnectionHandler = new WebSocketConnectionHandler(myBot, uri);
|
||||
webSocketConnectionHandler.connect();
|
||||
return webSocketConnectionHandler;
|
||||
}
|
||||
|
||||
|
@ -25,10 +25,12 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
*/
|
||||
public class HelpCommand implements BrigadierCommand {
|
||||
private final CommandManager commandManager;
|
||||
private final String commandPrefix;
|
||||
|
||||
public HelpCommand() {
|
||||
IBot instance = MyBot.getInstance();
|
||||
this.commandManager = (CommandManager) instance.getCommandManager();
|
||||
this.commandPrefix = instance.getConfiguration().getCommandPrefix();
|
||||
}
|
||||
|
||||
private static void handlerNode(Collection<CommandNode<CommandSender>> node, int tabCount, StringBuilder builder) {
|
||||
@ -54,7 +56,7 @@ public class HelpCommand implements BrigadierCommand {
|
||||
CommandSender source = e.getSource();
|
||||
for (CommandNode<CommandSender> child : children) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append('/');
|
||||
builder.append(commandPrefix);
|
||||
builder.append(child.getUsageText());
|
||||
builder.append('\n');
|
||||
handlerNode(child.getChildren(), 1, builder);
|
||||
@ -63,7 +65,7 @@ public class HelpCommand implements BrigadierCommand {
|
||||
}
|
||||
ConcurrentHashMap<String, RawCommand> rawCommands = this.commandManager.getRawCommands();
|
||||
for (Map.Entry<String, RawCommand> stringRawCommandEntry : rawCommands.entrySet()) {
|
||||
source.sendMessage(StringMessage.text("/" + stringRawCommandEntry.getKey()));
|
||||
source.sendMessage(StringMessage.text(commandPrefix + stringRawCommandEntry.getKey()));
|
||||
}
|
||||
return 0;
|
||||
}).
|
||||
@ -78,7 +80,7 @@ public class HelpCommand implements BrigadierCommand {
|
||||
continue;
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append('/');
|
||||
builder.append(commandPrefix);
|
||||
builder.append(child.getUsageText());
|
||||
builder.append('\n');
|
||||
handlerNode(child.getChildren(), 1, builder);
|
||||
@ -87,7 +89,7 @@ public class HelpCommand implements BrigadierCommand {
|
||||
}
|
||||
ConcurrentHashMap<String, RawCommand> rawCommands = this.commandManager.getRawCommands();
|
||||
for (Map.Entry<String, RawCommand> stringRawCommandEntry : rawCommands.entrySet()) {
|
||||
source.sendMessage(StringMessage.text("/" + stringRawCommandEntry.getKey()));
|
||||
source.sendMessage(StringMessage.text(commandPrefix + stringRawCommandEntry.getKey()));
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
|
@ -26,12 +26,14 @@ public class CommandEventHandler {
|
||||
public void onGroupMessage(GroupMessageEvent event) {
|
||||
GroupCommandSender groupCommandSender = GroupCommandSender.of(event);
|
||||
IBot instance = MyBot.getInstance();
|
||||
String commandPrefix = instance.getConfiguration().getCommandPrefix();
|
||||
Long id = instance.getId();
|
||||
String message = event.getRawMessage().getMessage();
|
||||
Pattern compile = Pattern.compile("\\[CQ:at,qq=" + id + ".*?]\\s*?/.*");
|
||||
String quotedPrefix = Pattern.quote(commandPrefix);
|
||||
Pattern compile = Pattern.compile("\\[CQ:at,qq=" + id + ".*?]\\s*?" + quotedPrefix + ".*");
|
||||
if (compile.asMatchPredicate().test(message)) {
|
||||
CommandManager commandManager = (CommandManager) instance.getCommandManager();
|
||||
String commandRaw = message.replaceFirst("\\[CQ:at,qq=[0-9]{10}.*?]\\s*?/", "");
|
||||
String commandRaw = message.replaceFirst("\\[CQ:at,qq=[0-9]{10}.*?]\\s*?" + quotedPrefix, "");
|
||||
log.info("群{}中的用户{}使用了指令{}", groupCommandSender.getGroupId(), groupCommandSender.getId(), commandRaw);
|
||||
commandManager.execute(groupCommandSender, commandRaw);
|
||||
}
|
||||
@ -43,9 +45,10 @@ public class CommandEventHandler {
|
||||
IBot instance = MyBot.getInstance();
|
||||
StringMessage rawMessage = event.getRawMessage();
|
||||
String message = rawMessage.getMessage();
|
||||
if (message.startsWith("/")) {
|
||||
String commandPrefix = instance.getConfiguration().getCommandPrefix();
|
||||
if (message.startsWith(commandPrefix)) {
|
||||
CommandManager commandManager = (CommandManager) instance.getCommandManager();
|
||||
String commandRaw = message.replaceFirst("/", "");
|
||||
String commandRaw = message.replaceFirst(commandPrefix, "");
|
||||
log.info("用户{}使用了指令{}", sender.getId(), commandRaw);
|
||||
commandManager.execute(sender, commandRaw);
|
||||
}
|
||||
|
@ -12,12 +12,19 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class Configuration implements IConfiguration {
|
||||
|
||||
/**
|
||||
* WebSocket连接URL
|
||||
*
|
||||
* @since 2024/7/30 下午11:48 v0.0.1-dev
|
||||
* 网络相关配置
|
||||
* @since 2025/3/26 17:32 v1.0.7
|
||||
*/
|
||||
private String websocket;
|
||||
private NetworkConfiguration network;
|
||||
|
||||
|
||||
/**
|
||||
* 命令前缀
|
||||
* @since 2025/2/4 13:45 v1.0.5
|
||||
*/
|
||||
private String commandPrefix;
|
||||
/**
|
||||
* 通信验证
|
||||
*
|
||||
|
@ -0,0 +1,38 @@
|
||||
package cn.wzpmc.configuration;
|
||||
|
||||
import cn.wzpmc.plugins.configuration.INetworkConfiguration;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wzp
|
||||
* @since 2025/3/26 17:29
|
||||
* @version 1.0.7
|
||||
*/
|
||||
@Data
|
||||
public class NetworkConfiguration implements INetworkConfiguration {
|
||||
/**
|
||||
* WebSocket连接URL
|
||||
* @since 2025/3/26 17:31 v1.0.7
|
||||
*/
|
||||
private String websocket;
|
||||
/**
|
||||
* 是否启用连接重试
|
||||
* @since 2025/3/26 17:31 v1.0.7
|
||||
*/
|
||||
private Boolean retry;
|
||||
/**
|
||||
* 重试最大次数(-1为无限)
|
||||
* @since 2025/3/26 17:31 v1.0.7
|
||||
*/
|
||||
private Integer maxRetryCount;
|
||||
/**
|
||||
* 获取重试间隔(单位毫秒)
|
||||
* @since 2025/3/26 17:31 v1.0.7
|
||||
*/
|
||||
private Long retryInterval;
|
||||
|
||||
@Override
|
||||
public Boolean isRetry() {
|
||||
return this.retry;
|
||||
}
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
package cn.wzpmc.console;
|
||||
|
||||
import cn.wzpmc.entities.api.ApiResponseRequired;
|
||||
import cn.wzpmc.entities.user.bot.MyBot;
|
||||
import cn.wzpmc.network.WebSocketConnectionHandler;
|
||||
import cn.wzpmc.plugins.CommandManager;
|
||||
import cn.wzpmc.utils.json.action.ActionReader;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
@ -47,12 +49,16 @@ public class MyBotConsole extends SimpleTerminalConsole {
|
||||
@Override
|
||||
public void shutdown() {
|
||||
this.webSocketConnectionHandler.kill();
|
||||
for (ApiResponseRequired<?, ?> value : ActionReader.tasks.values()) {
|
||||
value.getFuture().complete(null);
|
||||
}
|
||||
running = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
this.bot.setConsole(this);
|
||||
if (this.bot.isShutdown()) return;
|
||||
super.start();
|
||||
}
|
||||
}
|
@ -50,6 +50,8 @@ public class MyBot extends IBot {
|
||||
private final Configuration configuration;
|
||||
private final CommandManager commandManager = new CommandManager(this);
|
||||
private final PluginManager pluginManager = new PluginManager();
|
||||
@Setter
|
||||
private boolean shutdown = false;
|
||||
private final IncreasbleHashMap<Class<? extends Event>, EventHandlerMethod> events = new IncreasbleHashMap<>();
|
||||
@Getter
|
||||
private final Ops ops;
|
||||
|
@ -37,7 +37,6 @@ public class HandshakePacketHandler extends SimpleChannelInboundHandler<FullHttp
|
||||
handshaker.finishHandshake(channelHandlerContext.channel(), fullHttpResponse);
|
||||
this.handshakeFuture.complete(true);
|
||||
log.debug("握手成功");
|
||||
log.info("连接服务器成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,8 @@ import java.util.concurrent.Executors;
|
||||
public class PacketHandler extends SimpleChannelInboundHandler<TextWebSocketFrame> {
|
||||
private final IBot bot;
|
||||
private final ExecutorService threadPool = Executors.newFixedThreadPool(4);
|
||||
private final Runnable retryFunction;
|
||||
|
||||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext channelHandlerContext, TextWebSocketFrame webSocketFrame) {
|
||||
@ -105,4 +107,10 @@ public class PacketHandler extends SimpleChannelInboundHandler<TextWebSocketFram
|
||||
public <REQUEST, RESPONSE> void registerResponse(UUID echo, CompletableFuture<ActionResponse<RESPONSE>> responsePromise, Action<REQUEST, RESPONSE> request) {
|
||||
ActionReader.tasks.put(echo, new ApiResponseRequired<>(responsePromise, request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
log.info("与服务器断开连接!");
|
||||
retryFunction.run();
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,11 @@ package cn.wzpmc.network;
|
||||
|
||||
import cn.wzpmc.api.Action;
|
||||
import cn.wzpmc.api.ActionResponse;
|
||||
import cn.wzpmc.user.IBot;
|
||||
import cn.wzpmc.console.MyBotConsole;
|
||||
import cn.wzpmc.entities.api.ApiResponseRequired;
|
||||
import cn.wzpmc.entities.user.bot.MyBot;
|
||||
import cn.wzpmc.plugins.configuration.INetworkConfiguration;
|
||||
import cn.wzpmc.utils.json.action.ActionReader;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import io.netty.bootstrap.Bootstrap;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
@ -32,26 +36,70 @@ import java.util.concurrent.ExecutionException;
|
||||
@RequiredArgsConstructor
|
||||
public class WebSocketConnectionHandler {
|
||||
private final EventLoopGroup eventLoopGroup = new NioEventLoopGroup();
|
||||
private final IBot bot;
|
||||
private final MyBot bot;
|
||||
/**
|
||||
* websocket连接地址
|
||||
* @since 2025/3/26 17:56 v1.0.7
|
||||
*/
|
||||
private final URI websocket;
|
||||
private ChannelFuture channelFuture;
|
||||
private PacketHandler packetHandler;
|
||||
private HandshakePacketHandler handshakePacketHandler;
|
||||
private int currentRetryCount = 0;
|
||||
|
||||
|
||||
private void tryReconnect() {
|
||||
INetworkConfiguration network = bot.getConfiguration().getNetwork();
|
||||
if (!network.isRetry()) {
|
||||
this.quit();
|
||||
return;
|
||||
}
|
||||
Integer maxRetryCount = network.getMaxRetryCount();
|
||||
if (maxRetryCount != 0 && currentRetryCount >= maxRetryCount) {
|
||||
this.quit();
|
||||
return;
|
||||
}
|
||||
this.currentRetryCount++;
|
||||
log.info("尝试重连第{}次", currentRetryCount);
|
||||
this.connect();
|
||||
}
|
||||
|
||||
private void quit() {
|
||||
for (ApiResponseRequired<?, ?> value : ActionReader.tasks.values()) {
|
||||
value.getFuture().obtrudeException(new InterruptedException());
|
||||
}
|
||||
this.handshakePacketHandler.getHandshakeFuture().obtrudeException(new InterruptedException());
|
||||
MyBotConsole console = bot.getConsole();
|
||||
bot.setShutdown(true);
|
||||
if (console == null) {
|
||||
this.eventLoopGroup.shutdownGracefully();
|
||||
return;
|
||||
}
|
||||
console.shutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* 建立连接
|
||||
*
|
||||
* @param websocket websocket连接地址
|
||||
* @author wzp
|
||||
* @since 2024/7/30 下午11:55 v0.0.1-dev
|
||||
*/
|
||||
public void connect(URI websocket) {
|
||||
public void connect() {
|
||||
log.info("正在连接websocket");
|
||||
Bootstrap bootstrap = new Bootstrap();
|
||||
WebSocketClientHandshaker clientHandshaker = WebSocketClientHandshakerFactory.newHandshaker(websocket, WebSocketVersion.V13, null, false, new DefaultHttpHeaders());
|
||||
WebSocketClientHandshaker clientHandshaker = WebSocketClientHandshakerFactory.newHandshaker(websocket, WebSocketVersion.V13, null, false, new DefaultHttpHeaders(), 65536 * 100);
|
||||
this.handshakePacketHandler = new HandshakePacketHandler(clientHandshaker);
|
||||
this.packetHandler = new PacketHandler(this.bot);
|
||||
this.packetHandler = new PacketHandler(this.bot, this::tryReconnect);
|
||||
bootstrap.group(eventLoopGroup).channel(NioSocketChannel.class).handler(new WebSocketChannelInitializer(this.packetHandler, this.handshakePacketHandler));
|
||||
this.channelFuture = bootstrap.connect(websocket.getHost(), websocket.getPort());
|
||||
this.channelFuture.addListener(future -> {
|
||||
if (!future.isSuccess()) {
|
||||
log.info("连接失败!");
|
||||
this.tryReconnect();
|
||||
} else {
|
||||
log.info("连接成功!");
|
||||
this.currentRetryCount = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -81,6 +129,7 @@ public class WebSocketConnectionHandler {
|
||||
this.handshakePacketHandler.getHandshakeFuture().get();
|
||||
} catch (ExecutionException e) {
|
||||
log.error(e);
|
||||
return null;
|
||||
}
|
||||
CompletableFuture<ActionResponse<RESPONSE>> responsePromise = new CompletableFuture<>();
|
||||
packetHandler.registerResponse(request.getEcho(), responsePromise, request);
|
||||
|
@ -12,6 +12,7 @@ import cn.wzpmc.events.notice.notify.NotifyEvent;
|
||||
import cn.wzpmc.events.request.RequestEvent;
|
||||
import cn.wzpmc.message.StringMessage;
|
||||
import cn.wzpmc.message.json.JsonMessage;
|
||||
import cn.wzpmc.message.json.JsonMessagePart;
|
||||
import cn.wzpmc.user.Friend;
|
||||
import cn.wzpmc.user.IBot;
|
||||
import cn.wzpmc.user.IUser;
|
||||
@ -20,10 +21,7 @@ import cn.wzpmc.utils.json.action.ActionReader;
|
||||
import cn.wzpmc.utils.json.action.ActionWriter;
|
||||
import cn.wzpmc.utils.json.event.*;
|
||||
import cn.wzpmc.utils.json.honor.HonorWriter;
|
||||
import cn.wzpmc.utils.json.message.JsonMessageReader;
|
||||
import cn.wzpmc.utils.json.message.JsonMessageWriter;
|
||||
import cn.wzpmc.utils.json.message.StringMessageReader;
|
||||
import cn.wzpmc.utils.json.message.StringMessageWriter;
|
||||
import cn.wzpmc.utils.json.message.*;
|
||||
import cn.wzpmc.utils.json.user.FriendUserReader;
|
||||
import cn.wzpmc.utils.json.user.GroupUserReader;
|
||||
import cn.wzpmc.utils.json.user.IBotReader;
|
||||
@ -49,6 +47,7 @@ public class JsonUtils {
|
||||
JSON.register(Actions.class, new ActionWriter());
|
||||
JSON.register(HonorType.class, new HonorWriter());
|
||||
JSON.register(StringMessage.class, new StringMessageWriter());
|
||||
JSON.register(JsonMessagePart.class, new JsonMessagePartWriter());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.wzpmc.utils;
|
||||
|
||||
import cn.wzpmc.configuration.Configuration;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
@ -30,7 +31,8 @@ public class YamlUtils {
|
||||
*/
|
||||
public static <T> T readYamlStream(InputStream is, Class<T> clazz) {
|
||||
Yaml yaml = new Yaml();
|
||||
return yaml.loadAs(is, clazz);
|
||||
JSONObject json = yaml.loadAs(is, JSONObject.class);
|
||||
return json.to(clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,25 @@
|
||||
package cn.wzpmc.utils.json.message;
|
||||
|
||||
import cn.wzpmc.message.json.JsonMessagePart;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.fastjson2.JSONWriter;
|
||||
import com.alibaba.fastjson2.writer.ObjectWriter;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
* @author wzp
|
||||
* @since 2025/2/1 04:19
|
||||
* @version 1.0.5
|
||||
**/
|
||||
public class JsonMessagePartWriter implements ObjectWriter<JsonMessagePart> {
|
||||
@Override
|
||||
public void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {
|
||||
if (object instanceof JsonMessagePart) {
|
||||
System.out.println(object);
|
||||
JSONObject from = JSONObject.from(object);
|
||||
from.put("type", ((JsonMessagePart) object).getStringPartType());
|
||||
jsonWriter.write(from);
|
||||
}
|
||||
}
|
||||
}
|
@ -34,7 +34,7 @@ public class JsonMessageWriter implements ObjectWriter<JsonMessage> {
|
||||
ObjectWriter<?> objectWriter = creator.createObjectWriter(StringMessage.class);
|
||||
objectWriter.write(jsonWriter, messagePart);
|
||||
} else {
|
||||
jsonWriter.writeAny(messagePart);
|
||||
new JsonMessagePartWriter().write(jsonWriter, messagePart);
|
||||
}
|
||||
if (i != size - 1) {
|
||||
jsonWriter.writeComma();
|
||||
|
@ -1,4 +1,9 @@
|
||||
websocket: "<Your WebSocket connection link, e.g: ws://127.0.0.1:3001/>"
|
||||
network:
|
||||
websocket: "<Your WebSocket connection link, e.g: ws://127.0.0.1:3001/>"
|
||||
retry: true
|
||||
maxRetryCount: 3
|
||||
retryInterval: 10000
|
||||
commandPrefix: "/"
|
||||
authorization:
|
||||
enable: false
|
||||
token: "<If you enable authorization, you should fill in this>"
|
||||
|
Loading…
x
Reference in New Issue
Block a user