mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
Update jitang.py
This commit is contained in:
parent
1a68ede632
commit
658152fdc9
@ -5,6 +5,7 @@ from nonebot.adapters.cqhttp import Bot, MessageEvent, GroupMessageEvent
|
|||||||
from nonebot.typing import T_State
|
from nonebot.typing import T_State
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from asyncio.exceptions import TimeoutError
|
from asyncio.exceptions import TimeoutError
|
||||||
|
from configs.config import Config
|
||||||
|
|
||||||
|
|
||||||
__zx_plugin_name__ = "鸡汤"
|
__zx_plugin_name__ = "鸡汤"
|
||||||
@ -33,7 +34,7 @@ jitang = on_command("鸡汤", aliases={"毒鸡汤"}, priority=5, block=True)
|
|||||||
|
|
||||||
@jitang.handle()
|
@jitang.handle()
|
||||||
async def _(bot: Bot, event: MessageEvent, state: T_State):
|
async def _(bot: Bot, event: MessageEvent, state: T_State):
|
||||||
params = {"format": "json", "token": "h0KuF6qNniMHGUtA"}
|
params = {"format": "json", "token": f"{Config.get_config('alapi', 'ALAPI_TOKEN')}"}
|
||||||
try:
|
try:
|
||||||
async with aiohttp.ClientSession(headers=get_user_agent()) as session:
|
async with aiohttp.ClientSession(headers=get_user_agent()) as session:
|
||||||
async with session.get(url, timeout=7, params=params) as response:
|
async with session.get(url, timeout=7, params=params) as response:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user