Update __init__.py

This commit is contained in:
HibiKier 2023-02-23 21:01:12 +08:00 committed by GitHub
parent aa76fae386
commit 1ca6a67a24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,6 @@ __plugin_configs__ = {
},
}
cos_img_path = TEMP_PATH / "cos"
coser = on_regex(r"^(\d)?连?(cos|COS|coser|括丝)$", priority=5, block=True)
# 纯cos较慢:https://picture.yinux.workers.dev
@ -50,7 +49,7 @@ url = "https://picture.yinux.workers.dev"
async def _(event: MessageEvent, reg_group: Tuple[Any, ...] = RegexGroup()):
num = reg_group[0] or 1
for _ in range(int(num)):
path = cos_img_path / f'{int(time.time())}.jpeg'
path = TEMP_PATH / f'cos_cc{int(time.time())}.jpeg'
try:
await AsyncHttpx.download_file(url, path)
msg_id = await coser.send(image(path))