update 0.0.6.2

This commit is contained in:
HibiKi
2021-11-23 21:44:59 +08:00
parent c802dfda22
commit 3de487fb24
251 changed files with 14413 additions and 14002 deletions
Regular → Executable
+2 -5
View File
@@ -2,8 +2,7 @@ from nonebot import on_command
from services.log import logger
from nonebot.adapters.cqhttp import Bot, MessageEvent, GroupMessageEvent
from nonebot.typing import T_State
import aiohttp
from utils.utils import get_local_proxy
from utils.http_utils import AsyncHttpx
__zx_plugin_name__ = "一言二次元语录"
@@ -32,9 +31,7 @@ url = "https://international.v1.hitokoto.cn/?c=a"
@quotations.handle()
async def _(bot: Bot, event: MessageEvent, state: T_State):
async with aiohttp.ClientSession() as session:
async with session.get(url, proxy=get_local_proxy(), timeout=5) as response:
data = await response.json()
data = (await AsyncHttpx.get(url, timeout=5)).json()
result = f'{data["hitokoto"]}\t——{data["from"]}'
await quotations.send(result)
logger.info(