From fbaf19e454506452833637cb789a250a3b719e9c Mon Sep 17 00:00:00 2001 From: Mix <32300164+mnixry@users.noreply.github.com> Date: Fri, 1 Jan 2021 15:16:55 +0800 Subject: [PATCH 1/7] :critical: fix group event serialization error --- nonebot/adapters/cqhttp/event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nonebot/adapters/cqhttp/event.py b/nonebot/adapters/cqhttp/event.py index 5d1cdb2f..39e78943 100644 --- a/nonebot/adapters/cqhttp/event.py +++ b/nonebot/adapters/cqhttp/event.py @@ -184,7 +184,7 @@ class GroupMessageEvent(MessageEvent): __event__ = "message.group" message_type: Literal["group"] group_id: int - anonymous: Anonymous + anonymous: Optional[Anonymous] = None @overrides(Event) def get_event_description(self) -> str: From 5cc5375cb588bc9297c5189d613ab8190d5cf075 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Fri, 1 Jan 2021 18:01:05 +0800 Subject: [PATCH 2/7] :bug: fix missing group_id when PokeNotifyEvent --- nonebot/adapters/cqhttp/event.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nonebot/adapters/cqhttp/event.py b/nonebot/adapters/cqhttp/event.py index 39e78943..678ce504 100644 --- a/nonebot/adapters/cqhttp/event.py +++ b/nonebot/adapters/cqhttp/event.py @@ -319,6 +319,7 @@ class PokeNotifyEvent(NotifyEvent): __event__ = "notice.notify.poke" sub_type: Literal["poke"] target_id: int + group_id: Optional[int] = None @overrides(Event) def is_tome(self) -> bool: From b446fcc9293c85175965308a92ac0a84dd1a9a61 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Fri, 1 Jan 2021 18:18:01 +0800 Subject: [PATCH 3/7] :bug: fix action failed info display error --- nonebot/adapters/cqhttp/exception.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nonebot/adapters/cqhttp/exception.py b/nonebot/adapters/cqhttp/exception.py index aeeb11be..af3ae6cd 100644 --- a/nonebot/adapters/cqhttp/exception.py +++ b/nonebot/adapters/cqhttp/exception.py @@ -28,7 +28,8 @@ class ActionFailed(BaseActionFailed, CQHTTPAdapterException): self.info = kwargs def __repr__(self): - return f"" + return f"" def __str__(self): return self.__repr__() From db7e10cb4d8b1dcba9a18f700f0ff1dbf41c102f Mon Sep 17 00:00:00 2001 From: Lan <59906398+Lancercmd@users.noreply.github.com> Date: Fri, 1 Jan 2021 18:21:02 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/guide/creating-a-matcher.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/creating-a-matcher.md b/docs/guide/creating-a-matcher.md index 09603855..1e5a4299 100644 --- a/docs/guide/creating-a-matcher.md +++ b/docs/guide/creating-a-matcher.md @@ -21,7 +21,7 @@ async def handle_first_receive(bot: Bot, event: Event, state: T_State): @weather.got("city", prompt="你想查询哪个城市的天气呢?") -async def handle_city(bot: Bot, event: Event, state: State): +async def handle_city(bot: Bot, event: Event, state: T_State): city = state["city"] if city not in ["上海", "北京"]: await weather.reject("你想查询的城市暂不支持,请重新输入!") From 8f69b2449d17687f275ff44973202a2497b622eb Mon Sep 17 00:00:00 2001 From: Lan <59906398+Lancercmd@users.noreply.github.com> Date: Fri, 1 Jan 2021 19:21:46 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=93=9D=20Update=20creating-a-matcher.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/guide/creating-a-matcher.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/guide/creating-a-matcher.md b/docs/guide/creating-a-matcher.md index 1e5a4299..182885fe 100644 --- a/docs/guide/creating-a-matcher.md +++ b/docs/guide/creating-a-matcher.md @@ -115,16 +115,17 @@ rule 的出现使得 nonebot 对事件的响应可以非常自由,nonebot 内 ```python from nonebot.rule import Rule +from nonebot.typing import T_State -async def async_checker(bot: Bot, event: Event, state: State) -> bool: +async def async_checker(bot: Bot, event: Event, state: T_State) -> bool: return True -def sync_checker(bot: Bot, event: Event, state: State) -> bool: +def sync_checker(bot: Bot, event: Event, state: T_State) -> bool: return True def check(arg1, args2): - async def _checker(bot: Bot, event: Event, state: State) -> bool: + async def _checker(bot: Bot, event: Event, state: T_State) -> bool: return bool(arg1 + arg2) return Rule(_check) From 996c57df6220a2ba66d681e425892c8d62c1157a Mon Sep 17 00:00:00 2001 From: Lan <59906398+Lancercmd@users.noreply.github.com> Date: Fri, 1 Jan 2021 19:23:51 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=93=9D=20Update=20creating-a-handler.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/guide/creating-a-handler.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guide/creating-a-handler.md b/docs/guide/creating-a-handler.md index 5b6b0591..723aeeff 100644 --- a/docs/guide/creating-a-handler.md +++ b/docs/guide/creating-a-handler.md @@ -69,7 +69,7 @@ async def handle2(bot: Bot, event: Event, state: T_State): ```python @matcher.got("key1") @matcher.got("key2") -async def handle(bot: Bot, event: Event, state: State): +async def handle(bot: Bot, event: Event, state: T_State): pass ``` @@ -169,12 +169,12 @@ matcher = on_command("test") # 修改默认参数处理 @matcher.args_parser -async def parse(bot: Bot, event: Event, state: State): +async def parse(bot: Bot, event: Event, state: T_State): print(state["_current_key"], ":", str(event.get_message())) state[state["_current_key"]] = str(event.get_message()) @matcher.handle() -async def first_receive(bot: Bot, event: Event, state: State): +async def first_receive(bot: Bot, event: Event, state: T_State): # 获取用户原始命令,如:/test print(state["_prefix"]["raw_command"]) # 处理用户输入参数,如:/test arg1 arg2 @@ -186,7 +186,7 @@ async def first_receive(bot: Bot, event: Event, state: State): @matcher.got("arg1", prompt="参数?") -async def arg_handle(bot: Bot, event: Event, state: State): +async def arg_handle(bot: Bot, event: Event, state: T_State): # 在这里对参数进行验证 if state["arg1"] not in ["allow", "list"]: await matcher.reject("参数不正确!请重新输入") From 38ab392b91c355f1468cf3cf9425944da1d16d47 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Fri, 1 Jan 2021 23:47:51 +0800 Subject: [PATCH 7/7] :ambulance: Fix Release 2.0.0a8.post1 --- archive/{2.0.0a8 => 2.0.0a8.post1}/README.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/advanced/README.md | 0 .../advanced/export-and-require.md | 0 .../advanced/overloaded-handlers.md | 0 .../{2.0.0a8 => 2.0.0a8.post1}/advanced/permission.md | 0 .../advanced/publish-plugin.md | 0 .../{2.0.0a8 => 2.0.0a8.post1}/advanced/runtime-hook.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/advanced/scheduler.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/README.md | 0 .../{2.0.0a8 => 2.0.0a8.post1}/api/adapters/README.md | 0 .../{2.0.0a8 => 2.0.0a8.post1}/api/adapters/cqhttp.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/adapters/ding.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/config.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/drivers/README.md | 0 .../{2.0.0a8 => 2.0.0a8.post1}/api/drivers/fastapi.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/exception.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/log.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/matcher.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/message.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/nonebot.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/permission.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/plugin.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/rule.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/typing.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/api/utils.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/guide/README.md | 0 .../guide/basic-configuration.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/guide/cqhttp-guide.md | 0 .../guide/creating-a-handler.md | 8 ++++---- .../guide/creating-a-matcher.md | 9 +++++---- .../guide/creating-a-plugin.md | 0 .../guide/creating-a-project.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/guide/ding-guide.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/guide/end-or-start.md | 0 .../{2.0.0a8 => 2.0.0a8.post1}/guide/getting-started.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/guide/installation.md | 0 .../{2.0.0a8 => 2.0.0a8.post1}/guide/loading-a-plugin.md | 0 archive/{2.0.0a8 => 2.0.0a8.post1}/sidebar.config.json | 0 docs/.vuepress/versions.json | 2 +- pyproject.toml | 2 +- 40 files changed, 11 insertions(+), 10 deletions(-) rename archive/{2.0.0a8 => 2.0.0a8.post1}/README.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/advanced/README.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/advanced/export-and-require.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/advanced/overloaded-handlers.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/advanced/permission.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/advanced/publish-plugin.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/advanced/runtime-hook.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/advanced/scheduler.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/README.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/adapters/README.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/adapters/cqhttp.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/adapters/ding.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/config.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/drivers/README.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/drivers/fastapi.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/exception.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/log.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/matcher.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/message.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/nonebot.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/permission.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/plugin.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/rule.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/typing.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/api/utils.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/README.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/basic-configuration.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/cqhttp-guide.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/creating-a-handler.md (96%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/creating-a-matcher.md (94%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/creating-a-plugin.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/creating-a-project.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/ding-guide.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/end-or-start.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/getting-started.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/installation.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/guide/loading-a-plugin.md (100%) rename archive/{2.0.0a8 => 2.0.0a8.post1}/sidebar.config.json (100%) diff --git a/archive/2.0.0a8/README.md b/archive/2.0.0a8.post1/README.md similarity index 100% rename from archive/2.0.0a8/README.md rename to archive/2.0.0a8.post1/README.md diff --git a/archive/2.0.0a8/advanced/README.md b/archive/2.0.0a8.post1/advanced/README.md similarity index 100% rename from archive/2.0.0a8/advanced/README.md rename to archive/2.0.0a8.post1/advanced/README.md diff --git a/archive/2.0.0a8/advanced/export-and-require.md b/archive/2.0.0a8.post1/advanced/export-and-require.md similarity index 100% rename from archive/2.0.0a8/advanced/export-and-require.md rename to archive/2.0.0a8.post1/advanced/export-and-require.md diff --git a/archive/2.0.0a8/advanced/overloaded-handlers.md b/archive/2.0.0a8.post1/advanced/overloaded-handlers.md similarity index 100% rename from archive/2.0.0a8/advanced/overloaded-handlers.md rename to archive/2.0.0a8.post1/advanced/overloaded-handlers.md diff --git a/archive/2.0.0a8/advanced/permission.md b/archive/2.0.0a8.post1/advanced/permission.md similarity index 100% rename from archive/2.0.0a8/advanced/permission.md rename to archive/2.0.0a8.post1/advanced/permission.md diff --git a/archive/2.0.0a8/advanced/publish-plugin.md b/archive/2.0.0a8.post1/advanced/publish-plugin.md similarity index 100% rename from archive/2.0.0a8/advanced/publish-plugin.md rename to archive/2.0.0a8.post1/advanced/publish-plugin.md diff --git a/archive/2.0.0a8/advanced/runtime-hook.md b/archive/2.0.0a8.post1/advanced/runtime-hook.md similarity index 100% rename from archive/2.0.0a8/advanced/runtime-hook.md rename to archive/2.0.0a8.post1/advanced/runtime-hook.md diff --git a/archive/2.0.0a8/advanced/scheduler.md b/archive/2.0.0a8.post1/advanced/scheduler.md similarity index 100% rename from archive/2.0.0a8/advanced/scheduler.md rename to archive/2.0.0a8.post1/advanced/scheduler.md diff --git a/archive/2.0.0a8/api/README.md b/archive/2.0.0a8.post1/api/README.md similarity index 100% rename from archive/2.0.0a8/api/README.md rename to archive/2.0.0a8.post1/api/README.md diff --git a/archive/2.0.0a8/api/adapters/README.md b/archive/2.0.0a8.post1/api/adapters/README.md similarity index 100% rename from archive/2.0.0a8/api/adapters/README.md rename to archive/2.0.0a8.post1/api/adapters/README.md diff --git a/archive/2.0.0a8/api/adapters/cqhttp.md b/archive/2.0.0a8.post1/api/adapters/cqhttp.md similarity index 100% rename from archive/2.0.0a8/api/adapters/cqhttp.md rename to archive/2.0.0a8.post1/api/adapters/cqhttp.md diff --git a/archive/2.0.0a8/api/adapters/ding.md b/archive/2.0.0a8.post1/api/adapters/ding.md similarity index 100% rename from archive/2.0.0a8/api/adapters/ding.md rename to archive/2.0.0a8.post1/api/adapters/ding.md diff --git a/archive/2.0.0a8/api/config.md b/archive/2.0.0a8.post1/api/config.md similarity index 100% rename from archive/2.0.0a8/api/config.md rename to archive/2.0.0a8.post1/api/config.md diff --git a/archive/2.0.0a8/api/drivers/README.md b/archive/2.0.0a8.post1/api/drivers/README.md similarity index 100% rename from archive/2.0.0a8/api/drivers/README.md rename to archive/2.0.0a8.post1/api/drivers/README.md diff --git a/archive/2.0.0a8/api/drivers/fastapi.md b/archive/2.0.0a8.post1/api/drivers/fastapi.md similarity index 100% rename from archive/2.0.0a8/api/drivers/fastapi.md rename to archive/2.0.0a8.post1/api/drivers/fastapi.md diff --git a/archive/2.0.0a8/api/exception.md b/archive/2.0.0a8.post1/api/exception.md similarity index 100% rename from archive/2.0.0a8/api/exception.md rename to archive/2.0.0a8.post1/api/exception.md diff --git a/archive/2.0.0a8/api/log.md b/archive/2.0.0a8.post1/api/log.md similarity index 100% rename from archive/2.0.0a8/api/log.md rename to archive/2.0.0a8.post1/api/log.md diff --git a/archive/2.0.0a8/api/matcher.md b/archive/2.0.0a8.post1/api/matcher.md similarity index 100% rename from archive/2.0.0a8/api/matcher.md rename to archive/2.0.0a8.post1/api/matcher.md diff --git a/archive/2.0.0a8/api/message.md b/archive/2.0.0a8.post1/api/message.md similarity index 100% rename from archive/2.0.0a8/api/message.md rename to archive/2.0.0a8.post1/api/message.md diff --git a/archive/2.0.0a8/api/nonebot.md b/archive/2.0.0a8.post1/api/nonebot.md similarity index 100% rename from archive/2.0.0a8/api/nonebot.md rename to archive/2.0.0a8.post1/api/nonebot.md diff --git a/archive/2.0.0a8/api/permission.md b/archive/2.0.0a8.post1/api/permission.md similarity index 100% rename from archive/2.0.0a8/api/permission.md rename to archive/2.0.0a8.post1/api/permission.md diff --git a/archive/2.0.0a8/api/plugin.md b/archive/2.0.0a8.post1/api/plugin.md similarity index 100% rename from archive/2.0.0a8/api/plugin.md rename to archive/2.0.0a8.post1/api/plugin.md diff --git a/archive/2.0.0a8/api/rule.md b/archive/2.0.0a8.post1/api/rule.md similarity index 100% rename from archive/2.0.0a8/api/rule.md rename to archive/2.0.0a8.post1/api/rule.md diff --git a/archive/2.0.0a8/api/typing.md b/archive/2.0.0a8.post1/api/typing.md similarity index 100% rename from archive/2.0.0a8/api/typing.md rename to archive/2.0.0a8.post1/api/typing.md diff --git a/archive/2.0.0a8/api/utils.md b/archive/2.0.0a8.post1/api/utils.md similarity index 100% rename from archive/2.0.0a8/api/utils.md rename to archive/2.0.0a8.post1/api/utils.md diff --git a/archive/2.0.0a8/guide/README.md b/archive/2.0.0a8.post1/guide/README.md similarity index 100% rename from archive/2.0.0a8/guide/README.md rename to archive/2.0.0a8.post1/guide/README.md diff --git a/archive/2.0.0a8/guide/basic-configuration.md b/archive/2.0.0a8.post1/guide/basic-configuration.md similarity index 100% rename from archive/2.0.0a8/guide/basic-configuration.md rename to archive/2.0.0a8.post1/guide/basic-configuration.md diff --git a/archive/2.0.0a8/guide/cqhttp-guide.md b/archive/2.0.0a8.post1/guide/cqhttp-guide.md similarity index 100% rename from archive/2.0.0a8/guide/cqhttp-guide.md rename to archive/2.0.0a8.post1/guide/cqhttp-guide.md diff --git a/archive/2.0.0a8/guide/creating-a-handler.md b/archive/2.0.0a8.post1/guide/creating-a-handler.md similarity index 96% rename from archive/2.0.0a8/guide/creating-a-handler.md rename to archive/2.0.0a8.post1/guide/creating-a-handler.md index 5b6b0591..723aeeff 100644 --- a/archive/2.0.0a8/guide/creating-a-handler.md +++ b/archive/2.0.0a8.post1/guide/creating-a-handler.md @@ -69,7 +69,7 @@ async def handle2(bot: Bot, event: Event, state: T_State): ```python @matcher.got("key1") @matcher.got("key2") -async def handle(bot: Bot, event: Event, state: State): +async def handle(bot: Bot, event: Event, state: T_State): pass ``` @@ -169,12 +169,12 @@ matcher = on_command("test") # 修改默认参数处理 @matcher.args_parser -async def parse(bot: Bot, event: Event, state: State): +async def parse(bot: Bot, event: Event, state: T_State): print(state["_current_key"], ":", str(event.get_message())) state[state["_current_key"]] = str(event.get_message()) @matcher.handle() -async def first_receive(bot: Bot, event: Event, state: State): +async def first_receive(bot: Bot, event: Event, state: T_State): # 获取用户原始命令,如:/test print(state["_prefix"]["raw_command"]) # 处理用户输入参数,如:/test arg1 arg2 @@ -186,7 +186,7 @@ async def first_receive(bot: Bot, event: Event, state: State): @matcher.got("arg1", prompt="参数?") -async def arg_handle(bot: Bot, event: Event, state: State): +async def arg_handle(bot: Bot, event: Event, state: T_State): # 在这里对参数进行验证 if state["arg1"] not in ["allow", "list"]: await matcher.reject("参数不正确!请重新输入") diff --git a/archive/2.0.0a8/guide/creating-a-matcher.md b/archive/2.0.0a8.post1/guide/creating-a-matcher.md similarity index 94% rename from archive/2.0.0a8/guide/creating-a-matcher.md rename to archive/2.0.0a8.post1/guide/creating-a-matcher.md index 09603855..182885fe 100644 --- a/archive/2.0.0a8/guide/creating-a-matcher.md +++ b/archive/2.0.0a8.post1/guide/creating-a-matcher.md @@ -21,7 +21,7 @@ async def handle_first_receive(bot: Bot, event: Event, state: T_State): @weather.got("city", prompt="你想查询哪个城市的天气呢?") -async def handle_city(bot: Bot, event: Event, state: State): +async def handle_city(bot: Bot, event: Event, state: T_State): city = state["city"] if city not in ["上海", "北京"]: await weather.reject("你想查询的城市暂不支持,请重新输入!") @@ -115,16 +115,17 @@ rule 的出现使得 nonebot 对事件的响应可以非常自由,nonebot 内 ```python from nonebot.rule import Rule +from nonebot.typing import T_State -async def async_checker(bot: Bot, event: Event, state: State) -> bool: +async def async_checker(bot: Bot, event: Event, state: T_State) -> bool: return True -def sync_checker(bot: Bot, event: Event, state: State) -> bool: +def sync_checker(bot: Bot, event: Event, state: T_State) -> bool: return True def check(arg1, args2): - async def _checker(bot: Bot, event: Event, state: State) -> bool: + async def _checker(bot: Bot, event: Event, state: T_State) -> bool: return bool(arg1 + arg2) return Rule(_check) diff --git a/archive/2.0.0a8/guide/creating-a-plugin.md b/archive/2.0.0a8.post1/guide/creating-a-plugin.md similarity index 100% rename from archive/2.0.0a8/guide/creating-a-plugin.md rename to archive/2.0.0a8.post1/guide/creating-a-plugin.md diff --git a/archive/2.0.0a8/guide/creating-a-project.md b/archive/2.0.0a8.post1/guide/creating-a-project.md similarity index 100% rename from archive/2.0.0a8/guide/creating-a-project.md rename to archive/2.0.0a8.post1/guide/creating-a-project.md diff --git a/archive/2.0.0a8/guide/ding-guide.md b/archive/2.0.0a8.post1/guide/ding-guide.md similarity index 100% rename from archive/2.0.0a8/guide/ding-guide.md rename to archive/2.0.0a8.post1/guide/ding-guide.md diff --git a/archive/2.0.0a8/guide/end-or-start.md b/archive/2.0.0a8.post1/guide/end-or-start.md similarity index 100% rename from archive/2.0.0a8/guide/end-or-start.md rename to archive/2.0.0a8.post1/guide/end-or-start.md diff --git a/archive/2.0.0a8/guide/getting-started.md b/archive/2.0.0a8.post1/guide/getting-started.md similarity index 100% rename from archive/2.0.0a8/guide/getting-started.md rename to archive/2.0.0a8.post1/guide/getting-started.md diff --git a/archive/2.0.0a8/guide/installation.md b/archive/2.0.0a8.post1/guide/installation.md similarity index 100% rename from archive/2.0.0a8/guide/installation.md rename to archive/2.0.0a8.post1/guide/installation.md diff --git a/archive/2.0.0a8/guide/loading-a-plugin.md b/archive/2.0.0a8.post1/guide/loading-a-plugin.md similarity index 100% rename from archive/2.0.0a8/guide/loading-a-plugin.md rename to archive/2.0.0a8.post1/guide/loading-a-plugin.md diff --git a/archive/2.0.0a8/sidebar.config.json b/archive/2.0.0a8.post1/sidebar.config.json similarity index 100% rename from archive/2.0.0a8/sidebar.config.json rename to archive/2.0.0a8.post1/sidebar.config.json diff --git a/docs/.vuepress/versions.json b/docs/.vuepress/versions.json index 39a1ab33..361c0744 100644 --- a/docs/.vuepress/versions.json +++ b/docs/.vuepress/versions.json @@ -1,4 +1,4 @@ [ - "2.0.0a8", + "2.0.0a8.post1", "2.0.0a7" ] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e69a93e1..e3de0817 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nonebot2" -version = "2.0.0-alpha.8" +version = "2.0.0-alpha.8.post1" description = "An asynchronous python bot framework." authors = ["yanyongyu "] license = "MIT"