1
0
forked from bot/app
LiteyukiBot/docs/README.md

123 lines
4.3 KiB
Markdown
Raw Normal View History

2024-03-28 10:50:19 +08:00
---
home: true
icon: home
2024-03-28 11:12:55 +08:00
title: 首页
2024-06-19 12:15:22 +08:00
heroImage: https://cdn.liteyuki.icu/static/svg/lylogo-full.svg
2024-06-19 23:31:11 +08:00
heroImageDark: https://cdn.liteyuki.icu/static/svg/lylogo-full-dark.svg
2024-03-31 10:59:17 +08:00
bgImage:
bgImageDark:
2024-03-28 10:50:19 +08:00
bgImageStyle:
background-attachment: fixed
heroText: LiteyukiBot
tagline: LiteyukiBot 轻雪机器人,综合性的机器人应用及管理框架
2024-05-26 17:19:32 +08:00
2024-03-28 10:50:19 +08:00
actions:
2024-04-12 13:07:19 +08:00
- text: 快速部署
2024-06-19 12:34:38 +08:00
icon: rocket
2024-03-31 10:59:17 +08:00
link: ./deployment/install.html
2024-03-28 10:50:19 +08:00
type: primary
2024-04-01 23:56:03 +08:00
- text: 使用手册
2024-03-31 10:59:17 +08:00
icon: book
link: ./usage/basic_command.html
2024-03-28 10:50:19 +08:00
highlights:
2024-04-01 23:56:03 +08:00
- header: 简洁至上
2024-03-31 10:59:17 +08:00
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: 支持多种框架
2024-03-31 10:59:17 +08:00
icon: robot
details: 兼容nonebotmelobot等拥有良好的生态支持
2024-03-31 10:59:17 +08:00
link: https://nonebot.dev/
2024-06-19 12:34:38 +08:00
- title: 便捷管理
2024-03-31 10:59:17 +08:00
icon: plug
2024-07-21 00:40:55 +08:00
details: 使用包管理器,便捷管理插件及资源包
2024-03-31 19:23:15 +08:00
2024-04-01 23:56:03 +08:00
- title: 主题支持
2024-03-31 10:59:17 +08:00
icon: paint-brush
2024-05-26 17:12:06 +08:00
details: 使用资源包对外观进行完全自定义
2024-04-22 14:05:10 +08:00
link: https://bot.liteyuki.icu/usage/resource_pack.html
2024-03-31 10:59:17 +08:00
2024-04-01 23:56:03 +08:00
- title: 国际化
2024-03-31 10:59:17 +08:00
icon: globe
2024-05-26 17:12:06 +08:00
details: 通过资源包支持多种语言
2024-03-31 10:59:17 +08:00
link: https://baike.baidu.com/item/i18n/6771940
2024-06-19 12:34:38 +08:00
- title: 简易使用
2024-03-31 10:59:17 +08:00
icon: cog
2024-05-26 17:12:06 +08:00
details: 无需繁琐前期过程,开箱即用
2024-03-31 10:59:17 +08:00
link: https://bot.liteyuki.icu/deployment/config.html
- title: 超高性能
2024-05-26 17:12:06 +08:00
icon: tachometer-alt
2024-06-19 12:34:38 +08:00
details: 500个插件2s内启动
2024-03-31 10:59:17 +08:00
2024-05-26 17:12:06 +08:00
- title: 滚动更新
2024-03-31 10:59:17 +08:00
icon: cloud-download
2024-05-26 17:12:06 +08:00
details: 让你的机器人保持最新提交
2024-03-31 19:23:15 +08:00
- title: 开源项目
2024-03-31 10:59:17 +08:00
icon: code
2024-06-19 12:34:38 +08:00
details: 项目遵循MIT LICENCE开源欢迎各位的贡献
2024-03-31 10:59:17 +08:00
2024-03-28 11:12:55 +08:00
- header: 快速部署
2024-03-28 10:50:19 +08:00
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:
2024-07-21 00:40:55 +08:00
- title: 安装 Git 及 Python3.10+
2024-08-05 06:00:07 +08:00
- title: 使用 <code>git clone https://github.com/LiteyukiStudio/LiteyukiBot --depth=1</code> 以克隆项目至本地。
2024-06-19 12:34:38 +08:00
details: 如果无法连接到GitHub可以使用 <code>git clone https://gitee.com/snowykami/LiteyukiBot --depth=1</code>
2024-03-28 11:12:55 +08:00
- title: 使用 <code>cd LiteyukiBot</code> 切换到项目目录。
2024-04-01 23:56:03 +08:00
- 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> 启动项目。
2024-03-31 10:59:17 +08:00
copyright: © 2021-2024 SnowyKami All Rights Reserved
2024-08-01 12:33:36 +08:00
---
2024-08-17 02:24:25 +08:00
<script>
// 定义全局变量来存储数据
let globalTotal = 0;
let globalOnline = 0;
// 从API获取数据并更新全局变量
function fetchAndUpdateData() {
Promise.all([
fetch("https://api.liteyuki.icu/count").then(res => res.json()),
fetch("https://api.liteyuki.icu/online").then(res => res.json())
])
.then(([countRes, onlineRes]) => {
globalTotal = countRes.register;
globalOnline = onlineRes.online;
})
.catch(err => {
console.error("Error fetching data:", err);
});
}
// 更新页面显示,使用全局变量中的数据
function updatePageDisplay() {
let countInfo = document.getElementById("count-info");
if (!countInfo) {
let info = `<div id="count-info" style="text-align: center; font-size: 20px; font-weight: 500">
全球实例:<span id="total">${globalTotal}</span>&nbsp;&nbsp;&nbsp;&nbsp;当前在线:<span id="online">${globalOnline}</span></div>`;
let mainDescription = document.querySelector("#main-description");
if (mainDescription) {
mainDescription.insertAdjacentHTML('afterend', info);
}
}
}
// 初始调用更新数据
fetchAndUpdateData();
updatePageDisplay();
// 设置定时器,分别以不同频率调用更新数据和更新页面的函数
setInterval(fetchAndUpdateData, 10000); // 每10秒更新一次数据
setInterval(updatePageDisplay, 1000); // 每1秒更新一次页面显示
</script>