📝 Update changelog
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 3s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Failing after 3s
Ruff Lint / Ruff Lint (push) Failing after 3s
Site Deploy / publish (push) Failing after 3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 1m34s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 3m3s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 3m31s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 3m59s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled

This commit is contained in:
noneflow[bot]
2025-08-25 15:02:13 +00:00
parent e2463e9e39
commit 9e9c1a27e5
90 changed files with 1 additions and 2157 deletions

View File

@ -18,11 +18,9 @@ description: nonebot.utils 模块
参考: [loguru color 标签](https://loguru.readthedocs.io/en/stable/api/logger.html#color)
- **参数**
- `s` (str): 需要转义的字符串
- **返回**
- str
## _def_ `deep_update(mapping, *updating_mappings)` {#deep-update}
@ -30,13 +28,11 @@ description: nonebot.utils 模块
- **说明:** 深度更新合并字典
- **参数**
- `mapping` (dict[K, Any])
- `*updating_mappings` (dict[K, Any])
- **返回**
- dict[K, Any]
## _def_ `lenient_issubclass(cls, class_or_tuple)` {#lenient-issubclass}
@ -44,13 +40,11 @@ description: nonebot.utils 模块
- **说明:** 检查 cls 是否是 class_or_tuple 中的一个类型子类并忽略类型错误。
- **参数**
- `cls` (Any)
- `class_or_tuple` (type[Any] | tuple[type[Any], ...])
- **返回**
- bool
## _def_ `generic_check_issubclass(cls, class_or_tuple)` {#generic-check-issubclass}
@ -60,7 +54,6 @@ description: nonebot.utils 模块
检查 cls 是否是 class_or_tuple 中的一个类型子类。
特别的:
- 如果 cls 是 `typing.Union``types.UnionType` 类型,
则会检查其中的所有类型是否是 class_or_tuple 中一个类型的子类或 None。
- 如果 cls 是 `typing.Literal` 类型,
@ -70,13 +63,11 @@ description: nonebot.utils 模块
是否是 class_or_tuple 中一个类型的子类或 None。
- **参数**
- `cls` (Any)
- `class_or_tuple` (type[Any] | tuple[type[Any], ...])
- **返回**
- bool
## _def_ `type_is_complex(type_)` {#type-is-complex}
@ -84,11 +75,9 @@ description: nonebot.utils 模块
- **说明:** 检查 type\_ 是否是复杂类型
- **参数**
- `type_` (type[Any])
- **返回**
- bool
## _def_ `is_coroutine_callable(call)` {#is-coroutine-callable}
@ -96,11 +85,9 @@ description: nonebot.utils 模块
- **说明:** 检查 call 是否是一个 callable 协程函数
- **参数**
- `call` ((...) -> Any)
- **返回**
- bool
## _def_ `is_gen_callable(call)` {#is-gen-callable}
@ -108,11 +95,9 @@ description: nonebot.utils 模块
- **说明:** 检查 call 是否是一个生成器函数
- **参数**
- `call` ((...) -> Any)
- **返回**
- bool
## _def_ `is_async_gen_callable(call)` {#is-async-gen-callable}
@ -120,11 +105,9 @@ description: nonebot.utils 模块
- **说明:** 检查 call 是否是一个异步生成器函数
- **参数**
- `call` ((...) -> Any)
- **返回**
- bool
## _def_ `run_sync(call)` {#run-sync}
@ -132,11 +115,9 @@ description: nonebot.utils 模块
- **说明:** 一个用于包装 sync function 为 async function 的装饰器
- **参数**
- `call` ((P) -> R): 被装饰的同步函数
- **返回**
- (P) -> Coroutine[None, None, R]
## _def_ `run_sync_ctx_manager(cm)` {#run-sync-ctx-manager}
@ -144,11 +125,9 @@ description: nonebot.utils 模块
- **说明:** 一个用于包装 sync context manager 为 async context manager 的执行函数
- **参数**
- `cm` (AbstractContextManager[T])
- **返回**
- AsyncGenerator[T, None]
## _async def_ `run_coro_with_catch(coro, exc, return_on_err=None)` {#run-coro-with-catch}
@ -158,9 +137,7 @@ description: nonebot.utils 模块
- **重载**
**1.** `(coro, exc, return_on_err=None) -> T | None`
- **参数**
- `coro` (Coroutine[Any, Any, T])
- `exc` (tuple[type[Exception], ...])
@ -168,13 +145,10 @@ description: nonebot.utils 模块
- `return_on_err` (None)
- **返回**
- T | None
**2.** `(coro, exc, return_on_err) -> T | R`
- **参数**
- `coro` (Coroutine[Any, Any, T])
- `exc` (tuple[type[Exception], ...])
@ -182,11 +156,9 @@ description: nonebot.utils 模块
- `return_on_err` (R)
- **返回**
- T | R
- **参数**
- `coro`: 要运行的协程
- `exc`: 要捕获的异常
@ -202,21 +174,17 @@ description: nonebot.utils 模块
- **说明:** 运行协程并在取消时屏蔽取消异常。
- **参数**
- `coro` (Coroutine[Any, Any, T]): 要运行的协程
- **返回**
- T: 协程的返回值
## _def_ `flatten_exception_group(exc_group)` {#flatten-exception-group}
- **参数**
- `exc_group` (BaseExceptionGroup[E])
- **返回**
- Generator[E, None, None]
## _def_ `get_name(obj)` {#get-name}
@ -224,11 +192,9 @@ description: nonebot.utils 模块
- **说明:** 获取对象的名称
- **参数**
- `obj` (Any)
- **返回**
- str
## _def_ `path_to_module_name(path)` {#path-to-module-name}
@ -236,11 +202,9 @@ description: nonebot.utils 模块
- **说明:** 转换路径为模块名
- **参数**
- `path` (Path)
- **返回**
- str
## _def_ `resolve_dot_notation(obj_str, default_attr, default_prefix=None)` {#resolve-dot-notation}
@ -248,7 +212,6 @@ description: nonebot.utils 模块
- **说明:** 解析并导入点分表示法的对象
- **参数**
- `obj_str` (str)
- `default_attr` (str)
@ -256,7 +219,6 @@ description: nonebot.utils 模块
- `default_prefix` (str | None)
- **返回**
- Any
## _class_ `classproperty(func)` {#classproperty}
@ -264,7 +226,6 @@ description: nonebot.utils 模块
- **说明:** 类属性装饰器
- **参数**
- `func` ((Any) -> T)
## _class_ `DataclassEncoder(<auto>)` {#DataclassEncoder}
@ -278,11 +239,9 @@ description: nonebot.utils 模块
### _method_ `default(o)` {#DataclassEncoder-default}
- **参数**
- `o`
- **返回**
- untyped
## _def_ `logger_wrapper(logger_name)` {#logger-wrapper}
@ -290,15 +249,12 @@ description: nonebot.utils 模块
- **说明:** 用于打印 adapter 的日志。
- **参数**
- `logger_name` (str): adapter 的名称
- **返回**
- untyped: 日志记录函数
日志记录函数的参数:
- level: 日志等级
- message: 日志信息
- exception: 异常信息