Compare commits
547 Commits
Author | SHA1 | Date | |
---|---|---|---|
cf7cb71464 | |||
6dc6e36bb3 | |||
1ae45808fd | |||
800dbbba43 | |||
c627c07aa1 | |||
4a9259dad4 | |||
fc017c8255 | |||
908812a3d9 | |||
6c7d073cb1 | |||
8677286bd4 | |||
232ffcf714 | |||
6871bc0d22 | |||
641c16ee7a | |||
75c67bdffc | |||
3a60450358 | |||
7b97210a31 | |||
d97145ee5e | |||
bc3a4355c3 | |||
d835a32683 | |||
aedea1acb9 | |||
3bce8325c1 | |||
d1c1320963 | |||
317e07eb71 | |||
37749ae15e | |||
f94c10de61 | |||
5ccef735be | |||
262002b49a | |||
40c6ba6d9e | |||
60093b562b | |||
30880ec13b | |||
cc1d82312a | |||
efca13d397 | |||
3a8c09d6db | |||
cc1bb8e5e4 | |||
93c17b6026 | |||
fd3f6272f1 | |||
4d87a3c0b7 | |||
86f47ee411 | |||
1d6b8d60f3 | |||
3890704045 | |||
b0761e9873 | |||
291314de93 | |||
fd835e9406 | |||
d681c5645a | |||
d0619f1fe8 | |||
b022a364e3 | |||
df00c61dd8 | |||
94a021bab0 | |||
6b20e9eae0 | |||
0a35a3c6f8 | |||
2e75c7bc65 | |||
3341505715 | |||
bdde9c45fd | |||
7bf94a15c8 | |||
4510477026 | |||
86e50e369b | |||
796fc6f233 | |||
80c6875567 | |||
ab89cd1c72 | |||
5e454bc971 | |||
70bfb0fcee | |||
13b95c2732 | |||
ef5866343d | |||
d5ccd105a2 | |||
20ad8dc53f | |||
de9c91d8bd | |||
6b64a0c379 | |||
f117da7ff3 | |||
f548a07230 | |||
e2e53c21fa | |||
3eaf23a56b | |||
4a5dd1f727 | |||
c2cb416b4e | |||
5cd528d5e9 | |||
980fca650b | |||
9c525141f6 | |||
3d218a0e8d | |||
db385f597b | |||
98a9d6413a | |||
a77f97fd4b | |||
e6ea1b700f | |||
596f4d06ea | |||
8e3d3b3b5d | |||
a34ad87e01 | |||
6c4c7f34cd | |||
0c859957b4 | |||
fbb9ed82ee | |||
b469c9420e | |||
aa4d930cc4 | |||
76be748160 | |||
a9dd37b8a5 | |||
5900d621f2 | |||
7442a3651b | |||
413f438689 | |||
1fc4999b09 | |||
975446a096 | |||
98cdd2f4b8 | |||
c0beec0429 | |||
614d78b3fa | |||
24b0f345e4 | |||
0ae10aa1b2 | |||
9fe7478840 | |||
efca0bc7b3 | |||
50c5e99b98 | |||
7415efcc90 | |||
5bb4584e6a | |||
795a6f3f76 | |||
fa74e08514 | |||
e6cf6e0c68 | |||
6789c16773 | |||
cdea0f8563 | |||
9df55671ac | |||
d96c6f13c1 | |||
bce1bf8704 | |||
8eb626b8da | |||
e6505d335b | |||
c8cb341afb | |||
e99cb88b13 | |||
78c3e299d0 | |||
23338437e9 | |||
f95899aebd | |||
5df10c66b6 | |||
811d1594cd | |||
c162208638 | |||
679d6597d8 | |||
f402799f28 | |||
60542d7426 | |||
db1fb58717 | |||
7d5675ec97 | |||
d8c50752f7 | |||
c674b837bb | |||
d867996072 | |||
7ef36c6933 | |||
982aae4dbf | |||
b5d3c6aaa8 | |||
5537bc32df | |||
5c0c723c5d | |||
0ed3b307d9 | |||
53a603d4ee | |||
fbf906bea7 | |||
a87e8bc3e8 | |||
a16a67dbc9 | |||
4c2231feb5 | |||
3932dd60da | |||
3c6380cb82 | |||
2612f99f35 | |||
0b4b9a6241 | |||
2d100885ee | |||
cb335720b7 | |||
dc8ad30b84 | |||
09e00652c3 | |||
b5b15c82f8 | |||
72e71124b8 | |||
d2be2acc95 | |||
d95614e960 | |||
dad9482d7a | |||
fff5d09ad9 | |||
e6ffd1fcc0 | |||
a97747b7c4 | |||
1921dcd023 | |||
18af1d00bd | |||
30cdc1da23 | |||
bb84958ce4 | |||
44de3fd00a | |||
39b1920532 | |||
aa591ec29e | |||
310c3f065d | |||
2311ef82c3 | |||
b4b931fc95 | |||
d1b887fcaa | |||
5a2990770c | |||
1d0f0a2539 | |||
dbc4d83b08 | |||
da905d21bd | |||
7d91079500 | |||
81a006a308 | |||
be59e241c6 | |||
e493139d85 | |||
1f59ec2ef9 | |||
20d05f609d | |||
0f9683de89 | |||
c805db3371 | |||
58d0d12c1f | |||
359683dbae | |||
94cab8b743 | |||
837447b6e4 | |||
ad52eade07 | |||
9cae3edb6b | |||
0860b61ccd | |||
d125c52b50 | |||
d485e095ae | |||
499caca7e3 | |||
83a2d36209 | |||
8b77ced05e | |||
49a9617f08 | |||
06aa919d9b | |||
77b77c285b | |||
bdc32b26fe | |||
736125f4ee | |||
89cb75f105 | |||
34a6261f27 | |||
ae18bfaee1 | |||
8510b0ed3f | |||
967f1a0e5b | |||
6c1fc62ef1 | |||
433c6b3b85 | |||
ee1ae5a071 | |||
49a15d512e | |||
fd1d73cc32 | |||
29c2aa9404 | |||
0ec1195930 | |||
d7a625bedb | |||
3854376210 | |||
5253d0e515 | |||
3bc7fa82b1 | |||
7d98d5819d | |||
8316c0ff63 | |||
315b8c91e5 | |||
405eb10a8a | |||
c3072e93c7 | |||
ae34ff622d | |||
d2704818d9 | |||
2ab4184314 | |||
9aade6599c | |||
2f87b06c83 | |||
8bb3f15bd9 | |||
7f198c83b5 | |||
f70c75e9c4 | |||
be5a4b270d | |||
50c0216435 | |||
4910de74fd | |||
f12b6854b7 | |||
b0b61fbaf7 | |||
7c0b0df6ed | |||
cb3ee4b72f | |||
3a3ef4d6ae | |||
9b3dea840e | |||
ca89fa7efd | |||
4705eac79c | |||
ebe0c5bcbb | |||
93c287bbd9 | |||
0defb00ede | |||
81c1d0286d | |||
fb25005bd5 | |||
2eb5aae23f | |||
a7d0560932 | |||
391f112bb3 | |||
bc8d13ba8a | |||
e8ec2ee28a | |||
b6c8fcbccd | |||
71476560e4 | |||
aa2d182840 | |||
4bf8512a7d | |||
a3a31a2c94 | |||
9ed4c1abb1 | |||
a9c6ea0452 | |||
9e2bbe2e5c | |||
598bff8c49 | |||
eb7c8300fa | |||
287ab63091 | |||
0c942d9806 | |||
237789e0d4 | |||
e656fa6a48 | |||
6dcb085b53 | |||
55a427e344 | |||
43eef20b71 | |||
b8fdb4146e | |||
cdbede7135 | |||
85a3a9ad52 | |||
943e0c2665 | |||
fd4d680e87 | |||
0b763135c9 | |||
832cc2ec44 | |||
3160b4be69 | |||
775596b5bf | |||
84782a92d8 | |||
6e817111cb | |||
cd8d631348 | |||
af37e61d05 | |||
803b65e08e | |||
aa9abde63a | |||
9c35abc6e2 | |||
1af95a15aa | |||
d2b693b1e0 | |||
b05bbf2f19 | |||
37ed3b0824 | |||
b56ec5ce38 | |||
1fb3f6cd58 | |||
1dfe1a5819 | |||
5d194b8ebe | |||
78810d2ca8 | |||
87d4202ed3 | |||
1d0b18291e | |||
16df5706ff | |||
1b24157f08 | |||
8ba50b7bd6 | |||
502ccb46bb | |||
fcbc410f1a | |||
85a7c28a3a | |||
7bd0da9316 | |||
212c338fcd | |||
137270b886 | |||
079b940d8e | |||
e396db67ce | |||
f37b469ab9 | |||
0a3363ebce | |||
53291822c0 | |||
5f5dcc7f99 | |||
9d27abfe04 | |||
4b4f030fe3 | |||
d5b0f947e0 | |||
9e6372185f | |||
0e125f7c81 | |||
a3ea422ec3 | |||
8d78e643e0 | |||
aa9cae7008 | |||
48085a946d | |||
8e27f6b9b0 | |||
f980e77a4a | |||
01798f7b11 | |||
03057c8ef9 | |||
ee851116d8 | |||
d367903946 | |||
66ade9efc6 | |||
ff41e72378 | |||
169f1645a4 | |||
c3914b2b15 | |||
b356524a9e | |||
85a13251a5 | |||
0417805e46 | |||
d3f1e35a12 | |||
ff585ac7c2 | |||
1b692dd13f | |||
dd00e6ecec | |||
222250bc41 | |||
c36e706731 | |||
adc9b76688 | |||
2e3ea96972 | |||
9b07d41f86 | |||
65ad377099 | |||
a61357f4e2 | |||
60403b2a4f | |||
624afa57ba | |||
36a39e1ed7 | |||
4a872c3435 | |||
90b9d1af1e | |||
551ca06ea7 | |||
61c0cf2c2d | |||
e801a99f67 | |||
beebfe7deb | |||
32e1963d5a | |||
facf5bedb1 | |||
035d43fb18 | |||
0d5f9fee52 | |||
3cb03fa4dc | |||
47ef3f2a49 | |||
8568c7bb99 | |||
02cf058552 | |||
c9157f0e2c | |||
83325e63ea | |||
37b8d969b1 | |||
298bdc7b8c | |||
81a191f8ba | |||
c3fc5d429b | |||
b08c934c78 | |||
1b1ddbdd8d | |||
0d16d53cb7 | |||
6c39ed8ab5 | |||
2f8999b5ad | |||
7107d03b72 | |||
3bd40e7271 | |||
8ace3e68f4 | |||
f69feb1def | |||
9fb423d5e0 | |||
e9df67a661 | |||
b6871ea13a | |||
cb84a7d0d9 | |||
25f7540f86 | |||
c29a3fd6d4 | |||
ab48396db9 | |||
51982b63c3 | |||
2b537d27ec | |||
16930e96aa | |||
d63ba4943a | |||
5d22f20ce3 | |||
2451849fd6 | |||
61680d9e87 | |||
850dd75822 | |||
6ba983fae3 | |||
ca34f9c2a1 | |||
0fb5b84392 | |||
39a9c39924 | |||
13692228c6 | |||
f22f4d229d | |||
97dbf42a4d | |||
041a219151 | |||
c137f2f916 | |||
6ef3b09ec9 | |||
263b78e995 | |||
0d87848a7e | |||
44ad0832ba | |||
93ced26e07 | |||
363daf6251 | |||
a6b1d1c9e0 | |||
576d8c23b3 | |||
c232c6e5f6 | |||
5d6ae52157 | |||
01e6256ed4 | |||
dbc114a529 | |||
4d77af8f0c | |||
c36a925bb5 | |||
605dd035d4 | |||
7526ae13d7 | |||
0eb41f70d2 | |||
a4c7ee738c | |||
8d4602c40d | |||
bb20d9623d | |||
73cc28d1cf | |||
ae54cd923c | |||
9d3c9a7d70 | |||
92a4274be7 | |||
4800b3f46c | |||
cce593b2f4 | |||
c491642713 | |||
5b4dd638a4 | |||
8440952167 | |||
4e4227e204 | |||
effb01d43c | |||
28d730a2ca | |||
0bd135a5c9 | |||
5522391942 | |||
7576355e95 | |||
c9e518f2ed | |||
593cf2407b | |||
bdb4c76d70 | |||
7cce805d39 | |||
b9d3ecc15d | |||
ec5eae08f7 | |||
c1edf31577 | |||
5262c04e46 | |||
8b01943d14 | |||
35823be13e | |||
4162ea33ff | |||
1787ef4db7 | |||
38b13611c9 | |||
52fa143e75 | |||
89047a0c8a | |||
9fbded7d6a | |||
c657781599 | |||
ecbe1ff79e | |||
d6811ab9b3 | |||
d45170db3e | |||
6e63768c71 | |||
1424bc2cf6 | |||
051fe3d15d | |||
fcae485071 | |||
2e9a7fdf94 | |||
570d7e18a4 | |||
8ac53970a3 | |||
dd3e108e10 | |||
c29bd81ffb | |||
a1173e4d84 | |||
d877e30a05 | |||
33ad54090d | |||
83ee6cfdbd | |||
f48971a0c4 | |||
a4b71aa73c | |||
4b7df662e8 | |||
4cd7b6718b | |||
ac2a94dda0 | |||
de7e65b32a | |||
1b283261c3 | |||
39cbfc1baa | |||
e563f18d31 | |||
1d03b3f28f | |||
ae0025a203 | |||
b5bd7acb7f | |||
657e7e52ac | |||
d6341c88cd | |||
bdb1191f9e | |||
3b29b67c0b | |||
cc43e53c4b | |||
a25c900d49 | |||
206651da94 | |||
be28116a98 | |||
4cdf29557c | |||
62928e47eb | |||
9b50b719d9 | |||
def60bf298 | |||
6496b6e463 | |||
6ce4c972a0 | |||
70e3c9968a | |||
074882f092 | |||
c2b3018908 | |||
96c85d9dca | |||
e15aafd781 | |||
9e17b84a5d | |||
c66d470166 | |||
4deb7d11a1 | |||
6f069f83d4 | |||
fa53df1e8a | |||
ba17f9d159 | |||
b558b51601 | |||
3ea0acd48b | |||
c171873fa6 | |||
1ccf94883a | |||
b26f8e0d24 | |||
5bc2725d1b | |||
8e06244311 | |||
0f35613e50 | |||
4cfad0b5ca | |||
c2593e71c0 | |||
bb331232ca | |||
96e8293bf4 | |||
e13464cb7c | |||
c5f8fbe86d | |||
8667706377 | |||
86e47ab226 | |||
10c383d66a | |||
4c65a308d6 | |||
246e43317f | |||
974b97b744 | |||
c914ddc0ee | |||
6509b293db | |||
a72eeb4c3f | |||
309397b72c | |||
077658c68d | |||
322ad19889 | |||
ab9d3d3d3e | |||
06a109d2b5 | |||
351743068a | |||
4e6532ff0d | |||
eaf57f2c33 | |||
7abdac7c9c | |||
002df66878 | |||
251bfaf410 | |||
24722447da | |||
90e7a90bcf | |||
6d3d3fc52c | |||
e843d790b1 | |||
c90ac1d21a | |||
041ceb81d8 | |||
c6f2a29320 | |||
0532d7592e | |||
f9fe1922d4 | |||
88b5b55062 | |||
afe501a06d |
0
.dockerignore
Normal file → Executable file
1
.github/ISSUE_TEMPLATE/config.yml
vendored
Executable file
@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
59
.github/ISSUE_TEMPLATE/resource_publish_en.yml
vendored
Executable file
@ -0,0 +1,59 @@
|
||||
name: Publish Resource
|
||||
title: "Resource: {name}"
|
||||
description: Publish the resource to the LiteyukiBot official store
|
||||
labels: [ "Resource" ]
|
||||
body:
|
||||
- type: input
|
||||
id: name
|
||||
attributes:
|
||||
label: Name
|
||||
description: The readable name of the resource pack
|
||||
placeholder: e.g. Cute UI Resource Pack
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: A brief description of the resource
|
||||
placeholder: e.g. Makes the rendering card style more beautiful
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: author
|
||||
attributes:
|
||||
label: Author
|
||||
description: The GitHub username of the author
|
||||
placeholder: e.g. snowykami
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: link
|
||||
attributes:
|
||||
label: Link
|
||||
description: Direct download link of the resource pack
|
||||
placeholder: e.g. https://aaa.com/r.zip
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: homepage
|
||||
attributes:
|
||||
label: Homepage
|
||||
description: Homepage of the resource pack
|
||||
placeholder: e.g. https://github.com/user/repo
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: input
|
||||
id: tags
|
||||
attributes:
|
||||
label: Tags
|
||||
description: Tags
|
||||
placeholder: 'e.g. [{"label": "Tag Name", "color": "#ea5252"}]'
|
||||
value: '[ { "label": "Text", "color": "#a2d8f4" } ]'
|
||||
validations:
|
||||
required: false
|
59
.github/ISSUE_TEMPLATE/resource_publish_zh.yml
vendored
Executable file
@ -0,0 +1,59 @@
|
||||
name: 发布资源
|
||||
title: "Resource: {name}"
|
||||
description: 发布资源到轻雪机器人官方商店
|
||||
labels: [ "Resource" ]
|
||||
body:
|
||||
- type: input
|
||||
id: name
|
||||
attributes:
|
||||
label: 名称
|
||||
description: 资源包的可读名称
|
||||
placeholder: e.g. 可爱UI资源包
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: description
|
||||
attributes:
|
||||
label: 描述
|
||||
description: 资源的简短描述
|
||||
placeholder: e.g. 使渲染卡片的样式更美观
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: author
|
||||
attributes:
|
||||
label: 作者
|
||||
description: 作者的github用户名
|
||||
placeholder: e.g. snowykami
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: link
|
||||
attributes:
|
||||
label: 下载链接
|
||||
description: 资源包直接下载链接
|
||||
placeholder: e.g. https://aaa.com/r.zip
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: homepage
|
||||
attributes:
|
||||
label: 主页
|
||||
description: 资源包主页
|
||||
placeholder: e.g. https://github.com/user/repo
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: input
|
||||
id: tags
|
||||
attributes:
|
||||
label: 标签
|
||||
description: 标签
|
||||
placeholder: 'e.g. [{"label": "标签名", "color": "#ea5252"}]'
|
||||
value: '[ { "label": "标签名", "color": "#a2d8f4" } ]'
|
||||
validations:
|
||||
required: false
|
53
.github/ISSUE_TEMPLATE/问题反馈.md
vendored
Executable file
@ -0,0 +1,53 @@
|
||||
---
|
||||
name: 问题反馈
|
||||
about: 反馈你在使用轻雪中遇到的问题
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# 问题反馈
|
||||
|
||||
## **请确保**
|
||||
|
||||
- 已认真阅读[文档]("https://bot.liteyuki.icu"),该问题不是文档提及的或你自己操作不当造成的
|
||||
- 你的问题是在最新版本的代码上测试的
|
||||
- 请勿重复提交相同或类似的issue
|
||||
|
||||
|
||||
## **描述问题**
|
||||
|
||||
请在此简单描述问题
|
||||
|
||||
|
||||
|
||||
## **如何复现**
|
||||
|
||||
请阐述一下如何重现这个问题
|
||||
### 预期
|
||||
|
||||
描述你期望发生的事情
|
||||
|
||||
### 实际
|
||||
|
||||
描述实际发生的事情
|
||||
|
||||
|
||||
|
||||
## **日志或截图**
|
||||
```
|
||||
日志内容
|
||||
```
|
||||
|
||||
|
||||
## **设备信息**
|
||||
- **系统**: [例如 Ubuntu 22.04]
|
||||
- **CPU**: [例如 Intel i7-7700K]
|
||||
- **内存**: [例如 16GB]
|
||||
- **Python**: [例如CPython 3.10.7]
|
||||
|
||||
|
||||
**补充内容**
|
||||
|
||||
可选,推荐提供`pip freeze`的输出,以及其他相关信息,以及你的建议
|
11
.github/dependabot.yml
vendored
Executable file
@ -0,0 +1,11 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
33
.github/workflows/ISSUE_TEMPLATE.md
vendored
@ -1,33 +0,0 @@
|
||||
---
|
||||
name: BUG 反馈
|
||||
about: 使用轻雪时遇到了问题?
|
||||
---
|
||||
## 问题反馈
|
||||
|
||||
### **描述**
|
||||
请详细描述一下你所遇到的bug
|
||||
|
||||
### **确保**
|
||||
|
||||
- [ ] 我已查阅所有issues,没有相似或已被证实的内容
|
||||
- [ ] 我已按照文档指引进行正确的操作,仍会复现该问题
|
||||
|
||||
### **预期效果**
|
||||
你想要什么样的预期效果
|
||||
|
||||
### **实际效果**
|
||||
实际上是怎么样的
|
||||
|
||||
### **运行环境**
|
||||
- 系统及版本:
|
||||
- Python环境:
|
||||
- commit哈希或版本:
|
||||
- 硬件信息(可选):
|
||||
|
||||
### **运行日志**
|
||||
```
|
||||
将相关日志粘贴到此处
|
||||
```
|
||||
|
||||
### **严重等级**
|
||||
致命|严重|警告|轻微
|
43
.github/workflows/build-image.yml
vendored
Executable file
@ -0,0 +1,43 @@
|
||||
|
||||
name: Docker Image Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: docker-build
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
password: ${{ secrets.GHCR_PASSWORD }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ghcr.io/liteyukistudio/liteyukibot:latest
|
||||
|
||||
- name: Log out from GitHub Container Registry
|
||||
run: docker logout ghcr.io
|
66
.github/workflows/deploy-docs-liteyukicloud.yml
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
name: Deploy VitePress site to Liteyuki PaaS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
contents: write
|
||||
statuses: write
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
MELI_SITE: "800a7c09-dd9c-4ba7-a43f-af9bc69808c4"
|
||||
|
||||
jobs:
|
||||
# 构建工作
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Setup API markdown
|
||||
run: |-
|
||||
python -m pip install litedoc
|
||||
litedoc liteyuki -o docs/zh/dev/api -l zh-Hans -cd class -fd func -md func -vd var -bu https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/
|
||||
litedoc liteyuki -o docs/en/dev/api -l en -cd class -fd func -md func -vd var -bu https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/
|
||||
|
||||
- name: 安装 pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
run_install: true
|
||||
version: 8
|
||||
|
||||
- name: 设置 Node.js
|
||||
run: |-
|
||||
cd docs
|
||||
pnpm install
|
||||
|
||||
- name: 构建文档
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=8192
|
||||
run: |-
|
||||
cd docs
|
||||
pnpm run docs:build
|
||||
> .vitepress/dist/.nojekyll
|
||||
|
||||
- name: "发布"
|
||||
run: |
|
||||
npx -p "@getmeli/cli" meli upload docs/.vitepress/dist \
|
||||
--url "https://dash.apage.dev" \
|
||||
--site "$MELI_SITE" \
|
||||
--token "$MELI_TOKEN" \
|
||||
--release "$GITHUB_SHA"
|
||||
env:
|
||||
MELI_TOKEN: ${{ secrets.MELI_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
49
.github/workflows/deploy-docs.yml
vendored
@ -1,49 +0,0 @@
|
||||
|
||||
name: 部署文档
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
# 确保这是你正在使用的分支名称
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
deploy-gh-pages:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# 如果你文档需要 Git 子模块,取消注释下一行
|
||||
# submodules: true
|
||||
|
||||
- name: 安装 pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
run_install: true
|
||||
version: 8
|
||||
|
||||
|
||||
- name: 设置 Node.js
|
||||
run: |-
|
||||
cd docs
|
||||
pnpm install
|
||||
|
||||
- name: 构建文档
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=8192
|
||||
run: |-
|
||||
cd docs
|
||||
pnpm run docs:build
|
||||
> .vuepress/dist/.nojekyll
|
||||
|
||||
- name: 部署文档
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
with:
|
||||
# 这是文档部署到的分支名称
|
||||
branch: gh-pages
|
||||
folder: docs/.vuepress/dist
|
51
.github/workflows/issue_handler.yml
vendored
Executable file
@ -0,0 +1,51 @@
|
||||
name: Issue Handler
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [ opened, edited, closed ]
|
||||
|
||||
concurrency:
|
||||
group: issue_handler
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
check-issue:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check issue title
|
||||
id: check_title
|
||||
run: |
|
||||
ISSUE_TITLE="${{ github.event.issue.title }}"
|
||||
if [[ "$ISSUE_TITLE" == Plugin:* || "$ISSUE_TITLE" == Resource:* ]]; then
|
||||
echo "Title starts with Plugin: or Resource:."
|
||||
echo "::set-output name=title_match::true"
|
||||
else
|
||||
echo "Title does not start with Plugin: or Resource:."
|
||||
echo "::set-output name=title_match::false"
|
||||
fi
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
if: steps.check_title.outputs.title_match == 'true'
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.check_title.outputs.title_match == 'true'
|
||||
run: |
|
||||
echo "Installing dependencies."
|
||||
pip install -r liteyuki_flow/requirements.txt
|
||||
|
||||
- name: Run Plugin/Resource issue handler
|
||||
if: steps.check_title.outputs.title_match == 'true'
|
||||
run: |
|
||||
echo "Running Plugin/Resource issue handler."
|
||||
python -m liteyuki_flow --handle
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
ACT_TYPE: ${{ github.event.action }}
|
30
.github/workflows/pre-commit.yml
vendored
Executable file
@ -0,0 +1,30 @@
|
||||
name: Pre-commit checks
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13'] # 添加你想要测试的 Python 版本
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }} # 使用矩阵中的 Python 版本
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install pdm
|
||||
python -m pip install pre-commit
|
||||
pdm config python.use_venv false
|
||||
pdm install --no-lock
|
||||
pre-commit install
|
||||
|
||||
- name: Run pre-commit
|
||||
run: pre-commit run --all-files
|
21
.github/workflows/pypi-publish.yml
vendored
Executable file
@ -0,0 +1,21 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
pypi-publish:
|
||||
name: upload release to PyPI
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: pdm-project/setup-pdm@v3
|
||||
|
||||
- name: Publish package distributions to PyPI
|
||||
run: pdm publish
|
53
.gitignore
vendored
Normal file → Executable file
@ -1,6 +1,10 @@
|
||||
.venv/
|
||||
.idea/
|
||||
.vscode/
|
||||
.cache/
|
||||
|
||||
venv/
|
||||
|
||||
node_modules/
|
||||
data/
|
||||
db/
|
||||
@ -11,19 +15,22 @@ __pycache__/
|
||||
*.pyd
|
||||
*.pyw
|
||||
/plugins/
|
||||
|
||||
#config
|
||||
/config/
|
||||
!config/default.yml
|
||||
_config.yml
|
||||
config.yml
|
||||
config.example.yml
|
||||
compile.bat
|
||||
liteyuki/resources/templates/latest-debug.html
|
||||
# vuepress
|
||||
.github
|
||||
pyproject.toml
|
||||
|
||||
test.py
|
||||
line_count.py
|
||||
# vuepress
|
||||
|
||||
# mupy
|
||||
mypy.ini
|
||||
|
||||
# nuitka
|
||||
compile.bat
|
||||
src/resources/templates/latest-debug.html
|
||||
main.build/
|
||||
main.dist/
|
||||
main.exe
|
||||
@ -34,4 +41,34 @@ docs/.vuepress/dist/
|
||||
prompt.txt
|
||||
|
||||
# js
|
||||
**/echarts.js
|
||||
**/echarts.js
|
||||
.env
|
||||
|
||||
|
||||
# pdm
|
||||
.pdm-python
|
||||
.pdm-build
|
||||
dist
|
||||
|
||||
doc
|
||||
|
||||
mkdoc2.py
|
||||
result.json
|
||||
|
||||
# litedoc
|
||||
docs/zh/dev/api
|
||||
docs/en/dev/api
|
||||
mkdoc.bat
|
||||
|
||||
# vitepress
|
||||
docs/.vitepress/dist/
|
||||
docs/.vitepress/cache
|
||||
docs/.vitepress/.temp
|
||||
|
||||
# python toolchain
|
||||
.mypy_cache/
|
||||
.pytest_cache/
|
||||
|
||||
# pdm
|
||||
__pypackages__/
|
||||
pdm.lock
|
26
.pre-commit-config.yaml
Executable file
@ -0,0 +1,26 @@
|
||||
fail_fast: true
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 24.4.2
|
||||
hooks:
|
||||
- id: black
|
||||
args: [--config=./pyproject.toml]
|
||||
|
||||
- repo: https://github.com/timothycrosley/isort
|
||||
rev: 5.13.2
|
||||
hooks:
|
||||
- id: isort
|
||||
args: ["--profile", "black"]
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.13.0
|
||||
hooks:
|
||||
- id: mypy
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.0.1
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- id: check-added-large-files
|
8
Dockerfile
Normal file → Executable file
@ -1,18 +1,16 @@
|
||||
FROM python:3.11-bullseye
|
||||
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/python:3.10-slim-bullseye
|
||||
|
||||
ENV TZ Asia/Shanghai
|
||||
|
||||
COPY docker/sources.list /etc/apt/sources.list
|
||||
|
||||
RUN apt-get update && apt-get install -y git
|
||||
|
||||
WORKDIR /liteyukibot
|
||||
|
||||
COPY . /liteyukibot
|
||||
|
||||
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
RUN apt-get install -y libnss3 libnspr4 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libatspi2.0-0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libxkbcommon0 libasound2
|
||||
RUN apt-get install -y libnss3 libnspr4 libdbus-1-3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libatspi2.0-0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libxkbcommon0 libasound2 libpango-1.0-0 libcairo2
|
||||
|
||||
EXPOSE 20216
|
||||
|
||||
|
52
LICENSE
Normal file → Executable file
@ -1,21 +1,31 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Snowykami
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
LSO license
|
||||
LiteyukiStudio Opensource license
|
||||
|
||||
---
|
||||
|
||||
版权所有 © 2024 Snowykami
|
||||
|
||||
---
|
||||
|
||||
免费向任何获得副本的人或组织授予以相同许可为基础的权利
|
||||
|
||||
包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售软件的副本
|
||||
|
||||
本软件及相关文档文件(以下简称"本软件")在相同方式许可为基础, 以开源的形式发布于互联网抑或其他媒体介质平台
|
||||
|
||||
任何人都有权利获取副本并以上述方式获取许可传播和/或使用
|
||||
|
||||
但获取副本时仍需注意:
|
||||
|
||||
- 上述版权声明和本许可声明应包含在本软件的副本中
|
||||
- 使用本软件及其副本时仍需保持与原有形式相同
|
||||
|
||||
- 在使用时仍需将本软件的副本以相同许可公开表现:
|
||||
- 不得未经原作者允许将本软件的副本以非原许可的形式对外盈利
|
||||
|
||||
---
|
||||
|
||||
该软件按"原样"之副本提供,不提供任何形式的任意保证,明示或暗示:
|
||||
包括但不限于适销性保证, 适用于特定目的非侵权
|
||||
|
||||
在任何情况下, 作者或版权所有者对任何非因作者或版权所有者使用该软件造成的索赔、损害或其他责任, 无论是在合同诉讼、侵权行为还是其他诉讼中都不具有责任, 作者及其版权所有者有权利驳回使用者因个人原因造成的任何损失之赔付
|
||||
|
74
README.md
Normal file → Executable file
@ -1,52 +1,70 @@
|
||||
<div align="center">
|
||||
|
||||
[//]: # (<img src="https://cdn.liteyuki.icu/static/img/logo.png" style="align-content: center; width: 50%; margin-top:10%;" alt="a">)
|
||||
[![][banner]][lightyuki-link]
|
||||
<h2><a href="https://bot.liteyuki.icu"> <span style="color: #a2d8f4">轻雪</span> <span style="color: #d0e9ff">6</span></a></h2>
|
||||
[//]: # (<img src="https://cdn.liteyuki.org/logos/bot.svg" style="align-content: center; width: 50%; margin-top:10%;" alt="a">)
|
||||
[![][banner]][liteyuki-link]
|
||||
<h2><a href="https://bot.liteyuki.org"> <span style="color: #a2d8f4">轻雪</span> <span style="color: #d0e9ff">6</span></a></h2>
|
||||
<h4> <span style="color: #a2d8f4">✨ 轻量,高效,易于扩展✨</span></h4>
|
||||
|
||||
[![][OneBot]][onebot-link]
|
||||
[![][Nonebot2]][nonebot-link]
|
||||
[![][Liteyuki6.0]][lightyuki-link]
|
||||
[![][Liteyuki6.0]][liteyuki-link]
|
||||
[![][Python3.10+]][python-link]
|
||||
[![][Usage]][usage-link]
|
||||
[![][Repo]][repo-link]
|
||||
[![][Github]][github-link]
|
||||
[![][LiteyukiLab]][liteyukilab-link]
|
||||

|
||||
|
||||
- 基于[Nonebot2](https://github.com/nonebot/nonebot2),有良好的生态支持
|
||||
- 开箱即用,无需复杂配置
|
||||
- 新的点击交互模式,拒绝手打指令
|
||||
- 可视化插件管理包管理,支持一键安装插件
|
||||
- 支持OneBot标准通信但不限于此
|
||||
- 自定义主题支持,满足审美需求
|
||||
- 国际化支持,支持多种语言
|
||||
|
||||
<h3>👇所有内容已迁移至👇</h3>
|
||||
<h2><a href="https://bot.liteyuki.icu">轻雪主页</a></h2>
|
||||
</div>
|
||||
|
||||
### 感谢
|
||||
- [Nonebot2](https://nonebot.dev)提供的框架支持
|
||||
- [nonebot-plugin-htmlrender](https://github.com/kexue-z/nonebot-plugin-htmlrender)提供的渲染功能
|
||||
- [nonebot-plugin-alconna](https://github.com/ArcletProject/nonebot-plugin-alconna)提供的命令解析功能
|
||||
## 关于
|
||||
|
||||
访问[轻雪6.0](https://bot.liteyuki.org)主页获取更多信息
|
||||
|
||||
[OneBot]: https://img.shields.io/badge/OneBot-11/12-blue?style=for-the-badge
|
||||
## 特点及优势
|
||||
|
||||
- 原生支持与任意`Python`Bot框架互联,有良好的生态支持
|
||||
- 开箱即用,无需复杂配置
|
||||
- 集成包管理器,支持一键安装插件
|
||||
- 自定义主题支持,满足审美需求
|
||||
- 国际化支持,支持多种语言
|
||||
- 高性能,500插件2s内启动
|
||||
|
||||
## 服务及支持(敬请期待)
|
||||
- 提供Liteyuki Cloud官方的容器化托管服务,无需担心服务器问题
|
||||
|
||||
**👇所有内容请访问👇**: [bot.liteyuki.org](https://bot.liteyuki.org)
|
||||
|
||||
## 参考及鸣谢
|
||||
- [nonebot-plugin-uninfo](https://github.com/RF-Tar-Railt/nonebot-plugin-uninfo)为会话部分用户信息提供了参考
|
||||
- [nonebot-plugin-alconna](https://github.com/nonebot/plugin-alconna/)为消息部分提供了参考
|
||||
|
||||
## 其他
|
||||
- 本仓库是一个monorepo,包含了框架,文档,测试,内置资源包,内置插件,预设配置等
|
||||
|
||||
[Nonebot2]: https://img.shields.io/badge/Nonebot-2-red?style=for-the-badge
|
||||
|
||||
[Liteyuki6.0]: https://img.shields.io/badge/Liteyuki-6.0-blue?style=for-the-badge
|
||||
|
||||
[Python3.10+]: https://img.shields.io/badge/Python-3.10+-blue?style=for-the-badge
|
||||
|
||||
[Usage]: https://img.shields.io/badge/文档-页面-blue?style=for-the-badge
|
||||
[Usage]: https://img.shields.io/badge/主页-文档-blue?style=for-the-badge
|
||||
|
||||
[onebot-link]:https://onebot.dev/
|
||||
[Repo]: https://img.shields.io/badge/官方托管-仓库-blue?style=for-the-badge
|
||||
|
||||
[Github]: https://img.shields.io/badge/Github-仓库-blue?style=for-the-badge
|
||||
|
||||
[LiteyukiLab]: https://img.shields.io/badge/轻雪社区-官方-blue?style=for-the-badge
|
||||
|
||||
[nonebot-link]:https://nonebot.dev/
|
||||
|
||||
[lightyuki-link]:/
|
||||
|
||||
[python-link]:https://www.python.org/
|
||||
|
||||
[usage-link]:https://bot.liteyuki.icu/
|
||||
[usage-link]:https://bot.liteyuki.org/
|
||||
|
||||
[banner]: https://socialify.git.ci/snowykami/LiteyukiBot/image?description=1&forks=1&issues=1&Plus&pulls=1&stargazers=1&theme=Auto&logo=https%3A%2F%2Fcdn.liteyuki.icu%2Fstatic%2Fimg%2Flogo.png
|
||||
[liteyuki-link]:https://bot.liteyuki.org/
|
||||
|
||||
[repo-link]:https://git.liteyuki.org/bot/app
|
||||
|
||||
[github-link]:https://github.com/LiteyukiStudio/LiteyukiBot
|
||||
|
||||
[liteyukilab-link]:https://lab.liteyuki.org/@LiteyukiBot
|
||||
|
||||
[banner]: https://socialify.git.ci/LiteyukiStudio/LiteyukiBot/image?description=1&font=Source+Code+Pro&forks=1&issues=1&logo=https%3A%2F%2Fcdn.liteyuki.org%2Flogos%2Fbot.svg&name=1&owner=1&pattern=Floating+Cogs&pulls=1&stargazers=1&theme=Auto
|
||||
|
6
config.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
config_dir: ./configs
|
||||
|
||||
log_level: DEBUG
|
||||
|
||||
host: 0.0.0.0
|
||||
port: 8090
|
10
config/default.yml
Executable file
@ -0,0 +1,10 @@
|
||||
nonebot:
|
||||
host: 0.0.0.0
|
||||
port: 20216
|
||||
command_start: ["", "/"]
|
||||
nickname: [ "liteyuki" ]
|
||||
default_language: zh
|
||||
driver: ~fastapi+~httpx+~websockets
|
||||
alconna_use_command_start: true
|
||||
gotify_token: "empty token"
|
||||
|
12
docker-compose.yml
Executable file
@ -0,0 +1,12 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
app:
|
||||
image: git.liteyuki.icu/bot/app:latest
|
||||
ports:
|
||||
- "20216:20216"
|
||||
environment:
|
||||
- TZ=Asia/Chongqing
|
||||
volumes:
|
||||
- .:/liteyukibot
|
||||
command: [ "python", "main.py" ]
|
0
docker/sources.list
Normal file → Executable file
5
docs/.gitignore
vendored
@ -1,5 +0,0 @@
|
||||
|
||||
node_modules/
|
||||
./.vuepress/.cache/
|
||||
./.vuepress/.temp/
|
||||
./.vuepress/dist/
|
138
docs/.vitepress/config/common.ts
Executable file
@ -0,0 +1,138 @@
|
||||
// 共有配置项,导入index用
|
||||
|
||||
import { defineConfig } from "vitepress";
|
||||
import { generateSidebar } from "vitepress-sidebar";
|
||||
import { zh } from "./zh";
|
||||
import { en } from "./en";
|
||||
|
||||
let defaultLocale = "zh";
|
||||
const commonSidebarOptions = {
|
||||
collapsed: true,
|
||||
convertSameNameSubFileToGroupIndexPage: true,
|
||||
useTitleFromFrontmatter: true,
|
||||
useFolderTitleFromIndexFile: true,
|
||||
useFolderLinkFromIndexFile: true,
|
||||
includeFolderIndexFile: true,
|
||||
sortMenusByFrontmatterOrder: true,
|
||||
rootGroupText: "LITEYUKIBOT",
|
||||
};
|
||||
|
||||
/**
|
||||
* Generate sidebar config
|
||||
* multiple languages and sections
|
||||
* @returns {any[]}
|
||||
*/
|
||||
function generateSidebarConfig(): any[] {
|
||||
let sections = ["dev", "store", "usage", "deploy"];
|
||||
let languages = ["zh", "en"];
|
||||
let ret = [];
|
||||
for (let language of languages) {
|
||||
for (let section of sections) {
|
||||
if (language === defaultLocale) {
|
||||
ret.push({
|
||||
basePath: `/${section}/`,
|
||||
scanStartPath: `${language}/${section}`,
|
||||
resolvePath: `/${section}/`,
|
||||
...commonSidebarOptions,
|
||||
});
|
||||
} else {
|
||||
ret.push({
|
||||
basePath: `/${language}/${section}/`,
|
||||
scanStartPath: `${language}/${section}`,
|
||||
resolvePath: `/${language}/${section}/`,
|
||||
...commonSidebarOptions,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
export const common = defineConfig({
|
||||
head: [
|
||||
// 配置favicon.ico
|
||||
["link", { rel: "icon", type: "image/x-icon", href: "favicon.ico" }],
|
||||
[
|
||||
"link",
|
||||
{
|
||||
rel: "stylesheet",
|
||||
href: "https://fonts.font.im/css?family=Cousine:400,400i,700,700i|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i",
|
||||
},
|
||||
],
|
||||
["script", { src: "https://cdn.liteyuki.org/js/liteyuki_footer.js" }],
|
||||
],
|
||||
rewrites: {
|
||||
[`${defaultLocale}/:rest*`]: ":rest*",
|
||||
},
|
||||
cleanUrls: false,
|
||||
themeConfig: {
|
||||
logo: {
|
||||
light: "https://cdn.liteyuki.org/logos/bot.svg",
|
||||
dark: "https://cdn.liteyuki.org/logos/bot.svg",
|
||||
alt: "LiteyukiBot Logo",
|
||||
},
|
||||
sidebar: generateSidebar([...generateSidebarConfig()]),
|
||||
socialLinks: [
|
||||
{ icon: "github", link: "https://github.com/LiteyukiStudio/LiteyukiBot" },
|
||||
{
|
||||
icon: {
|
||||
svg: '<svg t="1725391346807" class="icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5067" width="256" height="256"><path d="M1004.692673 466.396616l-447.094409-447.073929c-25.743103-25.763582-67.501405-25.763582-93.264987 0l-103.873521 103.873521 78.171378 78.171378c12.533635-6.00058 26.562294-9.359266 41.389666-9.359266 53.02219 0 96.00928 42.98709 96.00928 96.00928 0 14.827372-3.358686 28.856031-9.359266 41.389666l127.97824 127.97824c12.533635-6.00058 26.562294-9.359266 41.389666-9.359266 53.02219 0 96.00928 42.98709 96.00928 96.00928s-42.98709 96.00928-96.00928 96.00928-96.00928-42.98709-96.00928-96.00928c0-14.827372 3.358686-28.856031 9.359266-41.389666l-127.97824-127.97824c-3.051489 1.454065-6.184898 2.744293-9.379746 3.870681l0 266.97461c37.273227 13.188988 63.99936 48.721433 63.99936 90.520695 0 53.02219-42.98709 96.00928-96.00928 96.00928s-96.00928-42.98709-96.00928-96.00928c0-41.799262 26.726133-77.331707 63.99936-90.520695l0-266.97461c-37.273227-13.188988-63.99936-48.721433-63.99936-90.520695 0-14.827372 3.358686-28.856031 9.359266-41.389666l-78.171378-78.171378-295.892081 295.871601c-25.743103 25.784062-25.743103 67.542365 0 93.285467l447.114889 447.073929c25.743103 25.743103 67.480925 25.743103 93.264987 0l445.00547-445.00547c25.763582-25.763582 25.763582-67.542365 0-93.285467z" fill="#a2d8f4" p-id="5068"></path></svg>',
|
||||
},
|
||||
link: "https://git.liteyuki.org/bot/app",
|
||||
},
|
||||
{
|
||||
icon: {
|
||||
svg: '<svg t="1736700504329" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="14158" width="200" height="200"><path d="M944.355556 142.222222c-17.066667-22.755556-45.511111-34.133333-79.644445-34.133333-28.444444 0-68.266667 5.688889-108.088889 22.755555h-5.688889c17.066667 11.377778 34.133333 28.444444 51.2 39.822223 56.888889-17.066667 91.022222-11.377778 96.711111 0 11.377778 11.377778 5.688889 45.511111-22.755555 91.022222 11.377778 17.066667 17.066667 34.133333 28.444444 51.2 0 0 0 5.688889 5.688889 5.688889 22.755556-34.133333 34.133333-62.577778 45.511111-91.022222 11.377778-28.444444 5.688889-62.577778-11.377777-85.333334z" p-id="14159" fill="#a2d8f4"></path><path d="M267.377778 512a45.511111 45.511111 0 1 0 91.022222 0 45.511111 45.511111 0 1 0-91.022222 0Z" p-id="14160" fill="#a2d8f4"></path><path d="M625.777778 614.4c-113.777778 85.333333-227.555556 153.6-324.266667 193.422222-11.377778 5.688889-17.066667 5.688889-28.444444 11.377778 22.755556 17.066667 51.2 34.133333 79.644444 45.511111 51.2 22.755556 108.088889 34.133333 164.977778 34.133333s113.777778-11.377778 164.977778-34.133333c51.2-22.755556 96.711111-51.2 136.533333-91.022222 39.822222-39.822222 68.266667-85.333333 91.022222-130.844445 22.755556-51.2 34.133333-108.088889 34.133334-159.288888 0-51.2-11.377778-102.4-28.444445-153.6-5.688889 5.688889-11.377778 17.066667-17.066667 22.755555-68.266667 79.644444-164.977778 176.355556-273.066666 261.688889zM813.511111 187.733333c-5.688889-5.688889-11.377778-5.688889-11.377778-11.377777-17.066667-17.066667-34.133333-28.444444-51.2-39.822223-22.755556-11.377778-45.511111-28.444444-68.266666-34.133333-56.888889-28.444444-108.088889-39.822222-164.977778-39.822222s-113.777778 11.377778-164.977778 34.133333c-51.2 22.755556-96.711111 51.2-136.533333 91.022222-39.822222 34.133333-68.266667 79.644444-91.022222 130.844445-22.755556 51.2-34.133333 108.088889-34.133334 159.288889 0 51.2 11.377778 96.711111 22.755556 142.222222-22.755556 34.133333-39.822222 68.266667-51.2 96.711111-11.377778 39.822222-5.688889 68.266667 11.377778 91.022222 17.066667 22.755556 45.511111 34.133333 79.644444 34.133334h11.377778c28.444444 0 62.577778-11.377778 96.711111-22.755556-17.066667-11.377778-34.133333-28.444444-51.2-39.822222-51.2 11.377778-85.333333 11.377778-96.711111 0 0-17.066667 5.688889-45.511111 34.133333-96.711111 17.066667 34.133333 39.822222 62.577778 68.266667 91.022222h5.688889c17.066667-5.688889 39.822222-11.377778 62.577777-17.066667 91.022222-34.133333 204.8-102.4 307.2-187.733333 108.088889-85.333333 199.111111-170.666667 256-250.311111l34.133334-51.2c-22.755556-28.444444-39.822222-56.888889-68.266667-79.644445z m-500.622222 420.977778c-56.888889 0-102.4-45.511111-102.4-102.4s45.511111-102.4 102.4-102.4S409.6 455.111111 409.6 512c0 51.2-45.511111 96.711111-96.711111 96.711111z" p-id="14161" fill="#a2d8f4"></path></svg>',
|
||||
},
|
||||
link: "https://lab.liteyuki.org/@LiteyukiBot",
|
||||
},
|
||||
],
|
||||
search: {
|
||||
provider: "local",
|
||||
options: {
|
||||
locales: {
|
||||
root: {
|
||||
translations: {
|
||||
button: {
|
||||
buttonText: "搜索文档",
|
||||
buttonAriaLabel: "打开搜索框",
|
||||
},
|
||||
modal: {
|
||||
noResultsText: "没有找到搜索结果",
|
||||
resetButtonTitle: "清除查询条件",
|
||||
footer: {
|
||||
selectText: "选择",
|
||||
navigateText: "切换",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
en: {
|
||||
translations: {
|
||||
button: {
|
||||
buttonText: "Search",
|
||||
buttonAriaLabel: "Search",
|
||||
},
|
||||
modal: {
|
||||
noResultsText: "No results found",
|
||||
resetButtonTitle: "Reset search query",
|
||||
footer: {
|
||||
selectText: "Select",
|
||||
navigateText: "Navigate",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
sitemap: {
|
||||
hostname: "https://bot.liteyuki.org",
|
||||
},
|
||||
lastUpdated: true,
|
||||
locales: {
|
||||
root: { label: "简体中文", ...zh },
|
||||
en: { label: "English", ...en },
|
||||
},
|
||||
});
|
35
docs/.vitepress/config/en.ts
Executable file
@ -0,0 +1,35 @@
|
||||
import {defineConfig} from 'vitepress'
|
||||
import {ThemeConfig} from "./utils";
|
||||
|
||||
export const en = defineConfig({
|
||||
lang: "en-US",
|
||||
title: "LiteyukiBot",
|
||||
description: "A high-performance, easy-to-use chatbot framework and application",
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: 'Deploy', link: '/en/deploy/install'},
|
||||
{text: 'Usage', link: '/en/usage/basic'},
|
||||
{text: 'Extension', link: '/en/store/resource'},
|
||||
{text: 'Develop', link: '/en/dev/guide'},
|
||||
],
|
||||
docFooter: {
|
||||
prev: 'Prev Page',
|
||||
next: 'Next Page'
|
||||
},
|
||||
editLink: ThemeConfig.getEditLink(
|
||||
'Edit this page on GitHub',
|
||||
),
|
||||
footer: {
|
||||
message: 'Page is deployed at <a href="https://meli.liteyuki.org" target="_blank">Liteyuki Meli</a> and accelerated by <a href="https://cdn.liteyuki.org" target="_blank">Liteyukiflare</a><br>Documentation built with <a href="https://vitepress.dev/">VitePress</a> | API references generated by <a href="https://github.com/LiteyukiStudio/litedoc">litedoc</a>',
|
||||
copyright: ThemeConfig.copyright
|
||||
},
|
||||
outline: ThemeConfig.getOutLine("Page Content"),
|
||||
|
||||
langMenuLabel: 'Language',
|
||||
returnToTopLabel: 'Back to top',
|
||||
sidebarMenuLabel: 'Menu',
|
||||
darkModeSwitchLabel: 'Theme',
|
||||
lightModeSwitchTitle: 'Light Mode',
|
||||
darkModeSwitchTitle: 'Dark Mode',
|
||||
},
|
||||
})
|
6
docs/.vitepress/config/index.ts
Executable file
@ -0,0 +1,6 @@
|
||||
import {defineConfig} from "vitepress";
|
||||
|
||||
import {common} from './common'
|
||||
export default defineConfig({
|
||||
...common,
|
||||
})
|
40
docs/.vitepress/config/utils.ts
Executable file
@ -0,0 +1,40 @@
|
||||
// 本模块储存一些工具函数和引用
|
||||
|
||||
/**
|
||||
* GetEditLink Options
|
||||
* @param text Edit link text
|
||||
*/
|
||||
export const ThemeConfig = {
|
||||
getEditLink: (editPageText: string): { pattern: (params: { filePath: string; }) => string; text: string; } => {
|
||||
return {
|
||||
pattern: ({filePath}: { filePath: string; }): string => {
|
||||
// 匹配 /dev/api或 /{lang}/dev/api
|
||||
const regex = /^[^\/]+\/dev\/api/;
|
||||
console.log(filePath);
|
||||
if (regex.test(filePath)) {
|
||||
// remove {lang}/api prefix
|
||||
filePath = filePath.replace(regex, '')
|
||||
.replace('index.md', '__init__.py')
|
||||
.replace('.md', '.py');
|
||||
// 若文件名(不含扩展)和上级文件夹相同,返回文件夹/__init__.py
|
||||
if (filePath.split('/').pop().split('.')[0] === filePath.split('/').slice(-2, -1)[0]) {
|
||||
filePath = filePath.split('/').slice(0, -1).join('/') + '/__init__.py';
|
||||
}
|
||||
return `https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki${filePath}`;
|
||||
} else {
|
||||
return `https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/docs/${filePath}`;
|
||||
}
|
||||
},
|
||||
text: editPageText
|
||||
};
|
||||
},
|
||||
|
||||
getOutLine: (label: string): { label: string; level: [number, number]; } => {
|
||||
return {
|
||||
label: label,
|
||||
level: [2, 6]
|
||||
};
|
||||
},
|
||||
|
||||
copyright: 'Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved'
|
||||
}
|
35
docs/.vitepress/config/zh.ts
Executable file
@ -0,0 +1,35 @@
|
||||
import {defineConfig} from 'vitepress'
|
||||
import {ThemeConfig} from "./utils";
|
||||
|
||||
export const zh = defineConfig({
|
||||
lang: "zh-Hans",
|
||||
title: "轻雪机器人",
|
||||
description: "一个综合性的机器人应用及管理框架",
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{text: '部署', link: '/deploy/install'},
|
||||
{text: '使用', link: '/usage/basic'},
|
||||
{text: '扩展', link: '/store/resource'},
|
||||
{text: '开发', link: '/dev/guide'},
|
||||
],
|
||||
docFooter: {
|
||||
prev: '上一页',
|
||||
next: '下一页'
|
||||
},
|
||||
editLink: ThemeConfig.getEditLink(
|
||||
'在 GitHub 上编辑此页',
|
||||
),
|
||||
footer: {
|
||||
message: '网站部署在 <a href="https://meli.liteyuki.org" target="_blank">Liteyuki Meli</a> 由 <a href="https://cdn.liteyuki.org" target="_blank">Liteyukiflare</a> 提供加速服务<br>文档由 <a href="https://vitepress.dev/">VitePress</a> 构建 | API引用由 <a href="https://github.com/LiteyukiStudio/litedoc">litedoc</a> 生成',
|
||||
copyright: ThemeConfig.copyright
|
||||
},
|
||||
outline: ThemeConfig.getOutLine("页面内容"),
|
||||
|
||||
langMenuLabel: '语言',
|
||||
returnToTopLabel: '返回顶部',
|
||||
sidebarMenuLabel: '菜单',
|
||||
darkModeSwitchLabel: '主题',
|
||||
lightModeSwitchTitle: '轻色模式',
|
||||
darkModeSwitchTitle: '深色模式',
|
||||
},
|
||||
})
|
18
docs/.vitepress/theme/index.ts
Executable file
@ -0,0 +1,18 @@
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import './liteyuki.scss'
|
||||
|
||||
import StatsBar from '../../components/StatsBar.vue'
|
||||
import PluginStore from '../../components/PluginStore.vue'
|
||||
import ResStore from '../../components/ResStore.vue'
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
extends: DefaultTheme,
|
||||
enhanceApp({ app }) {
|
||||
app.component('StatsBar', StatsBar);
|
||||
app.component('PluginStore', PluginStore);
|
||||
app.component('ResStore', ResStore);
|
||||
},
|
||||
Layout: StatsBar
|
||||
}
|
149
docs/.vitepress/theme/liteyuki.scss
Executable file
@ -0,0 +1,149 @@
|
||||
:root {
|
||||
--vp-c-brand-1: #149ef8;
|
||||
--vp-c-brand-2: #0434ad;
|
||||
--vp-home-hero-name-color: transparent;
|
||||
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #34a3fe 30%, #8d44ff);
|
||||
|
||||
--vp-home-hero-image-background-image: linear-gradient(-45deg, #d0e9ff 50%, #a2d8f4 50%);
|
||||
--vp-home-hero-image-filter: blur(44px);
|
||||
|
||||
--vp-c-gray-1: #eee;
|
||||
--vp-c-gray-2: #aaa;
|
||||
--border-radius-1: 10px;
|
||||
--border-radius-2: 20px;
|
||||
--border-radius-3: 40px;
|
||||
--vp-font-family-base: 'Poppins', 'Punctuation SC', 'Inter', ui-sans-serif, system-ui,
|
||||
'PingFang SC', 'Noto Sans CJK SC', 'Noto Sans SC', 'Heiti SC',
|
||||
'Microsoft YaHei', 'DengXian', sans-serif, 'Apple Color Emoji',
|
||||
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--vp-font-family-mono: 'Cousine', monospace;
|
||||
|
||||
--red: #ef4444;
|
||||
--liteyuki-color: #149ef8;
|
||||
--button-radius: 6px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.dark {
|
||||
--vp-home-hero-image-background-image: linear-gradient(-45deg, #004785 50%, #0374ad 50%);
|
||||
--vp-c-gray-1: #333;
|
||||
--vp-c-gray-2: #666;
|
||||
}
|
||||
|
||||
.tab-buttons {
|
||||
padding: 7px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
height: 60%;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.tab-title {
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.item-search-box {
|
||||
border-radius: 100px;
|
||||
width: 80%;
|
||||
padding: 10px;
|
||||
margin: 10px 0;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.search-box-div {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.item-search-box {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.item-card {
|
||||
position: relative;
|
||||
border-radius: 15px;
|
||||
background-color: var(--vp-c-gray-1);
|
||||
height: 160px;
|
||||
padding: 16px;
|
||||
margin: 10px;
|
||||
box-sizing: border-box;
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
font-size: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.item-description {
|
||||
color: var(--vp-c-gray-2);
|
||||
font-size: 13px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.author-info {
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.author-name {
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
border-radius: 50%;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
|
||||
/*store*/
|
||||
|
||||
.store-tabs {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.publish-button {
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 10px;
|
||||
background-color: var(--vp-c-brand-1);
|
||||
color: white;
|
||||
font-size: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pub-window {
|
||||
input {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin: 10px 0;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.pub-option {
|
||||
margin: 10px;
|
||||
padding: 5px;
|
||||
border: 2px solid var(--vp-c-gray-1);
|
||||
border-radius: var(--button-radius);
|
||||
background-color: var(--vp-c-gray-1);
|
||||
|
||||
&.close {
|
||||
}
|
||||
|
||||
&.submit {
|
||||
background-color: var(--vp-c-brand-1);
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
import {defineClientConfig} from "vuepress/client";
|
||||
import resourceStoreComp from "./components/res_store.vue";
|
||||
import pluginStoreComp from "./components/plugin_store.vue";
|
||||
//导入element-plus
|
||||
import ElementPlus from 'element-plus';
|
||||
|
||||
export default defineClientConfig({
|
||||
enhance: ({app, router, siteData}) => {
|
||||
app.component("resourceStoreComp", resourceStoreComp);
|
||||
app.component("pluginStoreComp", pluginStoreComp);
|
||||
app.use(ElementPlus);
|
||||
|
||||
},
|
||||
});
|
@ -1,39 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue'
|
||||
import ItemCard from './plugin_item_card.vue'
|
||||
|
||||
// 插件商店Nonebot
|
||||
let items = ref([])
|
||||
fetch('https://registry.nonebot.dev/plugins.json')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
items.value = data
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<h1>插件商店</h1>
|
||||
<p>所有内容来自<a href="https://nonebot.dev/store/plugins">NoneBot插件商店</a>,在此仅作引用,具体请访问NoneBot插件商店</p>
|
||||
<div class="market">
|
||||
<!-- 布局商品-->
|
||||
<ItemCard v-for="item in items" :key="item.id" :item="item"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
h1 {
|
||||
color: #00a6ff;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.market {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
</style>
|
@ -1,38 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue'
|
||||
import ItemCard from './res_item_card.vue'
|
||||
|
||||
// 从public/assets/resources.json加载插件
|
||||
let items = ref([])
|
||||
fetch('https://bot.liteyuki.icu/assets/resources.json')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
items.value = data
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<h1>主题/资源商店</h1>
|
||||
<div class="market">
|
||||
<!-- 布局商品-->
|
||||
<ItemCard v-for="item in items" :key="item.id" :item="item" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
h1 {
|
||||
color: #00a6ff;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.market {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
</style>
|
@ -1,30 +0,0 @@
|
||||
import {defineUserConfig} from "vuepress";
|
||||
import theme from "./theme.js";
|
||||
import viteBundler from "@vuepress/bundler-vite";
|
||||
|
||||
export default defineUserConfig({
|
||||
base: "/",
|
||||
|
||||
lang: "zh-CN",
|
||||
title: "LiteyukiBot 轻雪机器人",
|
||||
description: "LiteyukiBot | 轻雪机器人 | An OneBot Standard ChatBot | 一个OneBot标准的聊天机器人",
|
||||
head: [
|
||||
// 设置 favor.ico,.vuepress/public 下
|
||||
['link', {rel: 'icon', href: 'https://cdn.liteyuki.icu/favicon.ico'},],
|
||||
|
||||
['link', {rel: 'stylesheet', href: 'https://cdn.bootcdn.net/ajax/libs/firacode/6.2.0/fira_code.min.css'}],
|
||||
|
||||
[
|
||||
"meta",
|
||||
{
|
||||
name: "viewport",
|
||||
content: "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no",
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
theme,
|
||||
// 和 PWA 一起启用
|
||||
// shouldPrefetch: false,
|
||||
});
|
@ -1,20 +0,0 @@
|
||||
import {navbar} from "vuepress-theme-hope";
|
||||
|
||||
export default navbar([
|
||||
"/",
|
||||
{
|
||||
text: "项目部署",
|
||||
link: "/deployment/",
|
||||
prefix: "deployment/",
|
||||
},
|
||||
{
|
||||
text: "使用手册",
|
||||
link: "/usage/",
|
||||
prefix: "usage/",
|
||||
},
|
||||
{
|
||||
text: "商店",
|
||||
link: "/store/resource",
|
||||
prefix: "store/",
|
||||
}
|
||||
]);
|
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 9.8 KiB |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" class="icon" viewBox="0 0 1024 1024"><path fill="#FDD7AD" d="M512 0 335.448 88.272l-70.616 35.312-70.624 35.312-176.552 88.28v529.648L512 1024l494.344-247.176V247.176z"/><path fill="#CBB292" d="m759.176 370.76-70.624 35.304-494.344-247.168 70.624-35.312zM512 494.344V1024L17.656 776.824V247.176z"/><path fill="#7F6E5D" d="M1006.344 247.168v529.656L512 1024V494.344l176.552-88.28v70.624l141.24-70.624v-70.616z"/><path fill="#7F5B53" d="M829.792 335.448v70.624L688.56 476.68v-70.624z"/><path fill="#CBB292" d="m829.792 335.448-70.624 35.312-494.344-247.176 70.624-35.312z"/><path fill="#2C3E50" d="m682.52 550.32 157.032-78.512a17.656 17.656 0 0 1 25.552 15.792v9.32a52.96 52.96 0 0 1-29.28 47.376L678.8 622.8a17.656 17.656 0 0 1-25.552-15.792v-9.312a52.96 52.96 0 0 1 29.28-47.376z"/></svg>
|
Before Width: | Height: | Size: 854 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024"><defs><linearGradient id="a" x1="522.593" x2="522.593" y1="-70.302" y2="-335.937" gradientUnits="userSpaceOnUse" spreadMethod="pad"><stop offset="0" stop-color="#fe5d5a" stop-opacity=".1"/><stop offset=".908" stop-color="#ef1220" stop-opacity=".5"/></linearGradient><linearGradient id="b" x1="107.12" x2="935.038" y1="-373.67" y2="-373.67" gradientUnits="userSpaceOnUse" spreadMethod="pad"><stop offset="0" stop-color="#ff5e59"/><stop offset="1" stop-color="#f01422"/></linearGradient><linearGradient id="c" x1="519.405" x2="519.405" y1="-195.547" y2="-726.816" gradientUnits="userSpaceOnUse" spreadMethod="pad"><stop offset="0" stop-color="#ffe2e2"/><stop offset=".888" stop-color="#ff8e8e"/></linearGradient><linearGradient id="d" x1="191.5" x2="483.9" y1="-564.9" y2="-564.9" gradientUnits="userSpaceOnUse" spreadMethod="pad"><stop offset="0" stop-color="#e92700" stop-opacity=".3"/><stop offset=".013" stop-color="#ef1220" stop-opacity=".2"/></linearGradient><linearGradient id="e" x1="403.502" x2="253.121" y1="-847.32" y2="-586.853" gradientUnits="userSpaceOnUse" spreadMethod="pad"><stop offset="0" stop-color="#ff5e59"/><stop offset=".201" stop-color="#f01422"/></linearGradient><linearGradient id="f" x1="330.485" x2="330.485" y1="-801.787" y2="-625.789" gradientUnits="userSpaceOnUse" spreadMethod="pad"><stop offset="0" stop-color="#ff5e59"/><stop offset=".201" stop-color="#f01422"/></linearGradient><linearGradient id="g" x1="397.351" x2="256.845" y1="-647.231" y2="-890.596" gradientUnits="userSpaceOnUse" spreadMethod="pad"><stop offset="0" stop-color="#ffa6a6"/><stop offset=".908" stop-color="#ff6b5d"/></linearGradient></defs><path fill="url(#a)" d="M501.2 662.3 327.6 763.8c-13.9 8.1-14.2 28.1-.5 36.7l179.1 97.7c10.9 5.9 24.1 5.9 34.9-.1l177-97.9c13.6-8.5 13.4-28.3-.3-36.5l-168.4-101c-14.8-9-33.3-9.1-48.2-.4Z"/><path fill="#f63037" d="m110.2 525.7-3.1 77.6 57.5 18.5L184 519.4Z"/><path fill="url(#b)" d="m476.6 363.5-328 154.6c-21 42.7-55.4 65.4-35.5 103.5 4.2 8 9.4 14.4 15.4 18.1l358.2 195.5c21.8 11.9 48.1 11.8 69.8-.2l354-195.8c27.2-16.9 34.8-90.3 7.3-106.8L573 364.1c-29.7-17.8-66.6-18-96.4-.6Z"/><path fill="url(#c)" d="M476.6 298.7 129.4 501.6c-27.8 16.3-28.4 56.3-1 73.3l358.2 195.5c21.8 11.9 48.1 11.8 69.8-.2l354-195.8c27.2-16.9 26.9-56.6-.6-73.1L573 299.3c-29.7-17.8-66.6-18-96.4-.6Z"/><path fill="#ff8989" fill-opacity=".31" d="m481.2 387.8 39.4 123.4c1.1 3.4 4 6 7.6 6.6l173.4 30.4-33-118.3c-.9-3.3-3.6-5.8-7-6.5l-180.4-35.6ZM327 499.2l40.4 101.1L496.7 525c2.5-1.5 3.7-4.5 2.7-7.3l-36-106.8-127.6 65c-8.6 4.3-12.4 14.4-8.8 23.3ZM523.8 540.5l-140.3 77.2L567.2 659c3.2.7 6.6.1 9.3-1.6l134.6-85-174.7-33.8c-4.3-1-8.7-.3-12.6 1.9Z"/><path fill="url(#d)" d="M483.9 406.1c0 35.46-65.46 64.2-146.2 64.2s-146.2-28.74-146.2-64.2c0-35.46 65.46-64.2 146.2-64.2s146.2 28.74 146.2 64.2Z"/><path fill="url(#e)" d="m254.2 188.4-123 83.1c-1.8 1.3-2.6 3.6-1.8 5.7l39.1 110.6c.6 1.7 2 2.9 3.8 3.2l221.8 40.5c1.3.3 2.7-.1 3.7-.8l131.7-93.6c1.9-1.4 2.6-3.9 1.7-6.1l-49.4-107c-.6-1.5-2.1-2.6-3.7-2.8l-220.3-33.5c-1.3-.2-2.6.1-3.6.7Z"/><path fill="url(#f)" d="m528.6 274.5 3 59.1-205 65.6-177.2-72.7-20-49.2 1.9-54.1Z"/><path fill="url(#g)" d="m250.6 138-112.3 76c-6 4.1-8.5 11.7-6.1 18.5l34.2 96.6c1.9 5.4 6.6 9.3 12.1 10.4l211 38.5c4.3.7 8.6-.2 12.1-2.7l120.5-85.5c6.3-4.4 8.4-12.7 5.3-19.7l-43.1-93.5c-2.2-4.9-6.8-8.3-12.1-9.1L262 135.6c-4-.7-8 .2-11.4 2.4Z"/><path fill="#fff" d="m419.8 252.8-79-11-29-57.7c-3.8-7.6-13.2-10.7-20.8-6.9-7.6 3.8-10.7 13.2-6.9 20.8l26.6 52.9-61.8 42.2c-7.1 4.8-8.9 14.5-4.1 21.5 3 4.4 7.9 6.8 12.8 6.8 3 0 6-.9 8.7-2.7l68-46.4 81.1 11.2c.7.1 1.4.1 2.1.1 7.6 0 14.3-5.6 15.3-13.4 1.4-8.4-4.5-16.2-13-17.4Z"/></svg>
|
Before Width: | Height: | Size: 3.6 KiB |
@ -1 +0,0 @@
|
||||
<svg width="98" height="96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#24292f"/></svg>
|
Before Width: | Height: | Size: 963 B |
@ -1 +0,0 @@
|
||||
<svg width="98" height="96" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#fff"/></svg>
|
Before Width: | Height: | Size: 960 B |
Before Width: | Height: | Size: 9.0 KiB |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" class="icon" viewBox="0 0 1536 1024"><path fill="#1296db" d="M1425.067.256H110.933A110.933 110.933 0 0 0 0 110.848v723.627a110.933 110.933 0 0 0 110.933 110.933h1314.39c61.269 0 110.933-49.75 110.677-110.677V110.848A110.933 110.933 0 0 0 1425.067.256z" class="selected" data-spm-anchor-id="a313x.7781069.0.i4"/><path fill="#FFF" d="M664.747 723.797V435.883L517.12 620.373l-147.456-184.49v288l-148.053-67.158V221.781h147.626l147.627 184.576 147.541-184.576h147.627v565.76z"/><path d="M1024 0h426.667A85.333 85.333 0 0 1 1536 85.333v768a85.333 85.333 0 0 1-85.333 85.334H1024V0z" opacity=".1"/><path fill="#FFF" d="m1256.96 731.307-170.667-216.491h113.75V304.64h113.749v210.176h113.835z" opacity=".5"/></svg>
|
Before Width: | Height: | Size: 771 B |
@ -1,39 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "KawaiiStatus",
|
||||
"author": "SnowyKami",
|
||||
"description": "可爱的状态卡片,仿照koishi的制作",
|
||||
"link": "https://cdn.liteyuki.icu/static/lrp/KawaiiStatus.zip",
|
||||
"icon": "https://cdn.jsdelivr.net/gh/SnowyKami/CDN/img/KawaiiStatus.png"
|
||||
},
|
||||
{
|
||||
"name": "MiSans字体包",
|
||||
"author": "SnowyKami",
|
||||
"description": "小米官方字体MiSans",
|
||||
"link": "https://cdn.liteyuki.icu/static/lrp/MiSansFonts.zip"
|
||||
},
|
||||
{
|
||||
"name": "MapleMono字体包",
|
||||
"author": "SnowyKami",
|
||||
"description": "适用于字母的字体包",
|
||||
"link": "https://cdn.liteyuki.icu/static/lrp/MapleMonoFonts.zip"
|
||||
},
|
||||
{
|
||||
"name": "野兽先辈主题HomoTheme",
|
||||
"author": "SnowyKami",
|
||||
"description": "野兽先辈主题包,114514!",
|
||||
"link": "https://cdn.liteyuki.icu/static/lrp/HomoTheme.zip"
|
||||
},
|
||||
{
|
||||
"name": "示例包2",
|
||||
"author": "SnowyKami",
|
||||
"description": "A simple bot that shows the status of the bot and the server.",
|
||||
"link": ""
|
||||
},
|
||||
{
|
||||
"name": "示例包3",
|
||||
"author": "SnowyKami",
|
||||
"description": "A simple bot that shows the status of the bot and the server.",
|
||||
"link": ""
|
||||
}
|
||||
]
|
Before Width: | Height: | Size: 92 KiB |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1200" class="icon" viewBox="0 0 3280.944 2800"><path fill="#41b883" d="M1645.332 601.004h375.675L1081.82 2238.478 142.636 601.004h718.477l220.708 379.704 216.013-379.704z"/><path fill="#41b883" d="M142.636 601.004l939.185 1637.474 939.186-1637.474h-375.675l-563.51 982.484-568.208-982.484z"/><path fill="#35495e" d="M513.188 601.004l568.207 987.23 563.511-987.23h-347.498l-216.013 379.704-220.708-379.704zM1607.792 1311.83l594.678 2.293 187.353-316.325-598.662 2.292zM2198.506 1909.57C2867.436 732.7 2939.502 605.426 2937.874 603.78c-.715-.723 45.303-1.314 102.262-1.314s103.562.428 103.562.951c0 .523-208.57 367.978-463.491 816.567L2216.715 2235.6l-102.1.596-102.102.596z"/><path fill="#41b883" d="M1680.563 2233.328c0-1.34 168.208-298.145 440.375-777.048a4135645.775 4135645.775 0 00337.619-594.19l146.13-257.25 170.746-.04 170.747-.04-5.536 9.741c-3.044 5.358-43.727 77.302-90.407 159.875-85.356 150.992-337.562 595.163-656.602 1156.373l-172 302.559-170.536.588c-93.795.322-170.536.069-170.536-.567z"/><path fill="#35495e" d="M1429.783 1625.351l594.679 2.292 187.353-316.324-598.662 2.292z"/><path fill="#41b883" d="M1524.207 1464.903l608.285 6.877 173.746-320.909h-619.072z"/></svg>
|
Before Width: | Height: | Size: 1.2 KiB |
@ -1,25 +0,0 @@
|
||||
import {sidebar} from "vuepress-theme-hope";
|
||||
|
||||
export default sidebar({
|
||||
"/": [
|
||||
"",
|
||||
{
|
||||
text: "项目部署",
|
||||
icon: "laptop-code",
|
||||
prefix: "deployment/",
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "使用手册",
|
||||
icon: "book",
|
||||
prefix: "usage/",
|
||||
children: "structure",
|
||||
},
|
||||
{
|
||||
text: "商店",
|
||||
icon: "store",
|
||||
prefix: "store/",
|
||||
children: "structure",
|
||||
}
|
||||
],
|
||||
});
|
@ -1,7 +0,0 @@
|
||||
// you can change config here
|
||||
$colors: #c0392b, #d35400, #f39c12, #27ae60, #16a085, #2980b9, #8e44ad, #2c3e50,
|
||||
#7f8c8d !default;
|
||||
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
// place your custom styles here
|
||||
|
||||
#main-title {
|
||||
font-family: ColorTube, "Fira Code", serif;
|
||||
color: #ff0000 !important; /* 你想要的颜色 */
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: ColorTube;
|
||||
src: url("/assets/fonts/ColorTube.woff") format("woff")
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: "Fira Code", monospace !important;
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
// you can change colors here
|
||||
$theme-color: #00a6ff;
|
@ -1,192 +0,0 @@
|
||||
import {hopeTheme} from "vuepress-theme-hope";
|
||||
import navbar from "./navbar.js";
|
||||
import sidebar from "./sidebar.js";
|
||||
|
||||
export default hopeTheme({
|
||||
|
||||
hostname: "https://vuepress-theme-hope-docs-demo.netlify.app",
|
||||
|
||||
author: {
|
||||
name: "远野千束",
|
||||
url: "https://snowykami.me",
|
||||
},
|
||||
|
||||
iconAssets: "fontawesome-with-brands",
|
||||
|
||||
logo: "https://cdn.liteyuki.icu/static/img/liteyuki_icon_640.png",
|
||||
|
||||
repo: "https://github.com/snowykami/LiteyukiBot",
|
||||
|
||||
docsDir: "docs",
|
||||
|
||||
// 导航栏
|
||||
navbar,
|
||||
|
||||
// 侧边栏
|
||||
sidebar,
|
||||
|
||||
// 页脚
|
||||
footer: "LiteyukiBot",
|
||||
displayFooter: true,
|
||||
|
||||
// 加密配置
|
||||
encrypt: {
|
||||
config: {
|
||||
"/demo/encrypt.html": ["1234"],
|
||||
},
|
||||
},
|
||||
|
||||
// 多语言配置
|
||||
metaLocales: {
|
||||
editLink: "在 GitHub 上编辑此页",
|
||||
},
|
||||
|
||||
// 如果想要实时查看任何改变,启用它。注: 这对更新性能有很大负面影响
|
||||
// hotReload: true,
|
||||
|
||||
// 在这里配置主题提供的插件
|
||||
plugins: {
|
||||
search: true,
|
||||
// search: true,
|
||||
comment: {
|
||||
provider: "Giscus",
|
||||
repo: "snowykami/LiteyukiBot",
|
||||
repoId: "R_kgDOHVNKpQ",
|
||||
category: "Announcements",
|
||||
categoryId: "DIC_kwDOHVNKpc4CeWxj",
|
||||
},
|
||||
|
||||
components: {
|
||||
components: ["Badge", "VPCard"],
|
||||
},
|
||||
|
||||
// 此处开启了很多功能用于演示,你应仅保留用到的功能。
|
||||
mdEnhance: {
|
||||
alert: true,
|
||||
align: true,
|
||||
attrs: true,
|
||||
codetabs: true,
|
||||
footnote: true,
|
||||
component: true,
|
||||
demo: true,
|
||||
figure: true,
|
||||
imgLazyload: true,
|
||||
imgSize: true,
|
||||
include: true,
|
||||
mark: true,
|
||||
stylize: [
|
||||
{
|
||||
matcher: "Recommended",
|
||||
replacer: ({tag}) => {
|
||||
if (tag === "em")
|
||||
return {
|
||||
tag: "Badge",
|
||||
attrs: {type: "tip"},
|
||||
content: "Recommended",
|
||||
};
|
||||
},
|
||||
},
|
||||
],
|
||||
sub: true,
|
||||
sup: true,
|
||||
tabs: true,
|
||||
vPre: true,
|
||||
|
||||
|
||||
// 在启用之前安装 chart.js
|
||||
// chart: true,
|
||||
|
||||
// insert component easily
|
||||
|
||||
// 在启用之前安装 echarts
|
||||
// echarts: true,
|
||||
|
||||
// 在启用之前安装 flowchart.ts
|
||||
// flowchart: true,
|
||||
|
||||
// gfm requires mathjax-full to provide tex support
|
||||
// gfm: true,
|
||||
|
||||
// 在启用之前安装 katex
|
||||
// katex: true,
|
||||
|
||||
// 在启用之前安装 mathjax-full
|
||||
// mathjax: true,
|
||||
|
||||
// 在启用之前安装 mermaid
|
||||
// mermaid: true,
|
||||
|
||||
// playground: {
|
||||
// presets: ["ts", "vue"],
|
||||
// },
|
||||
|
||||
// 在启用之前安装 reveal.js
|
||||
// revealJs: {
|
||||
// plugins: ["highlight", "math", "search", "notes", "zoom"],
|
||||
// },
|
||||
|
||||
// 在启用之前安装 @vue/repl
|
||||
// vuePlayground: true,
|
||||
|
||||
// install sandpack-vue3 before enabling it
|
||||
// sandpack: true,
|
||||
},
|
||||
|
||||
// 如果你需要 PWA。安装 @vuepress/plugin-pwa 并取消下方注释
|
||||
// pwa: {
|
||||
// favicon: "/favicon.ico",
|
||||
// cacheHTML: true,
|
||||
// cachePic: true,
|
||||
// appendBase: true,
|
||||
// apple: {
|
||||
// icon: "/assets/icon/apple-icon-152.png",
|
||||
// statusBarColor: "black",
|
||||
// },
|
||||
// msTile: {
|
||||
// image: "/assets/icon/ms-icon-144.png",
|
||||
// color: "#ffffff",
|
||||
// },
|
||||
// manifest: {
|
||||
// icons: [
|
||||
// {
|
||||
// src: "/assets/icon/chrome-mask-512.png",
|
||||
// sizes: "512x512",
|
||||
// purpose: "maskable",
|
||||
// type: "image/png",
|
||||
// },
|
||||
// {
|
||||
// src: "/assets/icon/chrome-mask-192.png",
|
||||
// sizes: "192x192",
|
||||
// purpose: "maskable",
|
||||
// type: "image/png",
|
||||
// },
|
||||
// {
|
||||
// src: "/assets/icon/chrome-512.png",
|
||||
// sizes: "512x512",
|
||||
// type: "image/png",
|
||||
// },
|
||||
// {
|
||||
// src: "/assets/icon/chrome-192.png",
|
||||
// sizes: "192x192",
|
||||
// type: "image/png",
|
||||
// },
|
||||
// ],
|
||||
// shortcuts: [
|
||||
// {
|
||||
// name: "Demo",
|
||||
// short_name: "Demo",
|
||||
// url: "/demo/",
|
||||
// icons: [
|
||||
// {
|
||||
// src: "/assets/icon/guide-maskable.png",
|
||||
// sizes: "192x192",
|
||||
// purpose: "maskable",
|
||||
// type: "image/png",
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
},
|
||||
});
|
100
docs/README.md
@ -1,100 +0,0 @@
|
||||
---
|
||||
home: true
|
||||
icon: home
|
||||
title: 首页
|
||||
heroImage: https://cdn.liteyuki.icu/static/img/logo.png
|
||||
bgImage:
|
||||
bgImageDark:
|
||||
bgImageStyle:
|
||||
background-attachment: fixed
|
||||
heroText: LiteyukiBot
|
||||
tagline: 轻雪机器人,一个以轻量和简洁为设计理念基于Nonebot2的OneBot标准聊天机器人
|
||||
|
||||
actions:
|
||||
- text: 快速部署
|
||||
icon: lightbulb
|
||||
link: ./deployment/install.html
|
||||
type: primary
|
||||
|
||||
- text: 使用手册
|
||||
icon: book
|
||||
link: ./usage/basic_command.html
|
||||
|
||||
highlights:
|
||||
|
||||
- header: 简洁至上
|
||||
image: /assets/image/layout.svg
|
||||
bgImage: https://theme-hope-assets.vuejs.press/bg/2-light.svg
|
||||
bgImageDark: https://theme-hope-assets.vuejs.press/bg/2-dark.svg
|
||||
bgImageStyle:
|
||||
background-repeat: repeat
|
||||
background-size: initial
|
||||
features:
|
||||
- title: 基于Nonebot2
|
||||
icon: robot
|
||||
details: 拥有良好的生态支持
|
||||
link: https://nonebot.dev/
|
||||
|
||||
- title: 可视化插件管理
|
||||
icon: plug
|
||||
details: 使用<code>npm</code>,无需命令行操作即可安装/卸载插件
|
||||
|
||||
- title: 点击交互
|
||||
icon: mouse-pointer
|
||||
details: 新的点击交互模式,拒绝手打指令
|
||||
|
||||
- title: 主题支持
|
||||
icon: paint-brush
|
||||
details: 支持多种主题,可自定义资源包,满足你的审美需求
|
||||
link: https://bot.liteyuki.icu/usage/resource_pack.html
|
||||
|
||||
- title: 国际化
|
||||
icon: globe
|
||||
details: 支持多种语言,包括i18n部分语言和自行扩展的语言代码
|
||||
link: https://baike.baidu.com/item/i18n/6771940
|
||||
|
||||
- title: 简易配置
|
||||
icon: cog
|
||||
details: 无需过多配置,开箱即用
|
||||
link: https://bot.liteyuki.icu/deployment/config.html
|
||||
|
||||
- title: 低占用
|
||||
icon: memory
|
||||
details: 使用更少的依赖和资源
|
||||
|
||||
- title: OneBot标准
|
||||
icon: link
|
||||
details: 支持OneBotv11/12标准的四种通信协议
|
||||
link: https://onebot.dev/
|
||||
|
||||
- title: Alconna命令解析
|
||||
icon: link
|
||||
details: 使用Alconna实现高效命令解析
|
||||
link: https://github.com/nonebot/plugin-alconna
|
||||
|
||||
- title: 便捷更新
|
||||
icon: cloud-download
|
||||
details: 聊天窗口命令更新,无需手动下载
|
||||
|
||||
- title: 服务支持
|
||||
icon: server
|
||||
details: 内置轻雪API,可自动收集错误,提供图床服务
|
||||
|
||||
- title: 开源
|
||||
icon: code
|
||||
details: 项目遵循MIT协议开源,欢迎各位的贡献
|
||||
|
||||
- header: 快速部署
|
||||
image: /assets/image/box.svg
|
||||
bgImage: https://theme-hope-assets.vuejs.press/bg/3-light.svg
|
||||
bgImageDark: https://theme-hope-assets.vuejs.press/bg/3-dark.svg
|
||||
highlights:
|
||||
- title: 安装 Git 和 Python3.10+
|
||||
- title: 使用 <code>git clone https://github.com/snowykami/LiteyukiBot</code> 以克隆项目至本地。
|
||||
details: 如果无法连接到GitHub,可以使用 <code>git clone https://gitee.com/snowykami/LiteyukiBot</code>。
|
||||
- title: 使用 <code>cd LiteyukiBot</code> 切换到项目目录。
|
||||
- title: 使用 <code>pip install -r requirements.txt</code> 安装项目依赖。
|
||||
details: 如果你有多个 Python 环境,请使用 <code>pythonx -m pip install -r requirements.txt</code>。
|
||||
- title: 使用 <code>python main.py</code> 启动项目。
|
||||
copyright: © 2021-2024 SnowyKami All Rights Reserved
|
||||
---
|
26
docs/components/ContributorBar.vue
Executable file
@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import {getTextRef} from "./scripts/i18n";
|
||||
import {repoPath, repoURL} from "./scripts/const";
|
||||
|
||||
const contributorImgSrc = `https://contrib.rocks/image?repo=${repoPath}`
|
||||
const contributorsUrl = `${repoURL}/graphs/contributors`
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="contributor-bar">
|
||||
<h2>{{ getTextRef('thx_contributors') }}</h2>
|
||||
<a :href="contributorsUrl">
|
||||
<div class="contributor-list">
|
||||
<img :src=contributorImgSrc alt="Contributors">
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.contributor-bar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
38
docs/components/Dash.vue
Executable file
@ -0,0 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import {ref} from "vue";
|
||||
|
||||
let total = ref(0);
|
||||
let online = ref(0);
|
||||
fetch("https://api.liteyuki.org/count")
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
total.value = data.register;
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
fetch("https://api.liteyuki.org/online")
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
online.value = data.online;
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="info-box">
|
||||
<h1>Dashboard</h1>
|
||||
<div class="info">
|
||||
<div class="info-item">
|
||||
<h2>Total</h2>
|
||||
<p>{{ total }}</p>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<h2>Online</h2>
|
||||
<p>{{ online }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
20
docs/components/Geo.vue
Executable file
@ -0,0 +1,20 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<div style="text-align: center">
|
||||
<h2>地理分布</h2>
|
||||
<p>数据来源于Liteyuki API</p>
|
||||
</div>
|
||||
<div id="main-chart" style="width: 100%; height: 600px;"></div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
#main-chart {
|
||||
width: 100px;
|
||||
height: 600px;
|
||||
}
|
||||
</style>
|
10
docs/components/Home.vue
Executable file
@ -0,0 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
73
docs/.vuepress/components/plugin_item_card.vue → docs/components/PluginItemCard.vue
Normal file → Executable file
@ -2,16 +2,19 @@
|
||||
<div class="item-card">
|
||||
<div class="item-name">{{ props.item.name }}</div>
|
||||
<div class="item-description">{{ props.item.desc }}</div>
|
||||
<div class="tags">
|
||||
<span class="tag" v-for="tag in props.item.tags" :key="tag" :style=getTagStyle(tag.color)>{{ tag.label }}</span>
|
||||
</div>
|
||||
<div class="item-bar">
|
||||
<!-- 三个可点击svg,一个github,一个下载,一个可点击"https://github.com/{{ username }}.png?size=80"个人头像配上id-->
|
||||
<a :href=props.item.homepage class="btn">
|
||||
<a :href=props.item.homepage class="btn" target="_blank">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16">
|
||||
<path fill="currentColor"
|
||||
d="m7.775 3.275l1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0a.751.751 0 0 1 .018-1.042a.751.751 0 0 1 1.042-.018a1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018a.751.751 0 0 1-.018-1.042m-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018a.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0a.751.751 0 0 1-.018 1.042a.751.751 0 0 1-1.042.018a1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83"/>
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
<!-- <button class="copy-btn btn"><div @click="copyToClipboard">安装</div></button> 点击后把安装命令写入剪贴板-->
|
||||
<!-- <button class="copy-btn btn"><div @click="copyToClipboard">安装</div></button> 点击后把安装命令写入剪贴板-->
|
||||
<button class="btn copy-btn" @click="copyToClipboard">复制安装命令</button>
|
||||
|
||||
<div class="btn">
|
||||
@ -45,22 +48,26 @@ const copyToClipboard = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const getTagStyle = (backgroundColor: string) => {
|
||||
// 将颜色值转换为 RGB 格式
|
||||
const rgb = backgroundColor.replace(/^#/, '');
|
||||
const [r, g, b] = rgb.match(/.{2}/g).map(x => parseInt(x, 16));
|
||||
|
||||
// 计算亮度
|
||||
const brightness = (r * 299 + g * 587 + b * 114) / 1000;
|
||||
|
||||
// 根据亮度决定文字颜色
|
||||
return {
|
||||
backgroundColor: backgroundColor,
|
||||
color: brightness > 128 ? '#000' : '#fff'
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// 复制到剪贴板的函数
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.item-card {
|
||||
position: relative;
|
||||
border-radius: 15px;
|
||||
background-color: #00000011;
|
||||
height: 160px;
|
||||
padding: 16px;
|
||||
margin: 10px;
|
||||
box-sizing: border-box;
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-right: 15px;
|
||||
}
|
||||
@ -75,43 +82,11 @@ button {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.copy-btn:hover {
|
||||
color: #111;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
color: #111;
|
||||
font-size: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.item-description {
|
||||
color: #333;
|
||||
font-size: 12px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
color: $themeColor;
|
||||
}
|
||||
|
||||
.author-info {
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.author-name {
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
border-radius: 50%;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.item-bar {
|
||||
position: absolute;
|
||||
@ -123,4 +98,12 @@ button {
|
||||
justify-content: space-between;
|
||||
color: #00000055;
|
||||
}
|
||||
|
||||
.tag {
|
||||
display: inline-block;
|
||||
padding: 0 5px;
|
||||
margin-right: 5px;
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
91
docs/components/PluginStore.vue
Executable file
@ -0,0 +1,91 @@
|
||||
<script setup lang="ts">
|
||||
import {computed, ref} from 'vue'
|
||||
import ItemCard from './PluginItemCard.vue'
|
||||
import ToggleSwitch from "./ToggleSwitch.vue";
|
||||
import {getTextRef} from "./scripts/i18n";
|
||||
import pluginsJson from "../public/plugins.json"
|
||||
|
||||
let showLiteyukiPluginOnly = ref(false)
|
||||
let filteredItems = computed(() => {
|
||||
let filtered = items.value
|
||||
if (search.value) {
|
||||
filtered = filtered.filter(item =>
|
||||
item.name.toLowerCase().includes(search.value.toLowerCase()) ||
|
||||
item.desc.toLowerCase().includes(search.value.toLowerCase()) ||
|
||||
item.author.toLowerCase().includes(search.value.toLowerCase()) ||
|
||||
item.module_name.toLowerCase().includes(search.value.toLowerCase())
|
||||
)
|
||||
}
|
||||
if (showLiteyukiPluginOnly.value) {
|
||||
filtered = filtered.filter(item => item.is_liteyuki_plugin)
|
||||
}
|
||||
return filtered
|
||||
})
|
||||
// 插件商店Nonebot
|
||||
let items = ref([])
|
||||
let search = ref('')
|
||||
// 从轻雪官方拉取,添加轻雪插件属性
|
||||
items.value = pluginsJson
|
||||
items.value.forEach(item => {
|
||||
item.is_liteyuki_plugin = true
|
||||
})
|
||||
|
||||
//追加
|
||||
fetch('https://registry.nonebot.dev/plugins.json')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// 遍历data的每一项,把is_official设为false
|
||||
data.forEach(item => {
|
||||
item.is_official = false
|
||||
})
|
||||
items.value = items.value.concat(data)
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="market">
|
||||
<h1>{{ getTextRef('pluginStore') }}</h1>
|
||||
<p>{{ getTextRef('pluginStoreDesc') }}</p>
|
||||
<!-- 搜索框-->
|
||||
<div class="search-box-div">
|
||||
<input class="item-search-box" type="text" v-model="search" :placeholder="getTextRef('search')"/>
|
||||
<ToggleSwitch v-model:modelValue="showLiteyukiPluginOnly"/>
|
||||
{{ getTextRef('liteyukiOnly') }}
|
||||
</div>
|
||||
|
||||
<!-- 按钮们-->
|
||||
<!-- <div class="tab">-->
|
||||
<!-- <button @click="open"-->
|
||||
<!-- </div>-->
|
||||
<div class="items">
|
||||
<!-- 使用filteredItems来布局商品 -->
|
||||
<ItemCard v-for="item in filteredItems" :key="item.id" :item="item"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
h1 {
|
||||
color: #00a6ff;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.items {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.search-box-div {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.search-box-div input {
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
40
docs/.vuepress/components/res_item_card.vue → docs/components/ResItemCard.vue
Normal file → Executable file
@ -4,7 +4,7 @@
|
||||
<div class="item-description">{{ props.item.description }}</div>
|
||||
<div class="item-bar">
|
||||
<!-- 三个可点击svg,一个github,一个下载,一个可点击"https://github.com/{{ username }}.png?size=80"个人头像配上id-->
|
||||
<a :href=props.item.link class="">
|
||||
<a :href=props.item.link class="" target="_blank">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16">
|
||||
<path fill="currentColor"
|
||||
d="m7.775 3.275l1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0a.751.751 0 0 1 .018-1.042a.751.751 0 0 1 1.042-.018a1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018a.751.751 0 0 1-.018-1.042m-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018a.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0a.751.751 0 0 1-.018 1.042a.751.751 0 0 1-1.042.018a1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83"/>
|
||||
@ -28,32 +28,8 @@ const props = defineProps({
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.item-card {
|
||||
position: relative;
|
||||
border-radius: 15px;
|
||||
background-color: #00000011;
|
||||
height: 160px;
|
||||
padding: 16px;
|
||||
margin: 10px;
|
||||
box-sizing: border-box;
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
|
||||
.item-card:hover {
|
||||
border: 2px solid $themeColor;
|
||||
}
|
||||
|
||||
.item-name {
|
||||
color: $themeColor;
|
||||
font-size: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.item-description {
|
||||
color: #333;
|
||||
font-size: 15px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 20px;
|
||||
@ -61,21 +37,9 @@ const props = defineProps({
|
||||
color: $themeColor;
|
||||
}
|
||||
|
||||
.author-info {
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.author-name {
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
border-radius: 50%;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
|
||||
.item-bar {
|
||||
position: absolute;
|
38
docs/components/ResPubWindow.vue
Executable file
@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<div v-if="isVisible" class="floating-window">
|
||||
<div class="window-content">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {defineProps} from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
isVisible: Boolean,
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.floating-window {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.window-content {
|
||||
background: var(--vp-c-gray-1);
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
max-width: 60%;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
</style>
|
105
docs/components/ResStore.vue
Executable file
@ -0,0 +1,105 @@
|
||||
<script setup lang="ts">
|
||||
import {computed, ref} from 'vue'
|
||||
import ItemCard from './ResItemCard.vue'
|
||||
import ResPubWindow from "./ResPubWindow.vue";
|
||||
import {getTextRef, formatLang} from "./scripts/i18n";
|
||||
import {RepoUrl} from "./scripts/statsApi";
|
||||
|
||||
import resourcesJson from "../public/resources.json"
|
||||
import {useData} from "vitepress";
|
||||
// formLan
|
||||
|
||||
// 从public/assets/resources.json加载插件
|
||||
let filteredItems = computed(() => {
|
||||
if (!search.value) {
|
||||
return items.value.reverse()
|
||||
}
|
||||
return items.value.filter(item =>
|
||||
item.name.toLowerCase().includes(search.value.toLowerCase()) ||
|
||||
item.description.toLowerCase().includes(search.value.toLowerCase()) ||
|
||||
item.author.toLowerCase().includes(search.value.toLowerCase())
|
||||
).reverse()
|
||||
})
|
||||
// 插件商店Nonebot
|
||||
let items = ref([])
|
||||
let search = ref('')
|
||||
items.value = resourcesJson
|
||||
// 列表倒序
|
||||
|
||||
const isPublishWindowOpen = ref(false)
|
||||
|
||||
let newRes = ref({
|
||||
name: '',
|
||||
})
|
||||
|
||||
function openPublishWindow() {
|
||||
isPublishWindowOpen.value = true
|
||||
}
|
||||
|
||||
function closePublishWindow() {
|
||||
isPublishWindowOpen.value = false
|
||||
}
|
||||
|
||||
let submitLang = ""
|
||||
if (formatLang(useData().site.value.lang) === "zh") {
|
||||
submitLang = "zh"
|
||||
} else {
|
||||
submitLang = "en"
|
||||
}
|
||||
|
||||
function submitForm() {
|
||||
const title = encodeURI(`Resource: ${newRes.value.name}`)
|
||||
const issueURL = `${RepoUrl}/issues/new?assignees=&labels=Resource&template=resource_publish_${submitLang}.yml&title=${title}`
|
||||
console.log(issueURL)
|
||||
window.open(issueURL, '_blank')
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="market">
|
||||
<h1>{{ getTextRef('resourceStore') }}</h1>
|
||||
<div class="search-box-div"><input class="item-search-box" type="text" :placeholder="getTextRef('search')"
|
||||
v-model="search"/></div>
|
||||
<div class="store-tabs" style="display: flex">
|
||||
<button class="store-button publish-button" @click="openPublishWindow">{{ getTextRef('publishRes') }}</button>
|
||||
</div>
|
||||
<div class="items">
|
||||
<!-- 使用filteredItems来布局商品 -->
|
||||
<ItemCard v-for="item in filteredItems" :key="item.id" :item="item"/>
|
||||
</div>
|
||||
<ResPubWindow class="pub-window" :is-visible="isPublishWindowOpen">
|
||||
<h2>{{ getTextRef("publishRes") }}</h2>
|
||||
<form @submit.prevent="submitForm">
|
||||
<label for="name">{{ getTextRef("resName") }}</label>
|
||||
<input type="text" id="name" v-model="newRes.name" :placeholder="getTextRef('resNameText')"/>
|
||||
<div class="pub-options" style="display: flex; justify-content: center">
|
||||
<button class="pub-option close" type="button" @click="closePublishWindow">{{
|
||||
getTextRef("closeButtonText")
|
||||
}}
|
||||
</button>
|
||||
<button class="pub-option submit" type="submit" @click="submitForm">{{
|
||||
getTextRef("submitButtonText")
|
||||
}}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</ResPubWindow>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
h1 {
|
||||
color: #00a6ff;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.items {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
301
docs/components/StatsBar.vue
Executable file
@ -0,0 +1,301 @@
|
||||
<script setup lang="ts">
|
||||
import DefaultTheme from "vitepress/theme";
|
||||
import {ref, onMounted, onUnmounted} from "vue";
|
||||
import {statsApi, GithubStats, RepoUrl, StarMapUrl, uploadVisitRecord} from "./scripts/statsApi";
|
||||
import {getTextRef, updateRefData} from "./scripts/i18n";
|
||||
import {onBeforeRouteUpdate} from 'vue-router';
|
||||
|
||||
const {Layout} = DefaultTheme;
|
||||
|
||||
let githubStats: GithubStats | null = null;
|
||||
|
||||
const dataSections = {
|
||||
total: {
|
||||
name: 'total',
|
||||
color: '#00a6ff',
|
||||
value: ref(-1),
|
||||
link: StarMapUrl
|
||||
},
|
||||
online: {
|
||||
name: 'online',
|
||||
color: '#7eff7e',
|
||||
value: ref(-1),
|
||||
link: StarMapUrl
|
||||
},
|
||||
stars: {
|
||||
name: 'stars',
|
||||
color: '#ffcc00',
|
||||
value: ref(-1),
|
||||
link: `${RepoUrl}/stargazers`
|
||||
},
|
||||
forks: {
|
||||
name: 'forks',
|
||||
color: '#ff6600',
|
||||
value: ref(-1),
|
||||
link: `${RepoUrl}/forks`
|
||||
},
|
||||
issues: {
|
||||
name: 'issues',
|
||||
color: '#ff0000',
|
||||
value: ref(-1),
|
||||
link: `${RepoUrl}/issues`
|
||||
},
|
||||
prs: {
|
||||
name: 'prs',
|
||||
color: '#f15df1',
|
||||
value: ref(-1),
|
||||
link: `${RepoUrl}/pulls`
|
||||
},
|
||||
plugins: {
|
||||
name: 'plugins',
|
||||
color: '#a766ff',
|
||||
value: ref(-1),
|
||||
link: './store/plugin'
|
||||
},
|
||||
resources: {
|
||||
name: 'resources',
|
||||
color: '#5a54fa',
|
||||
value: ref(-1),
|
||||
link: './store/resource'
|
||||
},
|
||||
visitors: {
|
||||
name: 'visitors',
|
||||
color: '#00a6ff',
|
||||
value: ref(-1),
|
||||
link: RepoUrl
|
||||
},
|
||||
}
|
||||
|
||||
async function updateData() {
|
||||
// dataSections.online.value.value = await statsApi.getOnline();
|
||||
// dataSections.total.value.value = await statsApi.getTotal();
|
||||
[
|
||||
dataSections.online.value.value,
|
||||
dataSections.total.value.value,
|
||||
dataSections.plugins.value.value,
|
||||
dataSections.resources.value.value,
|
||||
dataSections.visitors.value.value,
|
||||
githubStats,
|
||||
|
||||
] = await Promise.all([
|
||||
statsApi.getOnline(),
|
||||
statsApi.getTotal(),
|
||||
statsApi.getPluginNum(),
|
||||
statsApi.getResourceNum(),
|
||||
statsApi.getVisitCount(),
|
||||
statsApi.getGithubStats(),
|
||||
]);
|
||||
dataSections.stars.value.value = githubStats?.stars || 0;
|
||||
dataSections.forks.value.value = githubStats?.forks || 0;
|
||||
dataSections.issues.value.value = githubStats?.issues || 0;
|
||||
dataSections.prs.value.value = githubStats?.prs || 0;
|
||||
}
|
||||
|
||||
function formatNumber(num: { value: number }): string {
|
||||
return num.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
const intervalId = setInterval(updateData, 10000);
|
||||
updateData();
|
||||
uploadVisitRecord();
|
||||
onUnmounted(() => {
|
||||
clearInterval(intervalId);
|
||||
});
|
||||
});
|
||||
|
||||
onBeforeRouteUpdate(() => {
|
||||
updateRefData();
|
||||
});
|
||||
|
||||
console.log(
|
||||
" _ _ _ _ _ ____ _ \n" +
|
||||
" | | (_) | | | (_) _ \\ | | \n" +
|
||||
" | | _| |_ ___ _ _ _ _| | ___| |_) | ___ | |_ \n" +
|
||||
" | | | | __/ _ \\ | | | | | | |/ / | _ < / _ \\| __|\n" +
|
||||
" | |____| | || __/ |_| | |_| | <| | |_) | (_) | |_ \n" +
|
||||
" |______|_|\\__\\___|\\__, |\\__,_|_|\\_\\_|____/ \\___/ \\__|\n" +
|
||||
" __/ | \n" +
|
||||
" |___/ "
|
||||
)
|
||||
|
||||
console.log(
|
||||
getTextRef('easterEgg')
|
||||
)
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Layout>
|
||||
<template #home-features-before>
|
||||
<div class="stats-bar-content">
|
||||
<div class="stats-bar">
|
||||
<div class="stats-info">
|
||||
<div class="stats-title">{{ getTextRef('stats') }}</div>
|
||||
<div class="sections">
|
||||
<div v-for="section in Object.values(dataSections)" :key="section.name" class="section">
|
||||
<a :href="section.link" target="_blank">
|
||||
<div class="section-tab">
|
||||
<span class="dot" :style="{backgroundColor: section.color}"></span>
|
||||
<span class="text">{{ getTextRef(section.name) }}</span>
|
||||
</div>
|
||||
<div class="number">{{ formatNumber(section.value) }}</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="starmap">
|
||||
<iframe src="https://starmap.liteyuki.org/" width="100%" height="300px" class="gamma">
|
||||
</iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.stats-bar-content {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.gamma {
|
||||
filter: brightness(1.8);
|
||||
}
|
||||
|
||||
.dark .gamma {
|
||||
filter: brightness(1.0);
|
||||
}
|
||||
|
||||
.stats-bar {
|
||||
width: 80%;
|
||||
max-width: 1150px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20px;
|
||||
margin: 10px;
|
||||
border-radius: var(--border-radius-2);
|
||||
background-color: var(--vp-c-gray-1);
|
||||
flex-direction: column; /* 默认纵向布局 */
|
||||
}
|
||||
|
||||
.stats-info{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.stats-title {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sections {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
|
||||
gap: 15px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative; /* 使伪元素相对于父元素定位 */
|
||||
border-radius: var(--border-radius-2);
|
||||
}
|
||||
|
||||
.section::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border: 0 solid transparent; /* 初始边框为透明 */
|
||||
transition: border 0.1s ease-in-out; /* 添加过渡效果 */
|
||||
border-radius: var(--border-radius-2);
|
||||
pointer-events: none; /* 确保伪元素不会阻挡点击事件 */
|
||||
}
|
||||
|
||||
.section:hover::before {
|
||||
border: 1px solid #00a6ff; /* 悬停时添加边框 */
|
||||
border-radius: var(--border-radius-2);
|
||||
}
|
||||
|
||||
.section-tab {
|
||||
margin-left: 15px;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center; /* 确保垂直居中 */
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.number {
|
||||
font-size: 27px;
|
||||
font-weight: bold;
|
||||
margin-top: 5px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.starmap {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
overflow: hidden;
|
||||
border-radius: var(--border-radius-2);
|
||||
}
|
||||
|
||||
.starmap iframe {
|
||||
position: absolute;
|
||||
top: -150px; /* 根据需要调整裁剪位置 */
|
||||
left: -40px; /* 根据需要调整裁剪位置 */;
|
||||
width: calc(100% + 80px); /* 根据需要调整裁剪宽度 */
|
||||
height: calc(100% + 300px); /* 根据需要调整裁剪高度 */
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
/* PC模式下的样式 */
|
||||
.stats-bar {
|
||||
flex-direction: row;
|
||||
margin: 30px;
|
||||
}
|
||||
|
||||
.stats-info {
|
||||
width: 40%;
|
||||
margin: 10px 30px 30px 30px;
|
||||
}
|
||||
|
||||
.starmap {
|
||||
width: 60%;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.starmap iframe {
|
||||
position: absolute;
|
||||
top: -130px; /* 根据需要调整裁剪位置 */
|
||||
left: -60px; /* 根据需要调整裁剪位置 */;
|
||||
width: calc(100% + 120px); /* 根据需要调整裁剪宽度 */
|
||||
height: calc(100% + 280px); /* 根据需要调整裁剪高度 */
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
0
liteyuki/utils/base/__init__.py → docs/components/Tabs.vue
Normal file → Executable file
67
docs/components/ToggleSwitch.vue
Executable file
@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<label class="switch">
|
||||
<input type="checkbox" :checked="modelValue" @change="updateValue($event.target.checked)">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps, defineEmits } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: Boolean
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const updateValue = (value: boolean) => {
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 60px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
transition: .4s;
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 26px;
|
||||
width: 26px;
|
||||
left: 4px;
|
||||
bottom: 4px;
|
||||
background-color: white;
|
||||
transition: .4s;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: #2196F3;
|
||||
}
|
||||
|
||||
input:checked + .slider:before {
|
||||
transform: translateX(26px); /* 调整为 26px 以确保对齐 */
|
||||
}
|
||||
</style>
|
11
docs/components/TryLiteyukiWindow.vue
Executable file
@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
4
docs/components/scripts/const.ts
Executable file
@ -0,0 +1,4 @@
|
||||
export const platformBaseURL = "https://github.com/"
|
||||
export const repoPath = "LiteyukiStudio/LiteyukiBot"
|
||||
|
||||
export const repoURL = `${platformBaseURL}${repoPath}`
|
112
docs/components/scripts/i18n.ts
Executable file
@ -0,0 +1,112 @@
|
||||
import {ref} from "vue";
|
||||
|
||||
import {useData} from "vitepress";
|
||||
|
||||
const i18nData = {
|
||||
en: {
|
||||
stats: 'Stats',
|
||||
online: 'Online',
|
||||
offline: 'Offline',
|
||||
total: 'Total',
|
||||
fetching: 'Fetching',
|
||||
stars: 'Stars',
|
||||
forks: 'Forks',
|
||||
issues: 'Issues',
|
||||
prs: 'Pull Requests',
|
||||
visitors: 'Visitors',
|
||||
size: 'Size',
|
||||
plugins: 'Plugins',
|
||||
resources: 'Resources',
|
||||
pluginStore: 'Plugin Store',
|
||||
pluginStoreDesc: 'Content from the LightSnow Plugin Store, LightSnow supports NoneBot through the lpnonebot plugin, and references some NoneBot plugins',
|
||||
liteyukiOnly: 'Liteyuki Only',
|
||||
search: 'Search',
|
||||
resourceStore: 'Resources Store',
|
||||
thx_contributors: 'Thanks the following contributors!',
|
||||
easterEgg: 'Congratulations on finding the Easter egg!',
|
||||
|
||||
publishPlugin: 'Publish Plugin',
|
||||
publishRes: 'Publish Resource',
|
||||
closeButtonText: 'Close',
|
||||
submitButtonText: 'Submit',
|
||||
|
||||
resName: 'Name',
|
||||
resDesc: 'Description',
|
||||
resAuthor: 'Author',
|
||||
resLink: 'Download Link',
|
||||
resHomepage: 'Homepage',
|
||||
|
||||
resNameText: 'Example: Kawaii Style Theme',
|
||||
resDescText: 'Example: A kawaii style and color theme',
|
||||
resAuthorText: 'Usually the github username, Example: yanyongyu',
|
||||
resLinkText: 'Direct download link, usually zip package link',
|
||||
resHomepageText: 'Optional, can be the name of the git platform repository"',
|
||||
},
|
||||
zh: {
|
||||
stats: '统计信息',
|
||||
online: '在线',
|
||||
offline: '离线',
|
||||
total: '实例',
|
||||
fetching: '获取中',
|
||||
stars: '星星',
|
||||
forks: '分叉',
|
||||
issues: '议题',
|
||||
prs: '拉取请求',
|
||||
visitors: '访客',
|
||||
size: '大小',
|
||||
plugins: '插件',
|
||||
resources: '主题资源',
|
||||
store: '商店',
|
||||
pluginStore: '插件商店',
|
||||
pluginStoreDesc: '内容来自轻雪插件商店,轻雪通过lpnonebot插件对NoneBot实现支持,引用了部分NoneBot插件',
|
||||
liteyukiOnly: '仅轻雪',
|
||||
search: '搜索',
|
||||
resourceStore: '资源商店',
|
||||
thx_contributors: '感谢以下贡献者!',
|
||||
easterEgg: '恭喜你发现了彩蛋!',
|
||||
|
||||
publishPlugin: '发布插件',
|
||||
publishRes: '发布资源',
|
||||
closeButtonText: '关闭',
|
||||
submitButtonText: '提交',
|
||||
|
||||
resName: '名称',
|
||||
resDesc: '描述',
|
||||
resAuthor: '作者',
|
||||
resLink: '下载链接',
|
||||
resHomepage: '主页',
|
||||
|
||||
resNameText: '示例:可爱风格主题',
|
||||
resDescText: '示例:一个可爱风格和配色的主题',
|
||||
resAuthorText: '通常为github用户名,示例:yanyongyu',
|
||||
resLinkText: '直接下载链接,通常为zip包链接',
|
||||
resHomepageText: '可选,可为git平台仓库名',
|
||||
}
|
||||
}
|
||||
|
||||
let refData = {}
|
||||
|
||||
function getText(lang: string, key: string): string {
|
||||
lang = formatLang(lang);
|
||||
return i18nData[lang][key];
|
||||
}
|
||||
|
||||
export function formatLang(lang: string): string {
|
||||
if (lang.includes('-')) {
|
||||
return lang.split('-')[0];
|
||||
}
|
||||
return lang;
|
||||
}
|
||||
|
||||
export function updateRefData() {
|
||||
const lang = formatLang(useData().site.value.lang);
|
||||
for (let key in refData) {
|
||||
refData[key].value = getText(lang, key);
|
||||
}
|
||||
}
|
||||
|
||||
export function getTextRef(key: string): any {
|
||||
const lang = formatLang(useData().site.value.lang);
|
||||
refData[key] = getText(lang, key);
|
||||
return refData[key] || key;
|
||||
}
|
182
docs/components/scripts/statsApi.ts
Executable file
@ -0,0 +1,182 @@
|
||||
// URL
|
||||
export const OWNER = "LiteyukiStudio"
|
||||
export const REPO = "LiteyukiBot"
|
||||
const githubAPIUrl = "https://api.github.com"
|
||||
const giteaAPIUrl = "https://git.liteyuki.org/api/v1"
|
||||
const onlineFetchUrl = "https://api.liteyuki.org/online";
|
||||
const totalFetchUrl = "https://api.liteyuki.org/count";
|
||||
const visitRecordUrl = "https://api.liteyuki.org/visit";
|
||||
const visitCountUrl = "https://api.liteyuki.org/visit_count";
|
||||
|
||||
export const RepoUrl = `https://github.com/${OWNER}/${REPO}`
|
||||
export const StarMapUrl = "https://starmap.liteyuki.org"
|
||||
|
||||
type GithubStats = {
|
||||
stars: number;
|
||||
forks: number;
|
||||
watchers: number;
|
||||
issues?: number;
|
||||
prs?: number;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
// 异步接口
|
||||
interface StatsApi {
|
||||
getTotal: () => Promise<number>;
|
||||
getOnline: () => Promise<number>;
|
||||
getGithubStats: () => Promise<GithubStats>;
|
||||
getPluginNum: () => Promise<number>;
|
||||
getResourceNum: () => Promise<number>;
|
||||
getVisitCount: () => Promise<number>;
|
||||
}
|
||||
|
||||
|
||||
export type {GithubStats};
|
||||
|
||||
async function getGiteaStats() {
|
||||
try {
|
||||
const url = `${giteaAPIUrl}/repos/${OWNER}/${REPO}`;
|
||||
console.log(url);
|
||||
const res = await fetch(url);
|
||||
const data = await res.json();
|
||||
return {
|
||||
stars: data.stars_count,
|
||||
forks: data.forks_count,
|
||||
watchers: data.watchers_count,
|
||||
issues: 0,
|
||||
prs: 0,
|
||||
size: data.size,
|
||||
};
|
||||
} catch (e) {
|
||||
return {
|
||||
stars: -1,
|
||||
forks: -1,
|
||||
watchers: -1,
|
||||
issues: -1,
|
||||
prs: -1,
|
||||
size: -1,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async function getGithubStats() {
|
||||
try {
|
||||
const res = await fetch(`${githubAPIUrl}/repos/${OWNER}/${REPO}`);
|
||||
const data = await res.json();
|
||||
return {
|
||||
stars: data.stargazers_count,
|
||||
forks: data.forks_count,
|
||||
watchers: data.watchers_count,
|
||||
issues: data.open_issues_count,
|
||||
prs: data.open_issues_count,
|
||||
size: data.size,
|
||||
};
|
||||
} catch (e) {
|
||||
return {
|
||||
stars: -1,
|
||||
forks: -1,
|
||||
watchers: -1,
|
||||
issues: -1,
|
||||
prs: -1,
|
||||
size: -1,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async function getRepoStats() {
|
||||
// 两个接口各数据,加和返回
|
||||
const githubStats = await getGithubStats();
|
||||
const giteaStats = await getGiteaStats();
|
||||
return {
|
||||
stars: githubStats.stars + giteaStats.stars,
|
||||
forks: githubStats.forks + giteaStats.forks,
|
||||
watchers: githubStats.watchers + giteaStats.watchers,
|
||||
issues: githubStats.issues + giteaStats.issues,
|
||||
prs: githubStats.prs + giteaStats.prs,
|
||||
size: githubStats.size + giteaStats.size,
|
||||
};
|
||||
}
|
||||
|
||||
// 实现接口
|
||||
export const statsApi: StatsApi = {
|
||||
getTotal: async () => {
|
||||
try {
|
||||
const res = await fetch(totalFetchUrl);
|
||||
const data = await res.json();
|
||||
return data.register;
|
||||
} catch (e) {
|
||||
return -1;
|
||||
}
|
||||
},
|
||||
getOnline: async () => {
|
||||
try {
|
||||
const res = await fetch(onlineFetchUrl);
|
||||
const data = await res.json();
|
||||
return data.online;
|
||||
} catch (e) {
|
||||
return -1;
|
||||
}
|
||||
},
|
||||
getGithubStats: getRepoStats,
|
||||
getPluginNum: async () => {
|
||||
try {
|
||||
const res = await fetch('/plugins.json');
|
||||
const data = await res.json();
|
||||
return data.length;
|
||||
} catch (e) {
|
||||
return -1;
|
||||
}
|
||||
},
|
||||
getResourceNum: async () => {
|
||||
try {
|
||||
const res = await fetch('/resources.json');
|
||||
const data = await res.json();
|
||||
return data.length;
|
||||
} catch (e) {
|
||||
return -1;
|
||||
}
|
||||
},
|
||||
getVisitCount: async () => {
|
||||
try {
|
||||
const res = await fetch(visitCountUrl);
|
||||
const data = await res.json();
|
||||
return data.count;
|
||||
} catch (e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function getDeviceId(): string {
|
||||
// 用户每次访问时生成一个唯一的设备ID,储存在localStorage中,用于统计用户数量
|
||||
const deviceIdKey = 'deviceId';
|
||||
let deviceId = localStorage.getItem(deviceIdKey);
|
||||
|
||||
if (!deviceId) {
|
||||
deviceId = generateUUID();
|
||||
localStorage.setItem(deviceIdKey, deviceId);
|
||||
}
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
export async function uploadVisitRecord() {
|
||||
const deviceId = getDeviceId();
|
||||
try {
|
||||
await fetch(visitRecordUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
body: new URLSearchParams({'device_id': deviceId}).toString(),
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('Failed to upload visit record:', e);
|
||||
}
|
||||
}
|
||||
|
||||
function generateUUID(): string {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
var r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
---
|
||||
title: 项目部署
|
||||
index: false
|
||||
icon: laptop-code
|
||||
category: 部署
|
||||
---
|
||||
|
||||
<Catalog />
|
@ -1,61 +0,0 @@
|
||||
---
|
||||
title: 配置
|
||||
icon: cog
|
||||
order: 2
|
||||
category: 使用指南
|
||||
tag:
|
||||
- 配置
|
||||
- 部署
|
||||
---
|
||||
|
||||
首次运行后生成`config.yml`,你可以修改配置项后重启轻雪,绝大多数情况下,你只需要修改`superusers`和`nickname`字段即可
|
||||
|
||||
## **基础配置项**
|
||||
|
||||
```yaml
|
||||
command_start: [ "/", "" ] # 指令前缀,若没有""空命令头,请开启alconna_use_command_start保证alconna解析正常
|
||||
host: 127.0.0.1 # 监听地址,默认为本机,若要接收外部请求请填写0.0.0.0
|
||||
port: 20216 # 绑定端口
|
||||
nickname: [ "liteyuki" ] # 机器人昵称列表
|
||||
superusers: [ "1919810" ] # 超级用户列表
|
||||
```
|
||||
|
||||
## **其他配置**
|
||||
|
||||
以下为默认值,如需自定义请手动添加
|
||||
|
||||
```yaml
|
||||
onebot_access_token: "" # 访问令牌,对公开放时建议设置
|
||||
default_language: "zh-CN" # 默认语言
|
||||
alconna_auto_completion: false # alconna是否自动补全指令,默认false,建议开启
|
||||
# 开发者选项
|
||||
log_level: "INFO" # 日志等级
|
||||
log_icon: true # 是否显示日志等级图标(某些控制台字体不可用)
|
||||
auto_report: true # 是否自动上报问题给轻雪服务器
|
||||
auto_update: true # 是否自动更新轻雪,每天4点检查更新
|
||||
debug: false # 轻雪调试,开启后在调试时修改代码或资源会自动重载相应内容
|
||||
safe_mode: false # 安全模式,开启后将不会加载任何第三方插件
|
||||
# 其他Nonebot插件的配置项
|
||||
custom_config_1: "custom_value1"
|
||||
custom_config_2: "custom_value2"
|
||||
...
|
||||
```
|
||||
|
||||
> [!tip]
|
||||
> 如果要使用dotenv配置文件,请自行创建`.env.{ENVIRONMENT}`,并在`config.yml`中添加`environment:{ENVIRONMENT}`字段
|
||||
|
||||
## **OneBot实现端配置**
|
||||
|
||||
生产环境中推荐反向WebSocket
|
||||
不同的实现端给出的字段可能不同,但是基本上都是一样的,这里给出一个参考值
|
||||
|
||||
| 字段 | 参考值 | 说明 |
|
||||
|-------------|------------------------------------|----------------------------------|
|
||||
| 协议 | 反向WebSocket | 推荐使用反向ws协议进行通信,即轻雪作为服务端 |
|
||||
| 地址 | ws://127.0.0.1:20216/onebot/v11/ws | 地址取决于配置文件,本机默认为`127.0.0.1:20216` |
|
||||
| AccessToken | `""` | 如果你给轻雪配置了`AccessToken`,请在此填写相同的值 |
|
||||
|
||||
## **其他**
|
||||
|
||||
- 要使用其他通信方式请访问[OneBot Adapter](https://onebot.adapters.nonebot.dev/)获取详细信息
|
||||
- 轻雪不局限于OneBot适配器,你可以使用NoneBot2支持的任何适配器
|
@ -1,58 +0,0 @@
|
||||
---
|
||||
title: 答疑
|
||||
icon: question
|
||||
order: 3
|
||||
category: 使用指南
|
||||
tag:
|
||||
- 配置
|
||||
- 部署
|
||||
---
|
||||
|
||||
## **常见问题**
|
||||
|
||||
- 设备上Python环境太乱了,pip和python不对应怎么办?
|
||||
- 请使用`/path/to/python -m pip install -r requirements.txt`来安装依赖,
|
||||
然后用`/path/to/python main.py`来启动Bot,
|
||||
其中`/path/to/python`是你要用来运行Bot的可执行文件
|
||||
|
||||
- 为什么我启动后机器人没有反应?
|
||||
- 请检查配置文件的`command_start`或`superusers`,确认你有权限使用命令并按照正确的命令发送
|
||||
- 确认命令头没有和`nickname{}`冲突,例如一个命令是`help`,但是`Bot`昵称有一个`help`,那么将会被解析为nickname而不是命令
|
||||
|
||||
- 更新轻雪失败,报错`InvalidGitRepositoryError`
|
||||
- 请正确安装`Git`,并使用克隆而非直接下载的方式部署轻雪
|
||||
|
||||
- 怎么登录聊天平台,例如QQ?
|
||||
- 你有这个问题说明你不是很了解这个项目,本项目不负责实现登录功能,只负责处理和回应消息,登录功能由实现端(协议端)提供,
|
||||
实现端本身不负责处理响应逻辑,将消息按照OneBot标准处理好上报给轻雪
|
||||
你需要使用Onebot标准的实现端来连接到轻雪并将消息上报给轻雪,下面已经列出一些推荐的实现端
|
||||
- `Playwright`安装失败
|
||||
- 输入`playwright install`安装浏览器
|
||||
- 有的插件安装后报错无法启动
|
||||
- 请先查阅插件文档,确认插件必要配置项完好后,仍然出现问题,请联系插件作者或在安全模式`safe_mode: true`下启动轻雪,在安全模式下你可以使用`npm uninstall`卸载问题插件
|
||||
- 其他问题
|
||||
-
|
||||
加入QQ群[775840726](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=SzmDYbfR6jY94o9KFNon7AwelRyI6M_u&authKey=ygeBdEmdFNyCWuNR4w0M1M8%2B5oDg7k%2FDfN0tzBkYcnbB%2FGHNnlVEnCIGbdftsnn7&noverify=0&group_code=775840726)
|
||||
|
||||
## **推荐方案(QQ)**
|
||||
|
||||
1. [Lagrange.OneBot](https://github.com/KonataDev/Lagrange.Core),基于NTQQ的OneBot实现,目前Markdown消息支持Lagrange
|
||||
2. [LLOneBot](https://github.com/LLOneBot/LLOneBot),NTQQ的OneBot插件,需要安装NTQQ
|
||||
3. [OpenShamrock](https://github.com/whitechi73/OpenShamrock),基于Lsposed的OneBot11实现
|
||||
4. [TRSS-Yunzai](https://github.com/TimeRainStarSky/Yunzai),基于`node.js`,可使用`ws-plugin`进行通信
|
||||
5. [go-cqhttp](https://github.com/Mrs4s/go-cqhttp),`go`语言实现的OneBot11实现端,目前可用性较低
|
||||
6. [Gensokyo](https://github.com/Hoshinonyaruko/Gensokyo),基于 OneBot QQ官方机器人Api Golang 原生实现,需要官方机器人权限
|
||||
7. 人工实现的`Onebot`协议,自己整一个WebSocket客户端,看着QQ的消息,然后给轻雪传输数据
|
||||
|
||||
## **推荐方案(Minecraft)**
|
||||
|
||||
1. [MinecraftOneBot](https://github.com/snowykami/MinecraftOnebot),我们专门为Minecraft开发的服务器Bot,支持OneBotV11标准
|
||||
|
||||
使用其他项目连接请先自行查阅文档,若有困难请联系对应开发者而不是Liteyuki的开发者
|
||||
|
||||
## **鸣谢**
|
||||
|
||||
- [Nonebot2](https://nonebot.dev)提供的框架支持
|
||||
- [nonebot-plugin-htmlrender](https://github.com/kexue-z/nonebot-plugin-htmlrender/tree/master)提供的渲染功能
|
||||
- [nonebot-plugin-alconna](https://github.com/ArcletProject/nonebot-plugin-alconna)提供的命令解析功能
|
||||
- [MiSans](https://hyperos.mi.com/font/zh/),[MapleMono](https://gitee.com/mirrors/Maple-Mono)提供的字体,且遵守了相关字体开源协议
|
@ -1,50 +0,0 @@
|
||||
---
|
||||
title: 安装
|
||||
icon: download
|
||||
order: 1
|
||||
category: 使用指南
|
||||
tag:
|
||||
- 安装
|
||||
---
|
||||
|
||||
|
||||
|
||||
## **开始安装**
|
||||
### **常规方法**
|
||||
1. 安装 [`Git`](https://git-scm.com/download/) 和 [`Python3.10+`](https://www.python.org/downloads/release/python-31010/) 环境
|
||||
2. 克隆项目 `git clone https://github.com/snowykami/LiteyukiBot`
|
||||
3. 进入轻雪目录 `cd LiteyukiBot`
|
||||
4. 安装依赖 `pip install -r requirements.txt`
|
||||
5. 启动 `python main.py`
|
||||
|
||||
### **使用Docker(测试中)**
|
||||
1. 安装 [`Docker`](https://docs.docker.com/get-docker/)
|
||||
2. 克隆项目 `git clone https://github.com/snowykami/LiteyukiBot`
|
||||
3. 进入轻雪目录 `cd LiteyukiBot`
|
||||
4. 构建镜像 `docker build -t liteyukibot .`
|
||||
5. 启动容器 `docker run -p 20216:20216 -v $(pwd):/liteyukibot -v $(pwd)/.cache:/root/.cache liteyukibot`
|
||||
|
||||
|
||||
> [!tip]
|
||||
> Windows请使用项目绝对目录`/path/to/LiteyukiBot`代替`$(pwd)` <br>
|
||||
> 若你修改了端口号请将`20216:20216`中的`20216`替换为你的端口号
|
||||
|
||||
## **设备要求**
|
||||
- Windows系统版本最低`Windows10+`/`Windows Server 2019+`
|
||||
- Linux系统要支持Python3.10+,推荐`Ubuntu 20.04+`(~~别用你那b CentOS~~)
|
||||
- CPU: 至少`1vCPU`
|
||||
- 内存: Bot无其他插件会占用`200~300MB`,其他插件占用视具体插件而定,建议`1GB`以上
|
||||
- 硬盘: 至少`1GB`空间
|
||||
|
||||
> [!warning]
|
||||
> 如果设备上有多个环境,请使用`path/to/python -m pip install -r requirements.txt`来安装依赖,`path/to/python`为你的Python可执行文件路径
|
||||
|
||||
> [!tip]
|
||||
> 推荐使用虚拟环境来运行轻雪,以避免依赖冲突,你可以使用`python -m venv venv`来创建虚拟环境,然后使用`venv\Scripts\activate`来激活虚拟环境
|
||||
|
||||
> [!warning]
|
||||
> 轻雪的更新功能依赖Git,如果你没有安装Git,你将无法使用更新功能
|
||||
|
||||
#### 其他问题请移步至[答疑](/deployment/fandq)
|
||||
|
||||
[//]: # (#### 想在Linux命令行中拥有更好的体验?试试[TRSS_Liteyuki轻雪机器人管理脚本](https://timerainstarsky.github.io/TRSS_Liteyuki/),该功能仅供参考,不是LiteyukiBot官方提供的功能)
|
77
docs/en/deploy/config.md
Executable file
@ -0,0 +1,77 @@
|
||||
---
|
||||
title: Configurations
|
||||
order: 2
|
||||
---
|
||||
|
||||
# Configurations
|
||||
|
||||
LiteyukiBot supports `yaml`, `json`, and `toml` as configuration files, depending on your personal preference.
|
||||
|
||||
When you first run LiteyukiBot, it will generate `config.yml` and the `config` directory. You can modify the configuration items and restart LiteyukiBot. In most cases, you only need to modify
|
||||
the `superusers` and `nickname` fields.
|
||||
|
||||
When starting, LiteyukiBot will load all configuration files in the project directory `config.yml/yaml/json/toml` and the `config` directory. You can create multiple configuration files in
|
||||
the `config` directory, and LiteyukiBot will automatically merge these configuration files.
|
||||
|
||||
## **Basic Configuration**
|
||||
|
||||
```yaml
|
||||
# NoneBot configuration
|
||||
nonebot:
|
||||
command_start: [ "/", "" ] # Command prefix, if there is no "" empty command header, please enable alconna_use_command_start to ensure alconna parsing is normal
|
||||
host: 127.0.0.1 # Listening address, default is local, if you want to receive external requests, please fill in
|
||||
port: 20216 # Binding port
|
||||
nickname: [ "liteyuki" ] # Bot nickname list
|
||||
superusers: [ "1919810" ] # Superuser list
|
||||
liteyuki:
|
||||
log_level: "INFO" # Log level
|
||||
log_icon: true # Whether to display the log level icon (some console fonts are not available)
|
||||
auto_report: true # Whether to automatically report problems to Liteyuki server
|
||||
auto_update: true # Whether to automatically update Liteyuki, check for updates at 4 am every day
|
||||
plugins: [ ] # Liteyuki plugin list
|
||||
plugin_dirs: [ ] # Liteyuki plugin directory list
|
||||
```
|
||||
|
||||
## **Other configurations**
|
||||
|
||||
The following is the default value. If you need to customize it, please add it manually
|
||||
|
||||
```yaml
|
||||
# Advanced configuration
|
||||
nonebot:
|
||||
onebot_access_token: "" # OneBot access token
|
||||
default_language: "zh-CN" # Default language
|
||||
alconna_auto_completion: false # alconna auto completion
|
||||
safe_mode: false # Safe mode, if true, the bot will not load any plugins
|
||||
# other nonebot configurations
|
||||
custom_config_1: "custom_value1"
|
||||
custom_config_2: "custom_value2"
|
||||
|
||||
# development configuration
|
||||
liteyuki:
|
||||
allow_update: true # Whether to allow Liteyuki to update
|
||||
debug: false # Debug mode, if true, Liteyuki will output more detailed logs
|
||||
dev_mode: false # development mode, if true, Liteyuki will load all plugins in the development directory
|
||||
...
|
||||
```
|
||||
|
||||
```yaml
|
||||
|
||||
```
|
||||
|
||||
## **Example: Configuration of OneBot implementation side connected to NoneBot**
|
||||
|
||||
In production environments, it is recommended to use reverse WebSocket
|
||||
The fields provided by different implementation sides may be different, but basically the same. Here is a reference value
|
||||
|
||||
| Fields | Value | Description |
|
||||
|-------------|------------------------------------|---------------------------------------------------------------------------------------|
|
||||
| protocol | Reverse WebSocket | Liteyuki-NoneBot as server |
|
||||
| address | ws://127.0.0.1:20216/onebot/v11/ws | The address depends on the configuration file, the default is ` |
|
||||
| AccessToken | `""` | If you have configured `AccessToken` for Liteyuki, please fill in the same value here |
|
||||
|
||||
- To use other communication methods, please visit [OneBot Adapter](https://onebot.adapters.nonebot.dev/) for detailed information
|
||||
|
||||
## **Other**
|
||||
|
||||
- Liteyuki is not limited to the OneBot adapter and NoneBot2. You can use any adapter supported by NoneBot2 or use the Liteyuki message delivery plugin
|
30
docs/en/deploy/fandq.md
Executable file
@ -0,0 +1,30 @@
|
||||
---
|
||||
title: FAQ
|
||||
order: 3
|
||||
---
|
||||
# FAQ
|
||||
|
||||
## **Frequently Asked Questions**
|
||||
|
||||
- There are too many python interpreters on my computer, how do I know which one to use?
|
||||
- You can specify which python interpreter to use by using the full path to the python executable, for example, `/path/to/python main.py`
|
||||
- Use virtual environments to avoid conflicts between different python interpreters
|
||||
|
||||
- Update Liteyuki failed, error `InvalidGitRepositoryError`
|
||||
- Please install `Git` correctly and deploy Liteyuki using cloning instead of direct download
|
||||
|
||||
- How to log in to chat platforms?
|
||||
- Some plugins provide the ability to log in to specific platforms, for example, using the NoneBot plugin to log in to supported adapter platforms
|
||||
|
||||
- `Playwright` installation failed
|
||||
- Enter `playwright install` to install the browser
|
||||
|
||||
- Some plugins report errors after installation and cannot be started
|
||||
- Please refer to the plugin documentation first, confirm that the necessary configuration items of the plugin are intact,
|
||||
and if the problem persists, please contact the plugin author or start Liteyuki in safe mode `safe_mode: true`.
|
||||
In safe mode, you can use `npm uninstall` to uninstall problematic plugins
|
||||
|
||||
## Other questions
|
||||
|
||||
- Join chat group[775840726](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=SzmDYbfR6jY94o9KFNon7AwelRyI6M_u&authKey=ygeBdEmdFNyCWuNR4w0M1M8%2B5oDg7k%2FDfN0tzBkYcnbB%2FGHNnlVEnCIGbdftsnn7&noverify=0&group_code=775840726)
|
||||
- If you don't have a QQ account, you can [submit an issue on GitHub](https://github.com/LiteyukiStudio/LiteyukiBot/issues/new?assignees=&labels=&projects=&template=%E9%97%AE%E9%A2%98%E5%8F%8D%E9%A6%88.md&title=)
|
62
docs/en/deploy/install.md
Executable file
@ -0,0 +1,62 @@
|
||||
---
|
||||
title: Install
|
||||
order: 1
|
||||
---
|
||||
# Install
|
||||
|
||||
## **Normal Installation**
|
||||
|
||||
1. Install [`Git`](https://git-scm.com/download/) and [`Python3.10+`](https://www.python.org/downloads/release/python-31010/) Environment.
|
||||
|
||||
```bash
|
||||
# Clone Repo
|
||||
git clone https://github.com/LiteyukiStudio/LiteyukiBot --depth=1
|
||||
|
||||
# Change directory
|
||||
cd LiteyukiBot
|
||||
|
||||
# Create virtual environment
|
||||
python -m venv venv
|
||||
|
||||
# Activate virtual environment
|
||||
.\venv\Scripts\activate # Windows
|
||||
source venv/bin/activate # Linux
|
||||
|
||||
# Install dependencies
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Run Liteyuki
|
||||
python main.py
|
||||
```
|
||||
|
||||
> [!tip]
|
||||
> It is recommended to use a virtual environment to run Liteyuki to avoid dependency conflicts.
|
||||
> You can use `python -m venv .venv` to create a virtual environment, and then use `.venv\Scripts\activate` to activate the virtual environment
|
||||
> (use `source .venv/bin/activate` to activate on Linux).
|
||||
|
||||
|
||||
## **Run with Docker**
|
||||
|
||||
```bash
|
||||
docker pull ghcr.io/liteyukistudio/liteyukibot:latest # Nightly build
|
||||
```
|
||||
|
||||
> [!tip]
|
||||
> If you are using Windows, please use the absolute project directory `/path/to/LiteyukiBot` instead of `$(pwd)` <br>
|
||||
> If you have modified the port number, please replace `20216:20216` with your port number
|
||||
|
||||
|
||||
## **Device Requirements**
|
||||
- Windows system version minimum `Windows10+`/`Windows Server 2019+`
|
||||
- Linux system requires Python3.10+, recommended `Ubuntu 20.04+`
|
||||
- CPU: at least `1vCPU`
|
||||
- Memory: Bot without other plugins will occupy `300~500MB`, including `chromium` and `node` processes, other plugins depend on specific plugins, recommended `1GB` or more
|
||||
- Disk: at least `1GB` of space
|
||||
|
||||
> [!warning]
|
||||
> If there are multiple environments on the device, please use `path/to/python -m pip install -r requirements.txt` to install dependencies, `path/to/python` is the path to your Python executable
|
||||
|
||||
> [!warning]
|
||||
> Liteyuki's update function depends on Git. If you do not have Git installed and run the source code directly, you will not be able to use the update function
|
||||
|
||||
#### For other questions, please refer to [FAQ](./fandq)
|
21
docs/en/dev/best_practices.md
Executable file
@ -0,0 +1,21 @@
|
||||
---
|
||||
title: Best Practices
|
||||
order: 10
|
||||
---
|
||||
|
||||
# Best Practices
|
||||
|
||||
## Bot applications
|
||||
- [LiteyukiBot](https://github.com/LiteyukiStudio/LiteyukiBot): Liteyuki Official Bot
|
||||
- [LiteyukiBot-TriM](https://github.com/TriM-Organization/LiteyukiBot-TriM): TriM Official Custom Liteyuki Bot
|
||||
- [Liteyuki Marsho](https://git.liteyuki.org/LiteyukiStudio/marsho-alpha): A cute cat girl bot based on Liteyuki and the github model
|
||||
|
||||
## plugins
|
||||
- [liteyukibot-plugin-nonebot](https://github.com/LiteyukiStudio/liteyukibot-plugin-nonebot): Liteyuki Bot NoneBot plugin, allowing Liteyuki to support NoneBot
|
||||
- [nonebot-plugin-liteyukibot](https://github.com/LiteyukiStudio/nonebot-plugin-liteyukibot): NoneBot plugin, allowing NoneBot to support Liteyuki
|
||||
|
||||
## Others
|
||||
- [liteyuki starmap](https://starmap.liteyuki.org): Liteyuki official star map, showing all instances of Liteyuki and their location distribution
|
||||
- [TRSS_Liteyuki](https://timerainstarsky.github.io/TRSS_Liteyuki/): LiteyukiBot management script
|
||||
- [litedoc](https://github.com/LiteyukiStudio/litedoc): Liteyuki API documentation generator
|
||||
- liteyukibot-api (closed source): Liteyuki Bot stat interface
|
98
docs/en/dev/comm.md
Executable file
@ -0,0 +1,98 @@
|
||||
---
|
||||
title: Process Communication
|
||||
order: 4
|
||||
---
|
||||
|
||||
# **Channel Communication**
|
||||
|
||||
### Introduction
|
||||
|
||||
LiteyukiBot is running in the main process MainProcess, and other plugin framework processes are child processes that come with it.
|
||||
Therefore, it is impossible to communicate through shared memory and direct object transfer.
|
||||
Liteyuki provides a channel [`Channel`](./api/comm/channel#class-channel-generic-t) for inter-process communication like `go`.
|
||||
You can send messages to other processes through [`Channel`](./api/comm/channel#class-channel-generic-t) and listen to messages from other processes.
|
||||
|
||||
### Example
|
||||
|
||||
The channel is full-duplex, with two receiving modes, but only one mode can be used for a channel, that is, passive mode and active mode, passive mode is implemented by the `chan.on_receive()` decorator callback function, and active mode needs to call `chan.receive()` to implement
|
||||
|
||||
- 创建子进程的同时会初始化一个被动通道和一个主动通道,且通道标识为`{process_name}-active`和`{process_name}-passive`,
|
||||
- 主进程中通过`get_channel`函数获取通道对象
|
||||
- 子进程中导入单例`active_channel`及`passive_channel`即可
|
||||
|
||||
> 在轻雪插件中(主进程中)
|
||||
|
||||
```python
|
||||
import asyncio
|
||||
|
||||
from liteyuki.comm import get_channel, Channel
|
||||
from liteyuki import get_bot
|
||||
|
||||
# get_channel函数获取通道对象,参数为调用set_channel时的通道标识
|
||||
channel_passive = get_channel("nonebot-passive") # 获取被动通道
|
||||
channel_active = get_channel("nonebot-active") # 获取主动通道
|
||||
liteyuki_bot = get_bot()
|
||||
|
||||
|
||||
# 注册一个函数在轻雪启动后运行
|
||||
@liteyuki_bot.on_after_start
|
||||
async def send_data():
|
||||
while True:
|
||||
channel_passive.send("I am liteyuki main process passive")
|
||||
channel_active.send("I am liteyuki main process active")
|
||||
await asyncio.sleep(3) # 每3秒发送一次消息
|
||||
```
|
||||
|
||||
> 在子进程中(例如NoneBot插件中)
|
||||
|
||||
```python
|
||||
from nonebot import get_driver
|
||||
from liteyuki.comm import active_channel, passive_channel # 子进程中获取通道直接导入进程全局单例即可
|
||||
from liteyuki.log import logger
|
||||
|
||||
driver = get_driver()
|
||||
|
||||
|
||||
# 被动模式,通过装饰器注册一个函数在接收到消息时运行,每次接收到字符串数据时都会运行
|
||||
@passive_channel.on_receive(filter_func=lambda data: isinstance(data, str))
|
||||
async def on_passive_receive(data):
|
||||
logger.info(f"Passive receive: {data}")
|
||||
|
||||
|
||||
# 注册一个函数在NoneBot启动后运行
|
||||
@driver.on_startup
|
||||
def on_startup():
|
||||
while True:
|
||||
data = active_channel.receive()
|
||||
logger.info(f"Active receive: {data}")
|
||||
```
|
||||
|
||||
> 启动后控制台输出
|
||||
|
||||
```log
|
||||
0000-00-00 00:00:00 [ℹ️信息] Passive receive: I am liteyuki main process passive
|
||||
0000-00-00 00:00:00 [ℹ️信息] Active receive: I am liteyuki main process active
|
||||
0000-00-00 00:00:03 [ℹ️信息] Passive receive: I am liteyuki main process passive
|
||||
0000-00-00 00:00:03 [ℹ️信息] Active receive: I am liteyuki main process active
|
||||
...
|
||||
```
|
||||
|
||||
## **共享内存通信**
|
||||
|
||||
### 简介
|
||||
|
||||
- 相比于普通进程通信,内存共享使得代码编写更加简洁,轻雪框架提供了一个内存共享通信的接口,你可以通过`storage`模块实现内存共享通信,该模块封装通道实现
|
||||
- 内存共享是线程安全的,你可以在多个线程中读写共享内存,线程锁会自动保护共享内存的读写操作
|
||||
|
||||
### 示例
|
||||
|
||||
> 在任意进程中均可使用
|
||||
|
||||
```python
|
||||
from liteyuki.comm.storage import shared_memory
|
||||
|
||||
shared_memory.set("key", "value") # 设置共享内存
|
||||
value = shared_memory.get("key") # 获取共享内存
|
||||
```
|
||||
|
||||
源代码:[liteyuki/comm/storage.py](https://github.com/LiteyukiStudio/LiteyukiBot/blob/main/liteyuki/comm/storage.py)
|
73
docs/en/dev/guide.md
Executable file
@ -0,0 +1,73 @@
|
||||
---
|
||||
title: Development Guide
|
||||
order: 0
|
||||
---
|
||||
|
||||
<script setup>
|
||||
import ContributorBar from '../../components/ContributorBar.vue'
|
||||
</script>
|
||||
|
||||
|
||||
# Development Guide
|
||||
|
||||
## How to Develop
|
||||
Please read the [Plugin Development](./plugin) and [API Reference](./api/) documents if you are developing a plugin.
|
||||
|
||||
If you need to submit code to the Liteyuki repository, please read the following:
|
||||
1. First [fork](https://github.com/LiteyukiStudio/LiteyukiBot/fork) a copy of the Liteyuki repository to your personal/organization account.
|
||||
2. Develop in your repository.
|
||||
3. Create a new branch in your repository and submit your code to this branch.
|
||||
4. Create a Pull Request in your repository to merge your branch into the `main` branch of the Liteyuki repository.
|
||||
|
||||
- Participation in development assumes that you are already familiar with the basic usage of the Python language and the Liteyuki framework.
|
||||
- If you are developing documentation, please ensure that you are familiar with Markdown syntax and basic front-end knowledge.
|
||||
- Contact the repository maintainer in case of conflicts.
|
||||
|
||||
### Suggestions
|
||||
- During development, you can use tools such as `mypy`, `flake8`, and `black` for code checking and formatting.
|
||||
- Enable developer mode by setting `dev_mode: true` in `config.yml` to see more debugging information in the console.
|
||||
|
||||
## Project Structure
|
||||
- `main.py`: Bot entry file
|
||||
- `liteyuki`: Framework directory (liteyukibot)
|
||||
- `src`: Bot application source code directory
|
||||
- `liteyuki_plugins`: Liteyuki plugin directory
|
||||
- `nonebot_plugins`: Nonebot plugin directory
|
||||
- `resources`: Built-in resource packs directory
|
||||
- `utils`: Utility directory
|
||||
- `tests`: Unit test directory
|
||||
- `docs`: Documentation directory
|
||||
- `en`: English documentation
|
||||
- `zh`: Chinese documentation
|
||||
- `docker`: Docker related content directory
|
||||
|
||||
The `liteyuki` framework is included in the `LiteyukiBot` application, so this project is both the `LiteyukiBot` application repository and the `liteyuki` framework repository.
|
||||
|
||||
The `src` directory is the application part, please develop business logic in this directory. `liteyuki_plugins` and `nonebot_plugins` directories are plugin directories, please develop plugins in these directories.
|
||||
|
||||
|
||||
## Standardization
|
||||
- Code should follow [`PEP8`](https://pep8.org/) and [`Google Python Style Guide`](https://google.github.io/styleguide/pyguide.html).
|
||||
- In addition, code submitted to the Liteyuki repository should follow the following guidelines:
|
||||
- Ensure that the code is runnable and harmless.
|
||||
- Ensure that the type hints in the code are correct.
|
||||
- Ensure that the comment style is [`Google Docstring`](https://google.github.io/styleguide/pyguide.html) or
|
||||
[`Liteyuki Docstring`](https://github.com/LiteyukiStudio/litedoc?tab=readme-ov-file#liteyuki-docstring)(recommended) to ensure that Litedoc can parse and generate documentation correctly.
|
||||
- Strings should be enclosed in double quotes `"` as much as possible, and single quotes `'` should be used when nesting strings.
|
||||
- If there is a part for ordinary users, ensure that the documentation is complete (each language has corresponding documentation).
|
||||
- commit message should follow the following guidelines:
|
||||
- You should commit the code after completing a feature or fixing a bug, and not mix the code of multiple features or bugs together.
|
||||
- We use gitmoji to mark the type of commit, such as `:sparkles:` for introducing new features, `:bug:` for fixing bugs, etc., please refer to [gitmoji](https://gitmoji.dev/) for details.
|
||||
- The format of the commit message is `<emoji> [type:] <message>`, such as `:sparkles: feat: add new field to event`,
|
||||
where the type field is the type of commit, not much is required, but please fill in as much as possible; the message field is a brief description, in summary, what you did.
|
||||
- There is no restriction on the language of the commit message, and bilingual use is possible if conditions permit.
|
||||
- The documentation should follow [`Markdown`](https://www.markdownguide.org/) syntax and support vitepress-related content:
|
||||
- Revise the documentation for each language when editing.
|
||||
- Ensure that the links in the document are correct and do not lead to inaccessible links.
|
||||
- Ensure that the **User Documentation** is easy to understand and the **Development Documentation** is detailed.
|
||||
|
||||
## Finally
|
||||
- This project is a non-profit open-source project, and we welcome anyone to participate in development. Your contributions will make Liteyuki better.
|
||||
|
||||
|
||||
<ContributorBar />
|
72
docs/en/dev/lyfunc.md
Executable file
@ -0,0 +1,72 @@
|
||||
---
|
||||
title: Liteyuki Function
|
||||
order: 2
|
||||
---
|
||||
|
||||
# **轻雪函数**
|
||||
|
||||
轻雪函数 Liteyuki Function 是轻雪的一个功能,它允许你在轻雪中运行一些自定义的由数据驱动的命令,类似于Minecraft的mcfunction,属于资源包的一部分,但需单独起篇幅.
|
||||
|
||||
### **函数文件**
|
||||
|
||||
函数文件放在资源包的`functions`目录下,文件名以`.mcfunction` `.lyfunction` `.lyf`结尾,例如`test.mcfunction`,文件内容为一系列的命令,每行一个命令,支持单行注释`#`(编辑时的语法高亮可采取`shell`格式),例如:
|
||||
|
||||
```shell
|
||||
# 在发信器输出"hello world"
|
||||
cmd echo hello world
|
||||
|
||||
# 如果你想同时输出多行内容可以尝试换行符(Python格式)
|
||||
cmd echo hello world\nLiteyuki bot
|
||||
```
|
||||
|
||||
也支持句末注释,例如:
|
||||
```shell
|
||||
cmd echo hello world # 输出"hello world"
|
||||
```
|
||||
|
||||
### **命令文档**
|
||||
|
||||
```shell
|
||||
var <var1=value1> [var2=value2] ... # 定义变量
|
||||
cmd <command> # 在设备上执行命令
|
||||
api <api_name> [var=value...] # 调用Bot API
|
||||
function <func_name> # 调用函数,可递归
|
||||
sleep <time> # 异步等待,单位s
|
||||
nohup <command> # 使用新的task执行命令,即不等待
|
||||
end # 结束函数关键字,包括子task
|
||||
await # 等待所有异步任务结束,若函数中启动了其他task,需要在最后调用,否则task对象会被销毁
|
||||
```
|
||||
|
||||
|
||||
#### **示例**
|
||||
|
||||
```shell
|
||||
# 疯狂戳好友
|
||||
# 使用 /function poke user_id=123456 执行
|
||||
# 每隔0.2s戳两次,无限戳,会触发最大递归深度限制
|
||||
# 若要戳20s后停止,则需要删除await,添加sleep 20和end
|
||||
api friend_poke user_id=user_id
|
||||
api friend_poke user_id=user_id
|
||||
sleep 0.2
|
||||
nohup function poke
|
||||
await
|
||||
```
|
||||
|
||||
### **API**
|
||||
|
||||
理论上所有基于onebotv11的api都可调用,不同Adapter api也有差别.
|
||||
|
||||
[Onebot v11 API文档](https://283375.github.io/onebot_v11_vitepress/api/index.html)
|
||||
|
||||
### **结束关键字**
|
||||
|
||||
由于LiteyukiBot基于异步运行, 所以在编写lyfunction时也要注意异步的调用,避免出现"单线程走到底"的情况是效率提升的关键.
|
||||
|
||||
`await` 异步任务结束关键字,用于结束当前已完成function的执行
|
||||
|
||||
> [!warning]
|
||||
> 但若出现非单function的情况,有一个task任务没有完成而await被执行了,那么当前所有函数包的task都会被截停销毁
|
||||
|
||||
|
||||
> [!tip]
|
||||
> 编写轻雪函数推荐你使用VS Code插件[Liteyuki Function](https://github.com/LiteyukiStudio/lyfunctionTextmate)实现语法高亮
|
80
docs/en/dev/plugin.md
Executable file
@ -0,0 +1,80 @@
|
||||
---
|
||||
title: Plugin
|
||||
order: 3
|
||||
---
|
||||
|
||||
# 简介
|
||||
|
||||
轻雪插件是轻雪内置的一部分功能,运行在主进程中,可以很高程度地扩展轻雪的功能。
|
||||
|
||||
## 开始
|
||||
|
||||
### 创建插件
|
||||
|
||||
一个`.py`文件或一个包含`__init__.py`的文件夹即可被识别为插件
|
||||
|
||||
首先创建一个文件夹,例如`watchdog_plugin`,并在其中创建一个`__init__.py`文件,即可创建一个插件
|
||||
|
||||
`__init__.py`
|
||||
```python
|
||||
from liteyuki.plugin import PluginMetadata, PluginType
|
||||
from .watch_dog import * # 导入逻辑部分
|
||||
|
||||
# 定义插件元数据
|
||||
__plugin_meta__ = PluginMetadata(
|
||||
name="NoneDog", # 插件名称
|
||||
version="1.0.0", # 插件版本
|
||||
description="A simple plugin for nonebot developer", # 插件描述
|
||||
type=PluginType.SERVICE # 插件类型
|
||||
)
|
||||
|
||||
# 你的插件代码
|
||||
...
|
||||
```
|
||||
|
||||
### 编写逻辑部分
|
||||
|
||||
轻雪主进程不涉及聊天部分,因此插件主要是一些后台任务或者与聊天机器人的通信
|
||||
以下我们会编写一个简单的插件,用于开发NoneBot时进行文件系统变更重载
|
||||
`watch_dog.py`
|
||||
```python
|
||||
import os
|
||||
from liteyuki.dev import observer # 导入文件系统观察器
|
||||
from liteyuki import get_bot, logger # 导入轻雪Bot和日志
|
||||
from watchdog.events import FileSystemEvent # 导入文件系统事件
|
||||
|
||||
liteyuki = get_bot() # 获取唯一的轻雪Bot实例
|
||||
|
||||
exclude_extensions = (".pyc", ".pyo") # 排除的文件扩展名
|
||||
|
||||
|
||||
# 用observer的on_file_system_event装饰器监听文件系统事件
|
||||
@observer.on_file_system_event(
|
||||
directories=("src/nonebot_plugins",),
|
||||
event_filter=lambda event: not event.src_path.endswith(exclude_extensions) and ("__pycache__" not in event.src_path) and os.path.isfile(event.src_path)
|
||||
)
|
||||
def restart_nonebot_process(event: FileSystemEvent):
|
||||
logger.debug(f"File {event.src_path} changed, reloading nonebot...")
|
||||
liteyuki.restart_process("nonebot") # 调用重启进程方法
|
||||
```
|
||||
|
||||
### 加载插件
|
||||
|
||||
#### 方法1
|
||||
|
||||
- 在配置文件中的`liteyuki.plugins`中添加你的插件路径,例如`watchdog_plugin`,重启轻雪即可加载插件。
|
||||
|
||||
#### 方法2
|
||||
|
||||
- 使用开发工具快速运行插件,无需手动创建实例
|
||||
- 创建入口文件,例如`main.py`,并在其中写入以下代码
|
||||
|
||||
```python
|
||||
from liteyuki.dev.plugin import run_plugins
|
||||
|
||||
run_plugins("watchdog_plugin")
|
||||
```
|
||||
|
||||
然后运行`python main.py`即可启动插件
|
||||
|
||||
启用插件后,我们在src/nonebot_plugins下创建一个文件,例如`test.py`,并在其中写入一些代码,保存后轻雪会自动重载NoneBot进程
|
24
docs/usage/resource_pack.md → docs/en/dev/resource.md
Normal file → Executable file
@ -1,20 +1,26 @@
|
||||
---
|
||||
title: 资源包
|
||||
icon: paint-brush
|
||||
order: 3
|
||||
category: 使用手册
|
||||
title: Resource Pack
|
||||
order: 1
|
||||
---
|
||||
|
||||
## 简介
|
||||
# 简介
|
||||
|
||||
资源包,亦可根据用途称为主题包、字体包、语言包等,它允许你一定程度上自定义轻雪的外观,并且不用修改源代码
|
||||
- [资源/主题商店](/store/)提供了一些资源包供你选择,你也可以自己制作资源包
|
||||
|
||||
- [资源/主题商店](../store/resource)提供了一些资源包供你选择,你也可以自己制作资源包
|
||||
- 资源包的制作很简单,如果你接触过`Minecraft`的资源包,那么你能够很快就上手,仅需按照原有路径进行文件替换即可,讲起打包成一个新的资源包。
|
||||
- 部分内容制作需要一点点前端基础,例如`html`,`css`
|
||||
- 轻雪原版资源包请查看`LiteyukiBot/liteyuki/resources`,可以在此基础上进行修改
|
||||
- 欢迎各位投稿资源包到轻雪资源商店
|
||||
|
||||
请注意,主题包中的html渲染使用Js来规定数据的渲染位置,请确保您所编写的html代码能被Bot解析,否则会导致渲染失败或渲染结果不理想/异常/错位等无法预料的事情发生。推荐在编写html时同时更改对应Js代码,以避免出现无法预料的问题。
|
||||
|
||||
---
|
||||
|
||||
## 加载资源包
|
||||
|
||||
- 资源包通常是以`.zip`格式压缩的,只需要将其解压到根目录`resources`目录下即可,注意不要嵌套文件夹,正常的路径应该是这样的
|
||||
|
||||
```shell
|
||||
main.py
|
||||
resources
|
||||
@ -26,8 +32,10 @@ resources
|
||||
├─metadata.yml
|
||||
└─...
|
||||
```
|
||||
|
||||
- 你自己制作的资源包也应该遵循这个规则,并且应该在`metadata.yml`中填写一些信息
|
||||
- 若没有`metadata.yml`文件,则该文件夹不会被识别为资源包
|
||||
|
||||
```yaml
|
||||
name: "资源包名称"
|
||||
version: "1.0.0"
|
||||
@ -35,5 +43,9 @@ description: "资源包描述"
|
||||
# 你可以自定义一些信息,但请保证以上三个字段
|
||||
...
|
||||
```
|
||||
|
||||
- 资源包加载遵循一个优先级,即后加载的资源包会覆盖前面的资源包,例如,你在A包中定义了一个`index.html`文件,B包也定义了一个`index.html`文件,那么加载B包后,A包中的`index.html`文件会被覆盖
|
||||
- 对于不同资源包的不同文件,是可以相对引用的,例如你在A中定义了`templates/index.html`,在B中定义了`templates/style.css`,可以在A的`index.html`中用`./style.css`相对路径引用B中的css
|
||||
|
||||
> [!tip]
|
||||
> 资源包的结构会随着轻雪的更新而有变动,第三方资源包开发者需要注意版本兼容性,同时用户也应该自行选择可用的资源包
|
63
docs/en/index.md
Executable file
@ -0,0 +1,63 @@
|
||||
---
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: "LiteyukiBot"
|
||||
tagline: "An integrated chat bot application and management framework"
|
||||
actions:
|
||||
- theme: brand
|
||||
text: 🚀 Get Started
|
||||
link: ./deploy/install
|
||||
- theme: alt
|
||||
text: 📖 Manual
|
||||
link: ./usage/basic
|
||||
- theme: alt
|
||||
text: 📦 Extensions
|
||||
link: ./store/
|
||||
- theme: alt
|
||||
text: 🛠️ Development
|
||||
link: ./dev/guide
|
||||
image:
|
||||
light: https://cdn.liteyuki.org/logos/bot.svg
|
||||
dark: https://cdn.liteyuki.org/logos/bot.svg
|
||||
alt: Liteyuki Logo
|
||||
|
||||
features:
|
||||
- title: Ecological Diversity
|
||||
icon: 🛠️
|
||||
details: Based on the liteyuki framework, compatible with any Python bot framework and application
|
||||
link: ./dev/api
|
||||
|
||||
- title: Pluggable
|
||||
icon: 🧩
|
||||
details: Use package manager for convenient management of plugins and resource packs
|
||||
link: ./store/plugin
|
||||
|
||||
- title: Customizable
|
||||
icon: 🎨
|
||||
details: Fully customize the appearance using resource packs
|
||||
link: ./store/resource
|
||||
|
||||
- title: Localization
|
||||
icon: 🌐
|
||||
details: Support for multiple languages through resource packs
|
||||
link: https://baike.baidu.com/item/i18n/6771940
|
||||
|
||||
- title: Easy to use
|
||||
icon: ⚙️
|
||||
details: No complicated pre-process, ready to use out of the box
|
||||
link: ./deploy/config
|
||||
|
||||
- title: High Performance
|
||||
icon: 🚀
|
||||
details: 500 plugins, starts within 2 seconds
|
||||
|
||||
- title: Rolling Updates
|
||||
icon: ☁️
|
||||
details: Keep your robot up to date with the latest commits
|
||||
|
||||
- title: Open Source
|
||||
icon: 📄
|
||||
details: The project follows the LSO LICENSE and is open to contributions
|
||||
link: https://github.com/LiteyukiStudio/LiteyukiStudioOpensourceLICENSE
|
||||
---
|
6
docs/en/store/plugin.md
Executable file
@ -0,0 +1,6 @@
|
||||
---
|
||||
title: Plugin Store
|
||||
order: 2
|
||||
---
|
||||
|
||||
<PluginStore />
|
6
docs/en/store/resource.md
Executable file
@ -0,0 +1,6 @@
|
||||
---
|
||||
title: Resource Store
|
||||
order: 1
|
||||
---
|
||||
|
||||
<ResStore />
|
7
docs/usage/agreement.md → docs/en/usage/agreement.md
Normal file → Executable file
@ -1,14 +1,13 @@
|
||||
---
|
||||
title: 用户协议
|
||||
icon: user-secret
|
||||
order: 3
|
||||
category: 使用手册
|
||||
---
|
||||
# 用户协议
|
||||
|
||||
1. 本项目遵循`MIT`协议,你可以自由使用,修改,分发,但是请保留原作者信息
|
||||
2. 你可以选择开启`auto_report`(默认开启),轻雪会收集以下内容
|
||||
- 运行环境的设备信息:CPU,内存,系统信息,Python信息
|
||||
- 插件信息(不含插件数据),
|
||||
- 运行环境的设备信息:CPU,内存,系统信息及Python信息
|
||||
- 插件信息(不含插件数据)
|
||||
- 部分异常信息,
|
||||
- 会话负载信息(不含隐私部分)
|
||||
以上内容仅用于项目的优化,不包含任何隐私信息,且通过安全的方式传输到轻雪的服务器,若你不希望提供这些信息,可以在配置文件中把`auto_report`设定为`false`
|
122
docs/en/usage/basic.md
Executable file
@ -0,0 +1,122 @@
|
||||
---
|
||||
title: 基础插件
|
||||
order: 1
|
||||
---
|
||||
|
||||
# 基础插件
|
||||
---
|
||||
|
||||
> [!tip]
|
||||
> **参数**:`<param>`为必填参数,`[option]`为可选参数。
|
||||
>
|
||||
> **命令别名**:配置了命令别名的命令可以使用别名代替原命令,例如`npm install ~`可以使用`插件 安装 ~`代替。
|
||||
|
||||
## **轻雪命令`liteyuki_command`**
|
||||
|
||||
|
||||
| 命令 | 说明 | 权限 | 举例 | 可用参数 |
|
||||
| :----------------------------------------: | :---------------------------------------------------------------------------------------------: | :----------------------------------------: | :---------------------------------------------------------: | :----------------------------------------------------------------------------------: |
|
||||
| `reload-liteyuki` | 重载轻雪 | 超级用户 | ❌ | ❌ |
|
||||
| `update-liteyuki` | 更新轻雪 | 超级用户 | ❌ | ❌ |
|
||||
| `liteecho` | 查看当前bot 版本 | 超级用户 | ❌ | ❌ |
|
||||
| `status` | 查看统计信息和状态 | 超级用户 | ❌ | ❌ |
|
||||
| `config set <key> value` | 添加配置项,若存在则会覆盖,输入值会被执行以转换为正确的类型,"10"和10是不一样的 | 超级用户 | `config set name 'liteyuki-bot'` | `<key>`: 若存在则覆盖, 若不存在则创建于`config.yml` ; `value`: yml格式的所有合法内容 |
|
||||
| `config get [key] ` | 查询配置项,不带key返回配置项列表,推荐私聊使用 | 超级用户 | `config get name` | `<key>`: 若存在则返回, 若不存在则返回空 |
|
||||
| `switch-image-mode ` | 在普通图片和Markdown大图之间切换,该功能需要commit:505468b及以后的Lagrange.OneBot,默认普通图片 | 超级用户 | `switch-image-mode` | ❌ |
|
||||
| `/api api_name [args] ` | 调用机器人API | 超级用户 | `/api get_group_member_list group_id=1234567` | `<args>`: 参数列表, 格式为onebot v11协议api, 可用%20代替空格 |
|
||||
| `/function function_name [args] [kwargs] ` | 调用机器人函数(`.lyfunction`语法) | 超级用户 | `/function send_group_msg group_id=1234567 message='hello'` | `<args>`和`<kwargs>`: 参数列表, api格式为onebot v11协议api |
|
||||
| group enable/disable [group_id] | 在群聊启用/停用机器人,group_id仅超级用户可用 | 超级用户,群聊仅群主、管理员、超级用户可用 | `group enable 1145141919810` | `<group_id>`: 群号 |
|
||||
| liteyuki-docs | 查看轻雪文档 | 所有人 | ❌ | ❌ |
|
||||
|
||||
|
||||
---
|
||||
### **命令别名**
|
||||
|
||||
|
||||
| 命令 | 别名 |
|
||||
| :---------------: | :----------------------------------: |
|
||||
| status | 状态 |
|
||||
| reload-liteyuki | 重启轻雪 |
|
||||
| update-liteyuki | 更新轻雪 |
|
||||
| reload-resources | 重载资源 |
|
||||
| config | 配置, `set` 设置 / `get` 查询 |
|
||||
| switch-image-mode | 切换图片模式 |
|
||||
| liteyuki-docs | 轻雪文档 |
|
||||
| group | 群聊, `enable` 启用 / `disable` 停用 |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## **插件/包管理器 `liteyuki_pacman`**
|
||||
|
||||
- 插件管理
|
||||
|
||||
| 命令 | 说明 | 权限 |
|
||||
| :-----------------------------------------------------: | :----------------------------------------: | :----------------------------------------------: |
|
||||
| `npm update` | 更新插件商店索引 | 超级用户 |
|
||||
| `npm install <plugin_name>` | 安装插件 | 超级用户 |
|
||||
| `npm uninstall <plugin_name>` | 卸载插件 | 超级用户 |
|
||||
| `npm search <keywords...>` | 通过关键词搜索插件 | 超级用户 |
|
||||
| `npm enable-global/disable-global <plugin_name>` | 全局启用/停用插件 | 超级用户 |
|
||||
| `npm enable/disable <plugin_name> [--group <group_id>]` | 当前会话启用/停用插件 | 群聊仅群主、管理员、超级用户可用,私聊所有人可用 |
|
||||
| `npm list [page] [num]` | 列出所有插件 page为页数,num为每页显示数量 | 群聊仅群主、管理员、超级用户可用,私聊所有人可用 |
|
||||
| `help <plugin_name>` | 查看插件帮助 | 所有人 |
|
||||
|
||||
|
||||
- 资源包管理
|
||||
|
||||
| 命令 | 说明 | 权限 |
|
||||
| :----------------------: | :------------------------------------------: | :------: |
|
||||
| `rpm list [page] [num]` | 列出所有资源包 page为页数,num为每页显示数量 | 超级用户 |
|
||||
| `rpm load <pack_name>` | 加载资源包 | 超级用户 |
|
||||
| `rpm unload <pack_name>` | 卸载资源包 | 超级用户 |
|
||||
| `rpm change <pack_name>` | 修改优先级 | 超级用户 |
|
||||
| `rpm reload` | 重载所有资源包 | 超级用户 |
|
||||
|
||||
|
||||
### 命令别名
|
||||
|
||||
| 命令 | 别名 |
|
||||
| :--------------: | :------: |
|
||||
| `npm` | 插件管理 |
|
||||
| `update` | 更新 |
|
||||
| `install` | 安装 |
|
||||
| `uninstall` | 卸载 |
|
||||
| `search` | 搜索 |
|
||||
| `enable` | 启用 |
|
||||
| `disable` | 停用 |
|
||||
| `enable-global` | 全局启用 |
|
||||
| `disable-global` | 全局停用 |
|
||||
| `rpm` | 资源包 |
|
||||
| `load` | 加载 |
|
||||
| `unload` | 卸载 |
|
||||
| `change` | 更改 |
|
||||
| `reload` | 重载 |
|
||||
| `list` | 列表 |
|
||||
| `help` | 帮助 |
|
||||
|
||||
> [!warning]
|
||||
> 受限于NoneBot2钩子函数的依赖注入参数,插件停用只能阻断传入响应,对于主动推送的插件不生效,请阅读插件主页的说明。
|
||||
>
|
||||
|
||||
---
|
||||
|
||||
|
||||
## **用户管理`liteyuki_user`**
|
||||
|
||||
| 命令 | 说明 | 权限 |
|
||||
| :-------------------------: | :----------------------------: | :----: |
|
||||
| `profile` | 查看用户信息菜单 | 所有人 |
|
||||
| `profile set <key> [value]` | 设置用户信息或打开属性设置菜单 | 所有人 |
|
||||
| `profile get <key>` | 获取用户信息 | 所有人 |
|
||||
|
||||
|
||||
###命令别名
|
||||
|
||||
| 命令 | 别名 |
|
||||
| :-------: | :------: |
|
||||
| `profile` | 个人信息 |
|
||||
| `set` | 设置 |
|
||||
| `get` | 查询 |
|
||||
|
||||
|
68
docs/en/usage/extra.md
Executable file
@ -0,0 +1,68 @@
|
||||
---
|
||||
title: 功能命令
|
||||
order: 2
|
||||
---
|
||||
|
||||
# 功能插件命令
|
||||
|
||||
### **轻雪天气`liteyuki_weather`**
|
||||
|
||||
查询实时天气,支持绑定城市,支持中英文城市名,支持多个关键词查询。
|
||||
|
||||
配置项
|
||||
|
||||
```yaml
|
||||
weather_key: "" # 和风天气的天气key,会自动判断key版本
|
||||
```
|
||||
|
||||
命令
|
||||
|
||||
```shell
|
||||
weather <keywords...> # Keywords为城市名,支持中英文
|
||||
```
|
||||
查询目标地实时天气,例如:"天气 北京 海淀", "weather Tokyo Shinjuku"
|
||||
|
||||
```shell
|
||||
bind-city <keywords...> # Keywords为城市名,支持中英文
|
||||
```
|
||||
|
||||
绑定查询城市,个人全局生效
|
||||
|
||||
#### 命令别名
|
||||
|
||||
| 命令 | 别名 |
|
||||
| :-------: | :------- |
|
||||
| weather | 天气 |
|
||||
| bind-city | 绑定城市 |
|
||||
|
||||
---
|
||||
|
||||
### **统计信息`liteyuki_statistics`**
|
||||
|
||||
统计信息
|
||||
命令
|
||||
|
||||
```shell
|
||||
statistic message --duration <duration> --period <period> --group [current|group_id] --bot [current|bot_id]
|
||||
```
|
||||
|
||||
功能: 用于统计Bot接收到的消息, 统计周期为`period`, 统计时间范围为`duration`
|
||||
|
||||
| 参数 | 格式 |
|
||||
| :------: | :------------------------------------------------------------: |
|
||||
| duration | 使用通用日期简写: `1d`(天), `1h`(小时), `45m`(分钟), `14s`(秒) |
|
||||
| period | 使用通用日期简写: `1d`(天), `1h`(小时), `45m`(分钟), `14s`(秒) |
|
||||
| group | `current` (当前群聊) 或 `group_id` (QQ群号) |
|
||||
| bot | `current` (当前Bot) 或 `bot_id` |
|
||||
|
||||
#### 命令别名
|
||||
|
||||
| 命令 | 别名 |
|
||||
| :----------: | :---: |
|
||||
| `statistic` | stat |
|
||||
| `message` | m |
|
||||
| `--duration` | -d |
|
||||
| --period` | -p |
|
||||
| `--group` | -g |
|
||||
| `--bot` | -b |
|
||||
| `current` | c |
|
106
docs/foolsday.md
@ -1,106 +0,0 @@
|
||||
---
|
||||
home: true
|
||||
icon: home
|
||||
title: 首页
|
||||
heroImage: https://cdn.liteyuki.icu/static/img/logo.png
|
||||
bgImage:
|
||||
bgImageDark:
|
||||
bgImageStyle:
|
||||
background-attachment: fixed
|
||||
heroText: HeavyyukiBot666 # LiteyukiBot 6
|
||||
tagline: 重雪机器人,一个以笨重和复杂为设计理念基于Koishi114514的OneBotv1919810标准聊天机器人,可用于雪地清扫,使用Typethon编写
|
||||
#tagline: 轻雪机器人,一个以轻量和简洁为设计理念基于Nonebot2的OneBot标准聊天机器人
|
||||
|
||||
actions:
|
||||
- text: 快速结束 # 快速开始
|
||||
icon: lightbulb
|
||||
link: ./deployment/install.html
|
||||
type: primary
|
||||
|
||||
- text: 奇怪的册子 # 使用手册
|
||||
icon: book
|
||||
link: ./usage/basic_command.html
|
||||
|
||||
#1. 安装 `Git` 和 `Python3.10+` 环境
|
||||
#2. 克隆项目 `git clone https://github.com/snowykami/LiteyukiBot` (无法连接可以用`https://gitee.com/snowykami/LiteyukiBot`)
|
||||
#3. 切换目录`cd LiteyukiBot`
|
||||
#4. 安装依赖`pip install -r requirements.txt`(如果多个Python环境请指定后安装`pythonx -m pip install -r requirements.txt`)
|
||||
#5. 启动`python main.py`
|
||||
|
||||
highlights:
|
||||
|
||||
- header: 简洁至下 # 简洁至上
|
||||
image: /assets/image/layout.svg
|
||||
bgImage: https://theme-hope-assets.vuejs.press/bg/2-light.svg
|
||||
bgImageDark: https://theme-hope-assets.vuejs.press/bg/2-dark.svg
|
||||
bgImageStyle:
|
||||
background-repeat: repeat
|
||||
background-size: initial
|
||||
features:
|
||||
- title: 基于Koishi.js233
|
||||
icon: robot
|
||||
details: 拥有良好的生态支持
|
||||
link: https://nonebot.dev/
|
||||
|
||||
- title: 盲目插件管理
|
||||
icon: plug
|
||||
details: 基于nbshi使用<code>npmx和pip</code>,让你无法安装/卸载插件
|
||||
|
||||
- title: 点击无法交互
|
||||
icon: mouse-pointer
|
||||
details: 老的的点击交互模式,必须手打指令
|
||||
|
||||
- title: 猪蹄支持
|
||||
icon: paint-brush
|
||||
details: 支持多种主题,可自定义资源包,满足你的审美需求
|
||||
|
||||
- title: 非国际化
|
||||
icon: globe
|
||||
details: 支持多种语言,包括i18n部分语言和自行扩展的语言代码
|
||||
link: https://baike.baidu.com/item/i18n/6771940
|
||||
|
||||
- title: 超难配置
|
||||
icon: cog
|
||||
details: 无需过多配置,开箱即用
|
||||
link: https://bot.liteyuki.icu/deployment/config.html
|
||||
|
||||
- title: 高占用
|
||||
icon: memory
|
||||
details: 使用更多的意义不明的依赖和资源
|
||||
|
||||
- title: 一个Bot标准
|
||||
icon: link
|
||||
details: 支持OneBotv11/12标准的四种通信协议
|
||||
link: https://onebot.dev/
|
||||
|
||||
- title: Alconna
|
||||
icon: link
|
||||
details: 使用Alconna实现低效命令解析
|
||||
link: https://github.com/nonebot/plugin-alconna
|
||||
|
||||
- title: 不准更新
|
||||
icon: cloud-download
|
||||
details: 要更新自己下新版本去
|
||||
|
||||
- title: 服务支持
|
||||
icon: server
|
||||
details: 内置轻雪API,但随时可能跑路
|
||||
|
||||
- title: 闭源
|
||||
icon: code
|
||||
details: 要源代码自己逆向去
|
||||
|
||||
- header: 快速部署
|
||||
image: /assets/image/box.svg
|
||||
bgImage: https://theme-hope-assets.vuejs.press/bg/3-light.svg
|
||||
bgImageDark: https://theme-hope-assets.vuejs.press/bg/3-dark.svg
|
||||
highlights:
|
||||
- title: 安装 Git 和 node.js+
|
||||
- title: 使用 <code>git clone https://github.com/snowykami/LiteyukiBot</code> 以克隆项目至本地。
|
||||
details: 如果无法连接到GitHub,可以使用 <code>git clone https://gitee.com/snowykami/LiteyukiBot</code>。
|
||||
- title: 使用 <code>cd LiteyukiBot</code> 切换到项目目录。
|
||||
- title: 使用 <code>npm install -r requirements.txt</code> 安装项目依赖。
|
||||
details: 如果你有多个 node.js 环境,请使用 <code>pythonx -m npm install -r requirements.txt</code>。
|
||||
- title: 使用 <code>node main.py</code> 启动项目。
|
||||
copyright: © 2021-2024 SnowyKami All Rights Reserved
|
||||
---
|