File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
astrbot/core/platform/sources/qqofficial Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 2525from astrbot .core .utils .tencent_record_helper import wav_to_tencent_silk
2626
2727
28+ def _patch_qq_botpy_formdata () -> None :
29+ """Patch qq-botpy for aiohttp>=3.12 compatibility.
30+
31+ qq-botpy 1.2.1 defines botpy.http._FormData._gen_form_data() and expects
32+ aiohttp.FormData to have a private flag named _is_processed, which is no
33+ longer present in newer aiohttp versions.
34+ """
35+
36+ try :
37+ from botpy .http import _FormData # type: ignore
38+
39+ if not hasattr (_FormData , "_is_processed" ):
40+ setattr (_FormData , "_is_processed" , False )
41+ except Exception :
42+ logger .debug ("[QQOfficial] Skip botpy FormData patch." )
43+
44+
45+ _patch_qq_botpy_formdata ()
46+
2847class QQOfficialMessageEvent (AstrMessageEvent ):
2948 MARKDOWN_NOT_ALLOWED_ERROR = "不允许发送原生 markdown"
3049
You can’t perform that action at this time.
0 commit comments