mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-26 15:51:26 +00:00
📝 Docs: 升级到 Docusaurus V3 (#2956)
This commit is contained in:
@ -166,7 +166,7 @@ COMMON_CONFIG=common config # 这个配置项在任何环境中都会被加载
|
||||
在生产环境中,可以通过设置环境变量 `ENVIRONMENT=prod` 来确保 NoneBot 读取正确的环境配置。
|
||||
:::
|
||||
|
||||
#### .env.{ENVIRONMENT} 文件
|
||||
#### .env.\{ENVIRONMENT\} 文件
|
||||
|
||||
`.env.{ENVIRONMENT}` 文件类似于预设,可以让我们在多套不同的配置方案中灵活切换,默认 NoneBot 会读取 `.env.prod` 配置。如果你使用了 `nb-cli` 创建 `simple` 项目,那么将含有两套预设配置:`.env.dev` 和 `.env.prod`。
|
||||
|
||||
|
@ -71,14 +71,14 @@ alc = Alconna(".rd{roll:int}")
|
||||
assert alc.parse(".rd123").header["roll"] == 123
|
||||
```
|
||||
|
||||
Bracket Header 类似 python 里的 f-string 写法,通过 "{}" 声明匹配类型
|
||||
Bracket Header 类似 python 里的 f-string 写法,通过 `"{}"` 声明匹配类型
|
||||
|
||||
"{}" 中的内容为 "name:type or pat":
|
||||
`"{}"` 中的内容为 "name:type or pat":
|
||||
|
||||
- "{}", "{:}" ⇔ "(.+)", 占位符
|
||||
- "{foo}" ⇔ "(?P<foo>.+)"
|
||||
- "{:\d+}" ⇔ "(\d+)"
|
||||
- "{foo:int}" ⇔ "(?P<foo>\d+)",其中 "int" 部分若能转为 `BasePattern` 则读取里面的表达式
|
||||
- `"{}"`, `"{:}"` ⇔ `"(.+)"`, 占位符
|
||||
- `"{foo}"` ⇔ `"(?P<foo>.+)"`
|
||||
- `"{:\d+}"` ⇔ `"(\d+)"`
|
||||
- `"{foo:int}"` ⇔ `"(?P<foo>\d+)"`,其中 `"int"` 部分若能转为 `BasePattern` 则读取里面的表达式
|
||||
|
||||
## 参数声明(Args)
|
||||
|
||||
@ -321,7 +321,7 @@ opt2 = Option("--foo", default=OptionResult(value=False, args={"bar": 1}))
|
||||
- `keep_crlf`: 命令解析时是否保留换行字符
|
||||
- `compact`: 命令是否允许第一个参数紧随头部
|
||||
- `strict`: 命令是否严格匹配,若为 False 则未知参数将作为名为 $extra 的参数
|
||||
- `context_style`: 命令上下文插值的风格,None 为关闭,bracket 为 {...},parentheses 为 $(...)
|
||||
- `context_style`: 命令上下文插值的风格,None 为关闭,bracket 为 `{...}`,parentheses 为 `$(...)`
|
||||
- `extra`: 命令的自定义额外信息
|
||||
|
||||
元数据一定使用 `meta=...` 形式传入:
|
||||
|
@ -96,7 +96,7 @@ class Other(Segment):
|
||||
|
||||
```
|
||||
|
||||
:::tips
|
||||
:::tip
|
||||
|
||||
或许你注意到了 `Segment` 上有一个 `children` 属性。
|
||||
|
||||
@ -291,7 +291,7 @@ msg.extend([Text("text")])
|
||||
|
||||
这里额外说明 `UniMessage.template` 的拓展控制符
|
||||
|
||||
相比 `Message`,UniMessage 对于 {:XXX} 做了另一类拓展。其能够识别例如 At(xxx, yyy) 或 Emoji(aaa, bbb)的字符串并执行
|
||||
相比 `Message`,UniMessage 对于 `{:XXX}` 做了另一类拓展。其能够识别例如 At(xxx, yyy) 或 Emoji(aaa, bbb)的字符串并执行
|
||||
|
||||
以 At(...) 为例:
|
||||
|
||||
@ -305,7 +305,7 @@ UniMessage(At("user", "123"))
|
||||
UniMessage(At("user", "123"))
|
||||
```
|
||||
|
||||
而在 `AlconnaMatcher` 中,{:XXX} 更进一步地提供了获取 `event` 和 `bot` 中的属性的功能:
|
||||
而在 `AlconnaMatcher` 中,`{:XXX}` 更进一步地提供了获取 `event` 和 `bot` 中的属性的功能:
|
||||
|
||||
```python title=在AlconnaMatcher中使用通用消息段的拓展控制符
|
||||
from arclet.alconna import Alconna, Args
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 0
|
||||
description: 开源软件供应链点亮计划 - 暑期 2021
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2021
|
||||
|
||||
**开源软件供应链点亮计划 - 暑期 2021** 是**中国科学院软件研究所**与 **openEuler 社区**共同举办的一项面向高校学生的暑期活动,旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer.iscas.ac.cn/) 和 [帮助文档](https://summer.iscas.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区参与了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学在上面给出的活动官网报名,或通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区参与了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学在上面给出的活动官网报名,或通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot v1
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
description: 开源之夏 - 暑期 2022
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2022
|
||||
|
||||
**开源之夏 - 暑期 2022** 是由**开源软件供应链点亮计划**发起、由**中国科学院软件研究所**与 **openEuler 社区**主办的一项面向高校学生的暑期活动,类似 Google Summer of Code(GSoC),旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/#/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a/) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学加入 QQ 群 [737131827](https://jq.qq.com/?_wv=1027&k=PEgyGeEu) 或通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/#/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a/) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学加入 QQ 群 [737131827](https://jq.qq.com/?_wv=1027&k=PEgyGeEu) 或通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot2 命令行 CLI 交互体验升级
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
description: 开源之夏 - 暑期 2023
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2023
|
||||
|
||||
**开源之夏 - 暑期 2023** 是由**开源软件供应链点亮计划**发起、由**中国科学院软件研究所**与 **openEuler 社区**主办的一项面向高校学生的暑期活动,类似 Google Summer of Code(GSoC),旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot 项目管理图形化面板
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
description: 开源之夏 - 暑期 2024
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2024
|
||||
|
||||
**开源之夏 - 暑期 2024** 是**中国科学院软件研究所**发起的**开源软件供应链点亮计划**系列暑期活动,旨在鼓励高校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。活动联合各大开源社区,针对重要开源软件的开发与维护提供项目开发任务,并向全球高校学生开放报名。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NonePress 官网组件库更新与优化
|
||||
|
||||
|
@ -1,317 +0,0 @@
|
||||
// @ts-check
|
||||
// Note: type annotations allow type checking and IDEs autocompletion
|
||||
|
||||
// color mode config
|
||||
/** @type {import('@nullbot/docusaurus-preset-nonepress').ThemeConfig["colorMode"]} */
|
||||
const colorMode = {
|
||||
defaultMode: "light",
|
||||
respectPrefersColorScheme: true,
|
||||
};
|
||||
|
||||
// navbar config
|
||||
/** @type {import('@nullbot/docusaurus-preset-nonepress').ThemeConfig["navbar"]} */
|
||||
const navbar = {
|
||||
title: "NoneBot",
|
||||
logo: {
|
||||
alt: "NoneBot",
|
||||
src: "logo.png",
|
||||
href: "/",
|
||||
target: "_self",
|
||||
height: 32,
|
||||
width: 32,
|
||||
},
|
||||
hideOnScroll: false,
|
||||
items: [
|
||||
{
|
||||
label: "指南",
|
||||
type: "docsMenu",
|
||||
category: "tutorial",
|
||||
},
|
||||
{
|
||||
label: "深入",
|
||||
type: "docsMenu",
|
||||
category: "appendices",
|
||||
},
|
||||
{
|
||||
label: "进阶",
|
||||
type: "docsMenu",
|
||||
category: "advanced",
|
||||
},
|
||||
{
|
||||
label: "API",
|
||||
type: "doc",
|
||||
docId: "api/index",
|
||||
},
|
||||
{
|
||||
label: "更多",
|
||||
type: "dropdown",
|
||||
to: "/store/plugins",
|
||||
items: [
|
||||
{
|
||||
label: "最佳实践",
|
||||
type: "doc",
|
||||
docId: "best-practice/scheduler",
|
||||
},
|
||||
{
|
||||
label: "开发者",
|
||||
type: "doc",
|
||||
docId: "developer/plugin-publishing",
|
||||
},
|
||||
{ label: "社区", type: "doc", docId: "community/contact" },
|
||||
{ label: "开源之夏", type: "doc", docId: "ospp/2024" },
|
||||
{ label: "商店", to: "/store/plugins" },
|
||||
{ label: "更新日志", to: "/changelog" },
|
||||
{ label: "论坛", href: "https://discussions.nonebot.dev" },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// footer config
|
||||
/** @type {import('@nullbot/docusaurus-preset-nonepress').ThemeConfig["footer"]} */
|
||||
const footer = {
|
||||
style: "light",
|
||||
logo: {
|
||||
alt: "NoneBot",
|
||||
src: "logo.png",
|
||||
href: "/",
|
||||
target: "_self",
|
||||
height: 32,
|
||||
width: 32,
|
||||
},
|
||||
copyright: `Copyright © ${new Date().getFullYear()} NoneBot. All rights reserved.`,
|
||||
links: [
|
||||
{
|
||||
title: "Learn",
|
||||
items: [
|
||||
{ label: "Introduction", to: "/docs/" },
|
||||
{ label: "QuickStart", to: "/docs/quick-start" },
|
||||
{ label: "Changelog", to: "/changelog" },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "NoneBot Team",
|
||||
items: [
|
||||
{
|
||||
label: "Homepage",
|
||||
href: "https://nonebot.dev",
|
||||
},
|
||||
{
|
||||
label: "NoneBot V1",
|
||||
href: "https://v1.nonebot.dev",
|
||||
},
|
||||
{ label: "NoneBot CLI", href: "https://cli.nonebot.dev" },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Related",
|
||||
items: [
|
||||
{ label: "OneBot", href: "https://onebot.dev/" },
|
||||
{ label: "go-cqhttp", href: "https://docs.go-cqhttp.org/" },
|
||||
{ label: "Mirai", href: "https://mirai.mamoe.net/" },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// prism config
|
||||
/** @type {import('prism-react-renderer').PrismTheme} */
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line import/order
|
||||
const lightCodeTheme = require("prism-react-renderer/themes/github");
|
||||
/** @type {import('prism-react-renderer').PrismTheme} */
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line import/order
|
||||
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
|
||||
|
||||
/** @type {import('@nullbot/docusaurus-preset-nonepress').ThemeConfig["prism"]} */
|
||||
const prism = {
|
||||
theme: lightCodeTheme,
|
||||
darkTheme: darkCodeTheme,
|
||||
additionalLanguages: ["docker", "ini"],
|
||||
};
|
||||
|
||||
// algolia config
|
||||
/** @type {import('@nullbot/docusaurus-preset-nonepress').ThemeConfig["algolia"]} */
|
||||
const algolia = {
|
||||
appId: "X0X5UACHZQ",
|
||||
apiKey: "ac03e1ac2bd0812e2ea38c0cc1ea38c5",
|
||||
indexName: "nonebot",
|
||||
contextualSearch: true,
|
||||
};
|
||||
|
||||
// nonepress config
|
||||
/** @type {import('@nullbot/docusaurus-preset-nonepress').ThemeConfig["nonepress"]} */
|
||||
const nonepress = {
|
||||
tailwindConfig: require("./tailwind.config"),
|
||||
navbar: {
|
||||
docsVersionDropdown: {
|
||||
dropdownItemsAfter: [
|
||||
{
|
||||
label: "1.x",
|
||||
href: "https://v1.nonebot.dev/",
|
||||
},
|
||||
],
|
||||
},
|
||||
socialLinks: [
|
||||
{
|
||||
icon: ["fab", "github"],
|
||||
href: "https://github.com/nonebot/nonebot2",
|
||||
},
|
||||
],
|
||||
},
|
||||
footer: {
|
||||
socialLinks: [
|
||||
{
|
||||
icon: ["fab", "github"],
|
||||
href: "https://github.com/nonebot/nonebot2",
|
||||
},
|
||||
{
|
||||
icon: ["fab", "qq"],
|
||||
href: "https://jq.qq.com/?_wv=1027&k=5OFifDh",
|
||||
},
|
||||
{
|
||||
icon: ["fab", "telegram"],
|
||||
href: "https://t.me/botuniverse",
|
||||
},
|
||||
{
|
||||
icon: ["fab", "discord"],
|
||||
href: "https://discord.gg/VKtE6Gdc4h",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
// theme config
|
||||
/** @type {import('@nullbot/docusaurus-preset-nonepress').ThemeConfig} */
|
||||
const themeConfig = {
|
||||
colorMode,
|
||||
navbar,
|
||||
footer,
|
||||
prism,
|
||||
algolia,
|
||||
nonepress,
|
||||
};
|
||||
|
||||
/** @type {import('@docusaurus/types').Config} */
|
||||
const siteConfig = {
|
||||
title: "NoneBot",
|
||||
tagline: "跨平台 Python 异步机器人框架",
|
||||
favicon: "icons/favicon.ico",
|
||||
|
||||
// Set the production url of your site here
|
||||
url: "https://nonebot.dev",
|
||||
// Set the /<baseUrl>/ pathname under which your site is served
|
||||
// For GitHub pages deployment, it is often '/<projectName>/'
|
||||
baseUrl: process.env.BASE_URL || "/",
|
||||
|
||||
// GitHub pages deployment config.
|
||||
// If you aren't using GitHub pages, you don't need these.
|
||||
organizationName: "nonebot", // Usually your GitHub org/user name.
|
||||
projectName: "nonebot2", // Usually your repo name.
|
||||
|
||||
onBrokenLinks: "throw",
|
||||
onBrokenMarkdownLinks: "warn",
|
||||
|
||||
// Even if you don't use internalization, you can use this field to set useful
|
||||
// metadata like html lang. For example, if your site is Chinese, you may want
|
||||
// to replace "en" with "zh-Hans".
|
||||
i18n: {
|
||||
defaultLocale: "zh-Hans",
|
||||
locales: ["zh-Hans"],
|
||||
},
|
||||
|
||||
headTags: [
|
||||
// 百度搜索资源平台
|
||||
// https://ziyuan.baidu.com/
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
name: "baidu-site-verification",
|
||||
content: "codeva-0GTZpDnDrW",
|
||||
},
|
||||
},
|
||||
],
|
||||
scripts: [
|
||||
// 百度统计
|
||||
// https://tongji.baidu.com/
|
||||
{
|
||||
type: "text/javascript",
|
||||
charset: "UTF-8",
|
||||
src: "https://hm.baidu.com/hm.js?875efa50097818701ee681edd63eaac6",
|
||||
async: true,
|
||||
},
|
||||
// 万维广告
|
||||
// https://wwads.cn/
|
||||
{
|
||||
type: "text/javascript",
|
||||
charset: "UTF-8",
|
||||
src: "https://cdn.wwads.cn/js/makemoney.js",
|
||||
async: true,
|
||||
},
|
||||
// uwu logo
|
||||
{
|
||||
type: "text/javascript",
|
||||
charset: "UTF-8",
|
||||
src: "/uwu.js",
|
||||
},
|
||||
],
|
||||
|
||||
presets: [
|
||||
[
|
||||
"@nullbot/docusaurus-preset-nonepress",
|
||||
/** @type {import('@nullbot/docusaurus-preset-nonepress').Options} */
|
||||
({
|
||||
docs: {
|
||||
sidebarPath: require.resolve("./sidebars.js"),
|
||||
// Please change this to your repo.
|
||||
editUrl: "https://github.com/nonebot/nonebot2/edit/master/website/",
|
||||
showLastUpdateAuthor: true,
|
||||
showLastUpdateTime: true,
|
||||
// exclude: [
|
||||
// "**/_*.{js,jsx,ts,tsx,md,mdx}",
|
||||
// "**/_*/**",
|
||||
// "**/*.test.{js,jsx,ts,tsx}",
|
||||
// "**/__tests__/**",
|
||||
// ],
|
||||
// async sidebarItemsGenerator({
|
||||
// isCategoryIndex: defaultCategoryIndexMatcher,
|
||||
// defaultSidebarItemsGenerator,
|
||||
// ...args
|
||||
// }) {
|
||||
// return defaultSidebarItemsGenerator({
|
||||
// ...args,
|
||||
// isCategoryIndex(doc) {
|
||||
// // disable category index convention for generated API docs
|
||||
// if (
|
||||
// doc.directories.length > 0 &&
|
||||
// doc.directories.at(-1) === "api"
|
||||
// ) {
|
||||
// return false;
|
||||
// }
|
||||
// return defaultCategoryIndexMatcher(doc);
|
||||
// },
|
||||
// });
|
||||
// },
|
||||
},
|
||||
// theme: {
|
||||
// customCss: require.resolve("./src/css/custom.css"),
|
||||
// },
|
||||
sitemap: {
|
||||
changefreq: "daily",
|
||||
priority: 0.5,
|
||||
},
|
||||
gtag: {
|
||||
trackingID: "G-MRS1GMZG0F",
|
||||
},
|
||||
}),
|
||||
],
|
||||
],
|
||||
plugins: [require("./src/plugins/webpack-plugin.cjs")],
|
||||
|
||||
themeConfig,
|
||||
};
|
||||
|
||||
module.exports = siteConfig;
|
353
website/docusaurus.config.ts
Normal file
353
website/docusaurus.config.ts
Normal file
@ -0,0 +1,353 @@
|
||||
import type { Config } from "@docusaurus/types";
|
||||
import type { Options as ChangelogOptions } from "@nullbot/docusaurus-plugin-changelog";
|
||||
import type * as Preset from "@nullbot/docusaurus-preset-nonepress";
|
||||
import { themes } from "prism-react-renderer";
|
||||
|
||||
// By default, we use Docusaurus Faster
|
||||
// DOCUSAURUS_SLOWER=true is useful for benchmarking faster against slower
|
||||
// hyperfine --prepare 'yarn clear:website' --runs 3 'DOCUSAURUS_SLOWER=true yarn build:website:fast' 'yarn build:website:fast'
|
||||
const isSlower = process.env.DOCUSAURUS_SLOWER === "true";
|
||||
if (isSlower) {
|
||||
console.log("🐢 Using slower Docusaurus build");
|
||||
}
|
||||
|
||||
// color mode config
|
||||
const colorMode: Preset.ThemeConfig["colorMode"] = {
|
||||
defaultMode: "light",
|
||||
respectPrefersColorScheme: true,
|
||||
};
|
||||
|
||||
// navbar config
|
||||
const navbar: Preset.ThemeConfig["navbar"] = {
|
||||
title: "NoneBot",
|
||||
logo: {
|
||||
alt: "NoneBot",
|
||||
src: "logo.png",
|
||||
href: "/",
|
||||
target: "_self",
|
||||
height: 32,
|
||||
width: 32,
|
||||
},
|
||||
hideOnScroll: false,
|
||||
items: [
|
||||
{
|
||||
label: "指南",
|
||||
type: "docsMenu",
|
||||
category: "tutorial",
|
||||
},
|
||||
{
|
||||
label: "深入",
|
||||
type: "docsMenu",
|
||||
category: "appendices",
|
||||
},
|
||||
{
|
||||
label: "进阶",
|
||||
type: "docsMenu",
|
||||
category: "advanced",
|
||||
},
|
||||
{
|
||||
label: "API",
|
||||
type: "doc",
|
||||
docId: "api/index",
|
||||
},
|
||||
{
|
||||
label: "更多",
|
||||
type: "dropdown",
|
||||
to: "/store/plugins",
|
||||
items: [
|
||||
{
|
||||
label: "最佳实践",
|
||||
type: "doc",
|
||||
docId: "best-practice/scheduler",
|
||||
},
|
||||
{
|
||||
label: "开发者",
|
||||
type: "doc",
|
||||
docId: "developer/plugin-publishing",
|
||||
},
|
||||
{ label: "社区", type: "doc", docId: "community/contact" },
|
||||
{ label: "开源之夏", type: "doc", docId: "ospp/2024" },
|
||||
{ label: "商店", to: "/store/plugins" },
|
||||
{ label: "更新日志", to: "/changelog" },
|
||||
{ label: "论坛", href: "https://discussions.nonebot.dev" },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// footer config
|
||||
const footer: Preset.ThemeConfig["footer"] = {
|
||||
style: "light",
|
||||
logo: {
|
||||
alt: "NoneBot",
|
||||
src: "logo.png",
|
||||
href: "/",
|
||||
target: "_self",
|
||||
height: 32,
|
||||
width: 32,
|
||||
},
|
||||
copyright: `Copyright © ${new Date().getFullYear()} NoneBot. All rights reserved.`,
|
||||
links: [
|
||||
{
|
||||
title: "Learn",
|
||||
items: [
|
||||
{ label: "Introduction", to: "/docs/" },
|
||||
{ label: "QuickStart", to: "/docs/quick-start" },
|
||||
{ label: "Changelog", to: "/changelog" },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "NoneBot Team",
|
||||
items: [
|
||||
{
|
||||
label: "Homepage",
|
||||
href: "https://nonebot.dev",
|
||||
},
|
||||
{
|
||||
label: "NoneBot V1",
|
||||
href: "https://v1.nonebot.dev",
|
||||
},
|
||||
{ label: "NoneBot CLI", href: "https://cli.nonebot.dev" },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Related",
|
||||
items: [
|
||||
{ label: "OneBot", href: "https://onebot.dev/" },
|
||||
{ label: "go-cqhttp", href: "https://docs.go-cqhttp.org/" },
|
||||
{ label: "Mirai", href: "https://mirai.mamoe.net/" },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// prism config
|
||||
const lightCodeTheme = themes.github;
|
||||
const darkCodeTheme = themes.dracula;
|
||||
|
||||
const prism: Preset.ThemeConfig["prism"] = {
|
||||
theme: lightCodeTheme,
|
||||
darkTheme: darkCodeTheme,
|
||||
additionalLanguages: ["docker", "ini"],
|
||||
};
|
||||
|
||||
// algolia config
|
||||
const algolia: Preset.ThemeConfig["algolia"] = {
|
||||
appId: "X0X5UACHZQ",
|
||||
apiKey: "ac03e1ac2bd0812e2ea38c0cc1ea38c5",
|
||||
indexName: "nonebot",
|
||||
contextualSearch: true,
|
||||
};
|
||||
|
||||
// nonepress config
|
||||
const nonepress: Preset.ThemeConfig["nonepress"] = {
|
||||
tailwindConfig: require("./tailwind.config"),
|
||||
navbar: {
|
||||
docsVersionDropdown: {
|
||||
dropdownItemsAfter: [
|
||||
{
|
||||
label: "1.x",
|
||||
href: "https://v1.nonebot.dev/",
|
||||
},
|
||||
],
|
||||
},
|
||||
socialLinks: [
|
||||
{
|
||||
icon: ["fab", "github"],
|
||||
href: "https://github.com/nonebot/nonebot2",
|
||||
},
|
||||
],
|
||||
},
|
||||
footer: {
|
||||
socialLinks: [
|
||||
{
|
||||
icon: ["fab", "github"],
|
||||
href: "https://github.com/nonebot/nonebot2",
|
||||
},
|
||||
{
|
||||
icon: ["fab", "qq"],
|
||||
href: "https://jq.qq.com/?_wv=1027&k=5OFifDh",
|
||||
},
|
||||
{
|
||||
icon: ["fab", "telegram"],
|
||||
href: "https://t.me/botuniverse",
|
||||
},
|
||||
{
|
||||
icon: ["fab", "discord"],
|
||||
href: "https://discord.gg/VKtE6Gdc4h",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
// theme config
|
||||
const themeConfig: Preset.ThemeConfig = {
|
||||
colorMode,
|
||||
navbar,
|
||||
footer,
|
||||
prism,
|
||||
algolia,
|
||||
nonepress,
|
||||
};
|
||||
|
||||
export default async function createConfigAsync() {
|
||||
return {
|
||||
title: "NoneBot",
|
||||
tagline: "跨平台 Python 异步机器人框架",
|
||||
favicon: "icons/favicon.ico",
|
||||
|
||||
// Set the production url of your site here
|
||||
url: "https://nonebot.dev",
|
||||
// Set the /<baseUrl>/ pathname under which your site is served
|
||||
// For GitHub pages deployment, it is often '/<projectName>/'
|
||||
baseUrl: process.env.BASE_URL || "/",
|
||||
|
||||
// GitHub pages deployment config.
|
||||
// If you aren't using GitHub pages, you don't need these.
|
||||
organizationName: "nonebot", // Usually your GitHub org/user name.
|
||||
projectName: "nonebot2", // Usually your repo name.
|
||||
|
||||
onBrokenLinks: "throw",
|
||||
onBrokenMarkdownLinks: "warn",
|
||||
|
||||
// Even if you don't use internalization, you can use this field to set useful
|
||||
// metadata like html lang. For example, if your site is Chinese, you may want
|
||||
// to replace "en" with "zh-Hans".
|
||||
i18n: {
|
||||
defaultLocale: "zh-Hans",
|
||||
locales: ["zh-Hans"],
|
||||
},
|
||||
|
||||
headTags: [
|
||||
// 百度搜索资源平台
|
||||
// https://ziyuan.baidu.com/
|
||||
{
|
||||
tagName: "meta",
|
||||
attributes: {
|
||||
name: "baidu-site-verification",
|
||||
content: "codeva-0GTZpDnDrW",
|
||||
},
|
||||
},
|
||||
],
|
||||
scripts: [
|
||||
// 百度统计
|
||||
// https://tongji.baidu.com/
|
||||
{
|
||||
type: "text/javascript",
|
||||
charset: "UTF-8",
|
||||
src: "https://hm.baidu.com/hm.js?875efa50097818701ee681edd63eaac6",
|
||||
async: true,
|
||||
},
|
||||
// 万维广告
|
||||
// https://wwads.cn/
|
||||
{
|
||||
type: "text/javascript",
|
||||
charset: "UTF-8",
|
||||
src: "https://cdn.wwads.cn/js/makemoney.js",
|
||||
async: true,
|
||||
},
|
||||
// uwu logo
|
||||
{
|
||||
type: "text/javascript",
|
||||
charset: "UTF-8",
|
||||
src: "/uwu.js",
|
||||
},
|
||||
],
|
||||
|
||||
presets: [
|
||||
[
|
||||
"@nullbot/docusaurus-preset-nonepress",
|
||||
/** @type {import('@nullbot/docusaurus-preset-nonepress').Options} */
|
||||
{
|
||||
docs: {
|
||||
sidebarPath: require.resolve("./sidebars.js"),
|
||||
// Please change this to your repo.
|
||||
editUrl: "https://github.com/nonebot/nonebot2/edit/master/website/",
|
||||
showLastUpdateAuthor: true,
|
||||
showLastUpdateTime: true,
|
||||
// exclude: [
|
||||
// "**/_*.{js,jsx,ts,tsx,md,mdx}",
|
||||
// "**/_*/**",
|
||||
// "**/*.test.{js,jsx,ts,tsx}",
|
||||
// "**/__tests__/**",
|
||||
// ],
|
||||
// async sidebarItemsGenerator({
|
||||
// isCategoryIndex: defaultCategoryIndexMatcher,
|
||||
// defaultSidebarItemsGenerator,
|
||||
// ...args
|
||||
// }) {
|
||||
// return defaultSidebarItemsGenerator({
|
||||
// ...args,
|
||||
// isCategoryIndex(doc) {
|
||||
// // disable category index convention for generated API docs
|
||||
// if (
|
||||
// doc.directories.length > 0 &&
|
||||
// doc.directories.at(-1) === "api"
|
||||
// ) {
|
||||
// return false;
|
||||
// }
|
||||
// return defaultCategoryIndexMatcher(doc);
|
||||
// },
|
||||
// });
|
||||
// },
|
||||
},
|
||||
// theme: {
|
||||
// customCss: require.resolve("./src/css/custom.css"),
|
||||
// },
|
||||
sitemap: {
|
||||
changefreq: "daily",
|
||||
priority: 0.5,
|
||||
},
|
||||
gtag: {
|
||||
trackingID: "G-MRS1GMZG0F",
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
webpack: {
|
||||
jsLoader: (isServer) => ({
|
||||
loader: require.resolve("swc-loader"),
|
||||
options: {
|
||||
jsc: {
|
||||
parser: {
|
||||
syntax: "typescript",
|
||||
tsx: true,
|
||||
},
|
||||
transform: {
|
||||
react: {
|
||||
runtime: "automatic",
|
||||
},
|
||||
},
|
||||
target: "es2017",
|
||||
},
|
||||
module: {
|
||||
type: isServer ? "commonjs" : "es6",
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
||||
plugins: [
|
||||
require("./src/plugins/webpack-plugin.ts"),
|
||||
[
|
||||
"@nullbot/docusaurus-plugin-changelog",
|
||||
{
|
||||
changelogPath: "src/changelog/changelog.md",
|
||||
changelogHeader: `description: Changelog
|
||||
toc_max_heading_level: 2
|
||||
sidebar_custom_props:
|
||||
sidebar_id: changelog`,
|
||||
} satisfies ChangelogOptions,
|
||||
],
|
||||
],
|
||||
|
||||
markdown: {
|
||||
mdx1Compat: {
|
||||
headingIds: true,
|
||||
},
|
||||
},
|
||||
|
||||
themeConfig,
|
||||
} satisfies Config;
|
||||
}
|
@ -22,24 +22,27 @@
|
||||
"typecheck": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "^2.4.1",
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"@nullbot/docusaurus-preset-nonepress": "^2.1.2",
|
||||
"clsx": "^1.2.1",
|
||||
"copy-text-to-clipboard": "^3.0.1",
|
||||
"prism-react-renderer": "^1.3.5",
|
||||
"@docusaurus/core": "^3.5.2",
|
||||
"@mdx-js/react": "^3.0.0",
|
||||
"@nullbot/docusaurus-plugin-changelog": "^3.0.0",
|
||||
"@nullbot/docusaurus-preset-nonepress": "^3.0.0",
|
||||
"@swc/core": "^1.7.26",
|
||||
"clsx": "^2.0.0",
|
||||
"copy-text-to-clipboard": "^3.2.0",
|
||||
"prism-react-renderer": "^2.3.0",
|
||||
"raw-loader": "^4.0.2",
|
||||
"react": "^17.0.1",
|
||||
"react": "^18.0.0",
|
||||
"react-color": "^2.19.3",
|
||||
"react-dom": "^17.0.1",
|
||||
"react-use-pagination": "^2.0.1"
|
||||
"react-dom": "^18.0.0",
|
||||
"react-use-pagination": "^2.0.1",
|
||||
"swc-loader": "^0.2.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "^2.4.1",
|
||||
"@tsconfig/docusaurus": "^1.0.5",
|
||||
"@docusaurus/module-type-aliases": "^3.5.2",
|
||||
"@nullbot/docusaurus-tsconfig": "^3.0.0",
|
||||
"@types/react-color": "^3.0.10",
|
||||
"asciinema-player": "^3.5.0",
|
||||
"typescript": "^4.7.4"
|
||||
"typescript": "~5.5.2"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
@ -54,6 +57,6 @@
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.14"
|
||||
"node": ">=18.0"
|
||||
}
|
||||
}
|
||||
|
@ -8,11 +8,15 @@
|
||||
|
||||
Create as many sidebars as you want.
|
||||
*/
|
||||
import path from "path";
|
||||
|
||||
// @ts-check
|
||||
import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
|
||||
import { getChangelogItemsSync } from "@nullbot/docusaurus-plugin-changelog";
|
||||
|
||||
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
|
||||
const sidebars = {
|
||||
const changelogPath = path.join(__dirname, "src/changelog/changelog.md");
|
||||
const changelogItems = getChangelogItemsSync(changelogPath, 10);
|
||||
|
||||
const sidebars: SidebarsConfig = {
|
||||
tutorial: [
|
||||
{
|
||||
type: "category",
|
||||
@ -133,6 +137,22 @@ const sidebars = {
|
||||
],
|
||||
},
|
||||
],
|
||||
changelog: [
|
||||
{
|
||||
type: "category",
|
||||
label: "更新日志",
|
||||
collapsible: false,
|
||||
items: changelogItems.map<{ type: "link"; label: string; href: string }>(
|
||||
(chunk, index) => ({
|
||||
type: "link",
|
||||
label: chunk[0]!.title,
|
||||
href: `/changelog/${
|
||||
index > 0 ? encodeURIComponent(chunk[0]!.title) : ""
|
||||
}`,
|
||||
})
|
||||
),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = sidebars;
|
||||
export default sidebars;
|
@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
|
||||
import { useDocsVersionCandidates } from "@docusaurus/plugin-content-docs/client";
|
||||
import { PageMetadata } from "@docusaurus/theme-common";
|
||||
import { useDocsVersionCandidates } from "@docusaurus/theme-common/internal";
|
||||
import { useVersionedSidebar } from "@nullbot/docusaurus-plugin-getsidebar/client";
|
||||
import { SidebarContentFiller } from "@nullbot/docusaurus-theme-nonepress/contexts";
|
||||
|
||||
@ -25,7 +25,7 @@ function StorePage({ title, children }: Props): JSX.Element {
|
||||
)!;
|
||||
|
||||
return (
|
||||
<Page hideTableOfContents reduceContentWidth={false}>
|
||||
<Page hideTableOfContents reduceContentWidth={false} sidebarId={SIDEBAR_ID}>
|
||||
<SidebarContentFiller items={sidebarItems} />
|
||||
<article className="prose max-w-full">
|
||||
<h1 className="store-title">{title}</h1>
|
||||
|
@ -1,11 +1,8 @@
|
||||
// @ts-check
|
||||
import path from "path";
|
||||
|
||||
const path = require("path");
|
||||
import type { PluginConfig } from "@docusaurus/types";
|
||||
|
||||
/**
|
||||
* @returns {import('@docusaurus/types').Plugin}
|
||||
*/
|
||||
function webpackPlugin() {
|
||||
export default (function webpackPlugin() {
|
||||
return {
|
||||
name: "webpack-plugin",
|
||||
configureWebpack() {
|
||||
@ -18,6 +15,4 @@ function webpackPlugin() {
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = webpackPlugin;
|
||||
} satisfies PluginConfig);
|
@ -1,24 +1,26 @@
|
||||
const lightTheme = require("daisyui/src/theming/themes")["[data-theme=light]"];
|
||||
const darkTheme = require("daisyui/src/theming/themes")["[data-theme=dark]"];
|
||||
import typography from "@tailwindcss/typography";
|
||||
import daisyui from "daisyui";
|
||||
import themes from "daisyui/src/theming/themes";
|
||||
|
||||
/**
|
||||
* @param {{[key: string]: string}} theme
|
||||
* @param {string[]} exclude
|
||||
* @returns {{[key: string]: string}}
|
||||
*/
|
||||
function excludeThemeColor(theme, exclude) {
|
||||
/** @type {typeof theme} */
|
||||
const newObj = {};
|
||||
const lightTheme = themes.light;
|
||||
const darkTheme = themes.dark;
|
||||
|
||||
function excludeThemeColor(
|
||||
theme: { [key: string]: string },
|
||||
exclude: string[]
|
||||
): { [key: string]: string } {
|
||||
const newObj: { [key: string]: string } = {};
|
||||
for (const key in theme) {
|
||||
if (exclude.includes(key)) continue;
|
||||
newObj[key] = theme[key];
|
||||
newObj[key] = theme[key]!;
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
darkMode: ["class", '[data-theme="dark"]'],
|
||||
export default {
|
||||
plugins: [typography, daisyui],
|
||||
daisyui: {
|
||||
base: false,
|
||||
themes: [
|
||||
{
|
||||
light: {
|
||||
@ -28,6 +30,7 @@ module.exports = {
|
||||
"accent-content",
|
||||
]),
|
||||
primary: "#ea5252",
|
||||
"primary-content": "#ffffff",
|
||||
secondary: "#ef9fbc",
|
||||
accent: "#65c3c8",
|
||||
},
|
||||
@ -40,10 +43,13 @@ module.exports = {
|
||||
"accent-content",
|
||||
]),
|
||||
primary: "#ea5252",
|
||||
"primary-content": "#ffffff",
|
||||
secondary: "#ef9fbc",
|
||||
accent: "#65c3c8",
|
||||
},
|
||||
},
|
||||
],
|
||||
darkTheme: false,
|
||||
},
|
||||
darkMode: ["class", '[data-theme="dark"]'],
|
||||
};
|
@ -1,36 +1,42 @@
|
||||
{
|
||||
// This file is not used in compilation. It is here just for a nice editor experience.
|
||||
"extends": "@tsconfig/docusaurus/tsconfig.json",
|
||||
"extends": "@nullbot/docusaurus-tsconfig",
|
||||
"compilerOptions": {
|
||||
"lib": ["DOM", "ESNext"],
|
||||
"baseUrl": ".",
|
||||
"types": [
|
||||
"node",
|
||||
"@docusaurus/module-type-aliases",
|
||||
"@nullbot/docusaurus-theme-nonepress"
|
||||
],
|
||||
"paths": {
|
||||
"@/*": ["./src/*"],
|
||||
"@theme/*": ["./src/theme/*"]
|
||||
},
|
||||
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictBindCallApply": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"noImplicitThis": true,
|
||||
"alwaysStrict": true,
|
||||
|
||||
/* Disabled on purpose (handled by ESLint, should not block compilation) */
|
||||
"noUnusedParameters": false,
|
||||
|
||||
/* Advanced Options */
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true, // @types/webpack and webpack/types.d.ts are not the same thing
|
||||
"allowArbitraryExtensions": true,
|
||||
|
||||
/* Use tslib */
|
||||
"importHelpers": true,
|
||||
"noEmitHelpers": true
|
||||
// Duplicated from the root config, because TS does not support extending
|
||||
// multiple configs and we want to dogfood the @docusaurus/tsconfig one
|
||||
"allowUnreachableCode": false,
|
||||
"exactOptionalPropertyTypes": false,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitOverride": true,
|
||||
"noImplicitReturns": true,
|
||||
"noPropertyAccessFromIndexSignature": false,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictBindCallApply": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"useUnknownInCatchVariables": true,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"importsNotUsedAsValues": "remove",
|
||||
|
||||
// This is important. We run `yarn tsc` in website so we can catch issues
|
||||
// with our declaration files (mostly names that are forgotten to be
|
||||
// imported, invalid semantics...). Because we don't have end-to-end type
|
||||
// tests, removing this would make things much harder to catch.
|
||||
"skipLibCheck": false
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ description: nonebot.consts 模块
|
||||
|
||||
## _var_ `RECEIVE_KEY` {#RECEIVE-KEY}
|
||||
|
||||
- **类型:** Literal['\_receive\_{id}']
|
||||
- **类型:** Literal['\_receive\_\{id\}']
|
||||
|
||||
- **说明:** `receive` 存储 key
|
||||
|
||||
@ -21,7 +21,7 @@ description: nonebot.consts 模块
|
||||
|
||||
## _var_ `ARG_KEY` {#ARG-KEY}
|
||||
|
||||
- **类型:** Literal['{key}']
|
||||
- **类型:** Literal['\{key\}']
|
||||
|
||||
- **说明:** `arg` 存储 key
|
||||
|
||||
|
@ -166,7 +166,7 @@ COMMON_CONFIG=common config # 这个配置项在任何环境中都会被加载
|
||||
在生产环境中,可以通过设置环境变量 `ENVIRONMENT=prod` 来确保 NoneBot 读取正确的环境配置。
|
||||
:::
|
||||
|
||||
#### .env.{ENVIRONMENT} 文件
|
||||
#### .env.\{ENVIRONMENT\} 文件
|
||||
|
||||
`.env.{ENVIRONMENT}` 文件类似于预设,可以让我们在多套不同的配置方案中灵活切换,默认 NoneBot 会读取 `.env.prod` 配置。如果你使用了 `nb-cli` 创建 `simple` 项目,那么将含有两套预设配置:`.env.dev` 和 `.env.prod`。
|
||||
|
||||
|
@ -71,14 +71,14 @@ alc = Alconna(".rd{roll:int}")
|
||||
assert alc.parse(".rd123").header["roll"] == 123
|
||||
```
|
||||
|
||||
Bracket Header 类似 python 里的 f-string 写法,通过 "{}" 声明匹配类型
|
||||
Bracket Header 类似 python 里的 f-string 写法,通过 `"{}"` 声明匹配类型
|
||||
|
||||
"{}" 中的内容为 "name:type or pat":
|
||||
`"{}"` 中的内容为 "name:type or pat":
|
||||
|
||||
- "{}", "{:}" ⇔ "(.+)", 占位符
|
||||
- "{foo}" ⇔ "(?P<foo>.+)"
|
||||
- "{:\d+}" ⇔ "(\d+)"
|
||||
- "{foo:int}" ⇔ "(?P<foo>\d+)",其中 "int" 部分若能转为 `BasePattern` 则读取里面的表达式
|
||||
- `"{}"`, `"{:}"` ⇔ `"(.+)"`, 占位符
|
||||
- `"{foo}"` ⇔ `"(?P<foo>.+)"`
|
||||
- `"{:\d+}"` ⇔ `"(\d+)"`
|
||||
- `"{foo:int}"` ⇔ `"(?P<foo>\d+)"`,其中 `"int"` 部分若能转为 `BasePattern` 则读取里面的表达式
|
||||
|
||||
## 参数声明(Args)
|
||||
|
||||
@ -321,7 +321,7 @@ opt2 = Option("--foo", default=OptionResult(value=False, args={"bar": 1}))
|
||||
- `keep_crlf`: 命令解析时是否保留换行字符
|
||||
- `compact`: 命令是否允许第一个参数紧随头部
|
||||
- `strict`: 命令是否严格匹配,若为 False 则未知参数将作为名为 $extra 的参数
|
||||
- `context_style`: 命令上下文插值的风格,None 为关闭,bracket 为 {...},parentheses 为 $(...)
|
||||
- `context_style`: 命令上下文插值的风格,None 为关闭,bracket 为 `{...}`,parentheses 为 `$(...)`
|
||||
- `extra`: 命令的自定义额外信息
|
||||
|
||||
元数据一定使用 `meta=...` 形式传入:
|
||||
|
@ -96,7 +96,7 @@ class Other(Segment):
|
||||
|
||||
```
|
||||
|
||||
:::tips
|
||||
:::tip
|
||||
|
||||
或许你注意到了 `Segment` 上有一个 `children` 属性。
|
||||
|
||||
@ -291,7 +291,7 @@ msg.extend([Text("text")])
|
||||
|
||||
这里额外说明 `UniMessage.template` 的拓展控制符
|
||||
|
||||
相比 `Message`,UniMessage 对于 {:XXX} 做了另一类拓展。其能够识别例如 At(xxx, yyy) 或 Emoji(aaa, bbb)的字符串并执行
|
||||
相比 `Message`,UniMessage 对于 `{:XXX}` 做了另一类拓展。其能够识别例如 At(xxx, yyy) 或 Emoji(aaa, bbb)的字符串并执行
|
||||
|
||||
以 At(...) 为例:
|
||||
|
||||
@ -305,7 +305,7 @@ UniMessage(At("user", "123"))
|
||||
UniMessage(At("user", "123"))
|
||||
```
|
||||
|
||||
而在 `AlconnaMatcher` 中,{:XXX} 更进一步地提供了获取 `event` 和 `bot` 中的属性的功能:
|
||||
而在 `AlconnaMatcher` 中,`{:XXX}` 更进一步地提供了获取 `event` 和 `bot` 中的属性的功能:
|
||||
|
||||
```python title=在AlconnaMatcher中使用通用消息段的拓展控制符
|
||||
from arclet.alconna import Alconna, Args
|
||||
|
@ -7,7 +7,7 @@ description: 开源软件供应链点亮计划 - 暑期 2021
|
||||
|
||||
**开源软件供应链点亮计划 - 暑期 2021** 是**中国科学院软件研究所**与 **openEuler 社区**共同举办的一项面向高校学生的暑期活动,旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer.iscas.ac.cn/) 和 [帮助文档](https://summer.iscas.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区参与了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学在上面给出的活动官网报名,或通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区参与了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学在上面给出的活动官网报名,或通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot v1
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
description: 开源之夏 - 暑期 2022
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2022
|
||||
|
||||
**开源之夏 - 暑期 2022** 是由**开源软件供应链点亮计划**发起、由**中国科学院软件研究所**与 **openEuler 社区**主办的一项面向高校学生的暑期活动,类似 Google Summer of Code(GSoC),旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/#/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a/) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学加入 QQ 群 [737131827](https://jq.qq.com/?_wv=1027&k=PEgyGeEu) 或通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/#/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a/) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学加入 QQ 群 [737131827](https://jq.qq.com/?_wv=1027&k=PEgyGeEu) 或通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot2 命令行 CLI 交互体验升级
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
description: 开源之夏 - 暑期 2023
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2023
|
||||
|
||||
**开源之夏 - 暑期 2023** 是由**开源软件供应链点亮计划**发起、由**中国科学院软件研究所**与 **openEuler 社区**主办的一项面向高校学生的暑期活动,类似 Google Summer of Code(GSoC),旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot 项目管理图形化面板
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
description: 开源之夏 - 暑期 2024
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2024
|
||||
|
||||
**开源之夏 - 暑期 2024** 是**中国科学院软件研究所**发起的**开源软件供应链点亮计划**系列暑期活动,旨在鼓励高校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。活动联合各大开源社区,针对重要开源软件的开发与维护提供项目开发任务,并向全球高校学生开放报名。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NonePress 官网组件库更新与优化
|
||||
|
||||
|
@ -9,7 +9,7 @@ description: nonebot.consts 模块
|
||||
|
||||
## _var_ `RECEIVE_KEY` {#RECEIVE-KEY}
|
||||
|
||||
- **类型:** Literal['\_receive\_{id}']
|
||||
- **类型:** Literal['\_receive\_\{id\}']
|
||||
|
||||
- **说明:** `receive` 存储 key
|
||||
|
||||
@ -21,7 +21,7 @@ description: nonebot.consts 模块
|
||||
|
||||
## _var_ `ARG_KEY` {#ARG-KEY}
|
||||
|
||||
- **类型:** Literal['{key}']
|
||||
- **类型:** Literal['\{key\}']
|
||||
|
||||
- **说明:** `arg` 存储 key
|
||||
|
||||
|
@ -166,7 +166,7 @@ COMMON_CONFIG=common config # 这个配置项在任何环境中都会被加载
|
||||
在生产环境中,可以通过设置环境变量 `ENVIRONMENT=prod` 来确保 NoneBot 读取正确的环境配置。
|
||||
:::
|
||||
|
||||
#### .env.{ENVIRONMENT} 文件
|
||||
#### .env.\{ENVIRONMENT\} 文件
|
||||
|
||||
`.env.{ENVIRONMENT}` 文件类似于预设,可以让我们在多套不同的配置方案中灵活切换,默认 NoneBot 会读取 `.env.prod` 配置。如果你使用了 `nb-cli` 创建 `simple` 项目,那么将含有两套预设配置:`.env.dev` 和 `.env.prod`。
|
||||
|
||||
|
@ -71,14 +71,14 @@ alc = Alconna(".rd{roll:int}")
|
||||
assert alc.parse(".rd123").header["roll"] == 123
|
||||
```
|
||||
|
||||
Bracket Header 类似 python 里的 f-string 写法,通过 "{}" 声明匹配类型
|
||||
Bracket Header 类似 python 里的 f-string 写法,通过 `"{}"` 声明匹配类型
|
||||
|
||||
"{}" 中的内容为 "name:type or pat":
|
||||
`"{}"` 中的内容为 "name:type or pat":
|
||||
|
||||
- "{}", "{:}" ⇔ "(.+)", 占位符
|
||||
- "{foo}" ⇔ "(?P<foo>.+)"
|
||||
- "{:\d+}" ⇔ "(\d+)"
|
||||
- "{foo:int}" ⇔ "(?P<foo>\d+)",其中 "int" 部分若能转为 `BasePattern` 则读取里面的表达式
|
||||
- `"{}"`, `"{:}"` ⇔ `"(.+)"`, 占位符
|
||||
- `"{foo}"` ⇔ `"(?P<foo>.+)"`
|
||||
- `"{:\d+}"` ⇔ `"(\d+)"`
|
||||
- `"{foo:int}"` ⇔ `"(?P<foo>\d+)"`,其中 `"int"` 部分若能转为 `BasePattern` 则读取里面的表达式
|
||||
|
||||
## 参数声明(Args)
|
||||
|
||||
@ -321,7 +321,7 @@ opt2 = Option("--foo", default=OptionResult(value=False, args={"bar": 1}))
|
||||
- `keep_crlf`: 命令解析时是否保留换行字符
|
||||
- `compact`: 命令是否允许第一个参数紧随头部
|
||||
- `strict`: 命令是否严格匹配,若为 False 则未知参数将作为名为 $extra 的参数
|
||||
- `context_style`: 命令上下文插值的风格,None 为关闭,bracket 为 {...},parentheses 为 $(...)
|
||||
- `context_style`: 命令上下文插值的风格,None 为关闭,bracket 为 `{...}`,parentheses 为 `$(...)`
|
||||
- `extra`: 命令的自定义额外信息
|
||||
|
||||
元数据一定使用 `meta=...` 形式传入:
|
||||
|
@ -96,7 +96,7 @@ class Other(Segment):
|
||||
|
||||
```
|
||||
|
||||
:::tips
|
||||
:::tip
|
||||
|
||||
或许你注意到了 `Segment` 上有一个 `children` 属性。
|
||||
|
||||
@ -291,7 +291,7 @@ msg.extend([Text("text")])
|
||||
|
||||
这里额外说明 `UniMessage.template` 的拓展控制符
|
||||
|
||||
相比 `Message`,UniMessage 对于 {:XXX} 做了另一类拓展。其能够识别例如 At(xxx, yyy) 或 Emoji(aaa, bbb)的字符串并执行
|
||||
相比 `Message`,UniMessage 对于 `{:XXX}` 做了另一类拓展。其能够识别例如 At(xxx, yyy) 或 Emoji(aaa, bbb)的字符串并执行
|
||||
|
||||
以 At(...) 为例:
|
||||
|
||||
@ -305,7 +305,7 @@ UniMessage(At("user", "123"))
|
||||
UniMessage(At("user", "123"))
|
||||
```
|
||||
|
||||
而在 `AlconnaMatcher` 中,{:XXX} 更进一步地提供了获取 `event` 和 `bot` 中的属性的功能:
|
||||
而在 `AlconnaMatcher` 中,`{:XXX}` 更进一步地提供了获取 `event` 和 `bot` 中的属性的功能:
|
||||
|
||||
```python title=在AlconnaMatcher中使用通用消息段的拓展控制符
|
||||
from arclet.alconna import Alconna, Args
|
||||
|
@ -7,7 +7,7 @@ description: 开源软件供应链点亮计划 - 暑期 2021
|
||||
|
||||
**开源软件供应链点亮计划 - 暑期 2021** 是**中国科学院软件研究所**与 **openEuler 社区**共同举办的一项面向高校学生的暑期活动,旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer.iscas.ac.cn/) 和 [帮助文档](https://summer.iscas.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区参与了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学在上面给出的活动官网报名,或通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区参与了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学在上面给出的活动官网报名,或通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot v1
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
description: 开源之夏 - 暑期 2022
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2022
|
||||
|
||||
**开源之夏 - 暑期 2022** 是由**开源软件供应链点亮计划**发起、由**中国科学院软件研究所**与 **openEuler 社区**主办的一项面向高校学生的暑期活动,类似 Google Summer of Code(GSoC),旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/#/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a/) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学加入 QQ 群 [737131827](https://jq.qq.com/?_wv=1027&k=PEgyGeEu) 或通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/#/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a/) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学加入 QQ 群 [737131827](https://jq.qq.com/?_wv=1027&k=PEgyGeEu) 或通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot2 命令行 CLI 交互体验升级
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
description: 开源之夏 - 暑期 2023
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2023
|
||||
|
||||
**开源之夏 - 暑期 2023** 是由**开源软件供应链点亮计划**发起、由**中国科学院软件研究所**与 **openEuler 社区**主办的一项面向高校学生的暑期活动,类似 Google Summer of Code(GSoC),旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot 项目管理图形化面板
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
description: 开源之夏 - 暑期 2024
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2024
|
||||
|
||||
**开源之夏 - 暑期 2024** 是**中国科学院软件研究所**发起的**开源软件供应链点亮计划**系列暑期活动,旨在鼓励高校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。活动联合各大开源社区,针对重要开源软件的开发与维护提供项目开发任务,并向全球高校学生开放报名。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NonePress 官网组件库更新与优化
|
||||
|
||||
|
@ -9,7 +9,7 @@ description: nonebot.consts 模块
|
||||
|
||||
## _var_ `RECEIVE_KEY` {#RECEIVE-KEY}
|
||||
|
||||
- **类型:** Literal['\_receive\_{id}']
|
||||
- **类型:** Literal['\_receive\_\{id\}']
|
||||
|
||||
- **说明:** `receive` 存储 key
|
||||
|
||||
@ -21,7 +21,7 @@ description: nonebot.consts 模块
|
||||
|
||||
## _var_ `ARG_KEY` {#ARG-KEY}
|
||||
|
||||
- **类型:** Literal['{key}']
|
||||
- **类型:** Literal['\{key\}']
|
||||
|
||||
- **说明:** `arg` 存储 key
|
||||
|
||||
|
@ -166,7 +166,7 @@ COMMON_CONFIG=common config # 这个配置项在任何环境中都会被加载
|
||||
在生产环境中,可以通过设置环境变量 `ENVIRONMENT=prod` 来确保 NoneBot 读取正确的环境配置。
|
||||
:::
|
||||
|
||||
#### .env.{ENVIRONMENT} 文件
|
||||
#### .env.\{ENVIRONMENT\} 文件
|
||||
|
||||
`.env.{ENVIRONMENT}` 文件类似于预设,可以让我们在多套不同的配置方案中灵活切换,默认 NoneBot 会读取 `.env.prod` 配置。如果你使用了 `nb-cli` 创建 `simple` 项目,那么将含有两套预设配置:`.env.dev` 和 `.env.prod`。
|
||||
|
||||
|
@ -71,14 +71,14 @@ alc = Alconna(".rd{roll:int}")
|
||||
assert alc.parse(".rd123").header["roll"] == 123
|
||||
```
|
||||
|
||||
Bracket Header 类似 python 里的 f-string 写法,通过 "{}" 声明匹配类型
|
||||
Bracket Header 类似 python 里的 f-string 写法,通过 `"{}"` 声明匹配类型
|
||||
|
||||
"{}" 中的内容为 "name:type or pat":
|
||||
`"{}"` 中的内容为 "name:type or pat":
|
||||
|
||||
- "{}", "{:}" ⇔ "(.+)", 占位符
|
||||
- "{foo}" ⇔ "(?P<foo>.+)"
|
||||
- "{:\d+}" ⇔ "(\d+)"
|
||||
- "{foo:int}" ⇔ "(?P<foo>\d+)",其中 "int" 部分若能转为 `BasePattern` 则读取里面的表达式
|
||||
- `"{}"`, `"{:}"` ⇔ `"(.+)"`, 占位符
|
||||
- `"{foo}"` ⇔ `"(?P<foo>.+)"`
|
||||
- `"{:\d+}"` ⇔ `"(\d+)"`
|
||||
- `"{foo:int}"` ⇔ `"(?P<foo>\d+)"`,其中 `"int"` 部分若能转为 `BasePattern` 则读取里面的表达式
|
||||
|
||||
## 参数声明(Args)
|
||||
|
||||
@ -321,7 +321,7 @@ opt2 = Option("--foo", default=OptionResult(value=False, args={"bar": 1}))
|
||||
- `keep_crlf`: 命令解析时是否保留换行字符
|
||||
- `compact`: 命令是否允许第一个参数紧随头部
|
||||
- `strict`: 命令是否严格匹配,若为 False 则未知参数将作为名为 $extra 的参数
|
||||
- `context_style`: 命令上下文插值的风格,None 为关闭,bracket 为 {...},parentheses 为 $(...)
|
||||
- `context_style`: 命令上下文插值的风格,None 为关闭,bracket 为 `{...}`,parentheses 为 `$(...)`
|
||||
- `extra`: 命令的自定义额外信息
|
||||
|
||||
元数据一定使用 `meta=...` 形式传入:
|
||||
|
@ -96,7 +96,7 @@ class Other(Segment):
|
||||
|
||||
```
|
||||
|
||||
:::tips
|
||||
:::tip
|
||||
|
||||
或许你注意到了 `Segment` 上有一个 `children` 属性。
|
||||
|
||||
@ -291,7 +291,7 @@ msg.extend([Text("text")])
|
||||
|
||||
这里额外说明 `UniMessage.template` 的拓展控制符
|
||||
|
||||
相比 `Message`,UniMessage 对于 {:XXX} 做了另一类拓展。其能够识别例如 At(xxx, yyy) 或 Emoji(aaa, bbb)的字符串并执行
|
||||
相比 `Message`,UniMessage 对于 `{:XXX}` 做了另一类拓展。其能够识别例如 At(xxx, yyy) 或 Emoji(aaa, bbb)的字符串并执行
|
||||
|
||||
以 At(...) 为例:
|
||||
|
||||
@ -305,7 +305,7 @@ UniMessage(At("user", "123"))
|
||||
UniMessage(At("user", "123"))
|
||||
```
|
||||
|
||||
而在 `AlconnaMatcher` 中,{:XXX} 更进一步地提供了获取 `event` 和 `bot` 中的属性的功能:
|
||||
而在 `AlconnaMatcher` 中,`{:XXX}` 更进一步地提供了获取 `event` 和 `bot` 中的属性的功能:
|
||||
|
||||
```python title=在AlconnaMatcher中使用通用消息段的拓展控制符
|
||||
from arclet.alconna import Alconna, Args
|
||||
|
@ -7,7 +7,7 @@ description: 开源软件供应链点亮计划 - 暑期 2021
|
||||
|
||||
**开源软件供应链点亮计划 - 暑期 2021** 是**中国科学院软件研究所**与 **openEuler 社区**共同举办的一项面向高校学生的暑期活动,旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer.iscas.ac.cn/) 和 [帮助文档](https://summer.iscas.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区参与了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学在上面给出的活动官网报名,或通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区参与了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学在上面给出的活动官网报名,或通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot v1
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
description: 开源之夏 - 暑期 2022
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2022
|
||||
|
||||
**开源之夏 - 暑期 2022** 是由**开源软件供应链点亮计划**发起、由**中国科学院软件研究所**与 **openEuler 社区**主办的一项面向高校学生的暑期活动,类似 Google Summer of Code(GSoC),旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/#/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a/) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学加入 QQ 群 [737131827](https://jq.qq.com/?_wv=1027&k=PEgyGeEu) 或通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/#/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a/) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学加入 QQ 群 [737131827](https://jq.qq.com/?_wv=1027&k=PEgyGeEu) 或通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot2 命令行 CLI 交互体验升级
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
description: 开源之夏 - 暑期 2023
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2023
|
||||
|
||||
**开源之夏 - 暑期 2023** 是由**开源软件供应链点亮计划**发起、由**中国科学院软件研究所**与 **openEuler 社区**主办的一项面向高校学生的暑期活动,类似 Google Summer of Code(GSoC),旨在鼓励在校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NoneBot 项目管理图形化面板
|
||||
|
||||
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
description: 开源之夏 - 暑期 2024
|
||||
mdx:
|
||||
format: md
|
||||
---
|
||||
|
||||
# 暑期 2024
|
||||
|
||||
**开源之夏 - 暑期 2024** 是**中国科学院软件研究所**发起的**开源软件供应链点亮计划**系列暑期活动,旨在鼓励高校学生积极参与开源软件的开发维护,促进优秀开源软件社区的蓬勃发展。活动联合各大开源社区,针对重要开源软件的开发与维护提供项目开发任务,并向全球高校学生开放报名。关于具体的活动规划、报名方式,请查看该活动的 [官网](https://summer-ospp.ac.cn/) 和 [帮助文档](https://summer-ospp.ac.cn/help/)。
|
||||
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 <contact@nonebot.dev> 联系我们。
|
||||
NoneBot 社区有幸作为开源社区 [参与](https://summer-ospp.ac.cn/org/orgdetail/e1fb5b8d-125a-4138-b756-25bd32c0a31a?lang=zh) 了本次活动,下面列出了目前我们已经发布的项目,欢迎感兴趣的同学通过 [contact@nonebot.dev](mailto:contact@nonebot.dev) 联系我们。
|
||||
|
||||
## NonePress 官网组件库更新与优化
|
||||
|
||||
|
@ -123,5 +123,35 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"changelog": [
|
||||
{
|
||||
"type": "category",
|
||||
"label": "更新日志",
|
||||
"collapsible": false,
|
||||
"items": [
|
||||
{
|
||||
"type": "link",
|
||||
"label": "最近更新",
|
||||
"href": "/changelog/"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"label": "v2.1.0",
|
||||
"href": "/changelog/v2.1.0"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"label": "v2.0.0-beta.2",
|
||||
"href": "/changelog/v2.0.0-beta.2"
|
||||
},
|
||||
{
|
||||
"type": "link",
|
||||
"label": "v2.0.0a7",
|
||||
"href": "/changelog/v2.0.0a7"
|
||||
}
|
||||
],
|
||||
"collapsed": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user