mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-09 13:50:00 +08:00
🐛 修复群组申请通知 (#2026)
检查bot是否运行正常 / bot check (push) Waiting to run
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
Sequential Lint and Type Check / ruff-call (push) Waiting to run
Sequential Lint and Type Check / pyright-call (push) Blocked by required conditions
Release Drafter / Update Release Draft (push) Waiting to run
Force Sync to Aliyun / sync (push) Waiting to run
Update Version / update-version (push) Waiting to run
检查bot是否运行正常 / bot check (push) Waiting to run
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
Sequential Lint and Type Check / ruff-call (push) Waiting to run
Sequential Lint and Type Check / pyright-call (push) Blocked by required conditions
Release Drafter / Update Release Draft (push) Waiting to run
Force Sync to Aliyun / sync (push) Waiting to run
Update Version / update-version (push) Waiting to run
* ✨ 修复一些bug - 移除不必要的定时器类,简化代码结构 - 优化好友请求处理逻辑,确保在自动同意和手动处理之间的清晰区分 - 更新缓存机制,避免重复处理相同的好友请求 - 新增判断文件是否为二进制文件的功能,提升文件处理的准确性 - 优化缓存字典的过期检查逻辑,提高性能和可读性 * ✨ 更新 get_async_client 函数,支持字符串类型的代理参数 - 修改 proxies 参数类型,允许传入字符串形式的代理地址 - 增强代理处理逻辑,将字符串代理转换为字典格式,提升灵活性和可用性
This commit is contained in:
@@ -98,7 +98,7 @@ def get_client() -> AsyncClient:
|
||||
|
||||
|
||||
def get_async_client(
|
||||
proxies: dict[str, str] | None = None,
|
||||
proxies: dict[str, str] | str | None = None,
|
||||
proxy: str | None = None,
|
||||
verify: bool = False,
|
||||
**kwargs,
|
||||
@@ -109,6 +109,8 @@ def get_async_client(
|
||||
"""
|
||||
transport = kwargs.pop("transport", None) or AsyncHTTPTransport(verify=verify)
|
||||
if proxies:
|
||||
if isinstance(proxies, str):
|
||||
proxies = {"http://": proxies, "https://": proxies}
|
||||
http_proxy = proxies.get("http://")
|
||||
https_proxy = proxies.get("https://")
|
||||
return httpx.AsyncClient(
|
||||
|
||||
Reference in New Issue
Block a user