Update handler.py

This commit is contained in:
小铃铛 2023-01-07 19:11:24 +08:00 committed by GitHub
parent b5a755640e
commit 5d0944f6e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,9 +6,8 @@ from nonebot.adapters.onebot.v11 import GroupMessageEvent, Message, MessageSegme
from nonebot.rule import Rule
from LittlePaimon.database import GenshinVoice, GuessVoiceRank
from LittlePaimon.utils import scheduler, logger
from LittlePaimon.utils import scheduler, logger, aiorequests
from LittlePaimon.utils.alias import get_alias_by_name
from LittlePaimon.utils.requests import aiorequests
from .draw import draw_voice_list
gaming = {}
@ -122,7 +121,7 @@ async def get_voice_list(character: str, language: str = '中'):
async def get_record(url):
resp = await aiorequests.get(url, timeout=20)
resp = await aiorequests.get(url)
resp.raise_for_status()
voice = resp.content
return MessageSegment.record(voice)