2022-01-19 16:16:56 +08:00
|
|
|
|
"""本模块包含了 NoneBot 的一些工具函数
|
|
|
|
|
|
2022-01-16 11:30:09 +08:00
|
|
|
|
FrontMatter:
|
|
|
|
|
sidebar_position: 8
|
|
|
|
|
description: nonebot.utils 模块
|
|
|
|
|
"""
|
|
|
|
|
|
2020-09-30 18:01:31 +08:00
|
|
|
|
import re
|
2020-08-10 13:06:02 +08:00
|
|
|
|
import json
|
2020-08-14 17:41:24 +08:00
|
|
|
|
import asyncio
|
2021-11-12 18:10:40 +08:00
|
|
|
|
import inspect
|
2020-08-10 13:06:02 +08:00
|
|
|
|
import dataclasses
|
2022-08-31 10:07:14 +08:00
|
|
|
|
from pathlib import Path
|
2020-08-14 17:41:24 +08:00
|
|
|
|
from functools import wraps, partial
|
2021-11-15 01:28:47 +08:00
|
|
|
|
from contextlib import asynccontextmanager
|
2021-11-16 18:30:16 +08:00
|
|
|
|
from typing_extensions import ParamSpec, get_args, get_origin
|
2021-11-22 23:21:26 +08:00
|
|
|
|
from typing import (
|
|
|
|
|
Any,
|
|
|
|
|
Type,
|
|
|
|
|
Tuple,
|
|
|
|
|
Union,
|
|
|
|
|
TypeVar,
|
|
|
|
|
Callable,
|
|
|
|
|
Optional,
|
2022-02-11 11:25:31 +08:00
|
|
|
|
Coroutine,
|
2021-11-22 23:21:26 +08:00
|
|
|
|
AsyncGenerator,
|
|
|
|
|
ContextManager,
|
2022-08-14 19:41:00 +08:00
|
|
|
|
overload,
|
2021-11-22 23:21:26 +08:00
|
|
|
|
)
|
2020-08-10 13:06:02 +08:00
|
|
|
|
|
2022-01-28 14:27:54 +08:00
|
|