Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@
from astrbot.core.utils.tencent_record_helper import wav_to_tencent_silk


def _patch_qq_botpy_formdata() -> None:
"""Patch qq-botpy for aiohttp>=3.12 compatibility.

qq-botpy 1.2.1 defines botpy.http._FormData._gen_form_data() and expects
aiohttp.FormData to have a private flag named _is_processed, which is no
longer present in newer aiohttp versions.
"""

try:
from botpy.http import _FormData # type: ignore

if not hasattr(_FormData, "_is_processed"):
setattr(_FormData, "_is_processed", False)
except Exception:
logger.debug("[QQOfficial] Skip botpy FormData patch.")


_patch_qq_botpy_formdata()

class QQOfficialMessageEvent(AstrMessageEvent):
MARKDOWN_NOT_ALLOWED_ERROR = "不允许发送原生 markdown"

Expand Down
Loading