mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
✨ 直接使用 fstring 生成链接
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
from urllib.parse import urlunparse
|
|
||||||
|
|
||||||
from nonebot_plugin_alconna.uniseg import UniMessage
|
from nonebot_plugin_alconna.uniseg import UniMessage
|
||||||
from nonebot_plugin_orm import get_session
|
from nonebot_plugin_orm import get_session
|
||||||
from nonebot_plugin_session import EventSession # type: ignore[import-untyped]
|
from nonebot_plugin_session import EventSession # type: ignore[import-untyped]
|
||||||
@@ -60,5 +58,5 @@ async def _(
|
|||||||
)
|
)
|
||||||
) as page_hash:
|
) as page_hash:
|
||||||
await UniMessage.image(
|
await UniMessage.image(
|
||||||
raw=await screenshot(urlunparse(('http', get_self_netloc(), f'/host/{page_hash}.html', '', '', '')))
|
raw=await screenshot(f'http://{get_self_netloc()}/host/{page_hash}.html')
|
||||||
).finish()
|
).finish()
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from urllib.parse import urlunparse
|
|
||||||
|
|
||||||
from nonebot_plugin_alconna.uniseg import UniMessage
|
from nonebot_plugin_alconna.uniseg import UniMessage
|
||||||
from nonebot_plugin_orm import get_session
|
from nonebot_plugin_orm import get_session
|
||||||
from nonebot_plugin_session import EventSession # type: ignore[import-untyped]
|
from nonebot_plugin_session import EventSession # type: ignore[import-untyped]
|
||||||
@@ -60,5 +58,5 @@ async def _(
|
|||||||
)
|
)
|
||||||
) as page_hash:
|
) as page_hash:
|
||||||
await UniMessage.image(
|
await UniMessage.image(
|
||||||
raw=await screenshot(urlunparse(('http', get_self_netloc(), f'/host/{page_hash}.html', '', '', '')))
|
raw=await screenshot(f'http://{get_self_netloc()}/host/{page_hash}.html')
|
||||||
).finish()
|
).finish()
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ from asyncio import gather
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from typing import Literal, NamedTuple
|
from typing import Literal, NamedTuple
|
||||||
from urllib.parse import urlunparse
|
|
||||||
|
|
||||||
from nonebot.adapters import Event
|
from nonebot.adapters import Event
|
||||||
from nonebot.matcher import Matcher
|
from nonebot.matcher import Matcher
|
||||||
@@ -230,7 +229,7 @@ async def make_query_image(user_info: UserInfoSuccess, game_data: GameData, even
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
) as page_hash:
|
) as page_hash:
|
||||||
return await screenshot(urlunparse(('http', get_self_netloc(), f'/host/{page_hash}.html', '', '', '')))
|
return await screenshot(f'http://{get_self_netloc()}/host/{page_hash}.html')
|
||||||
|
|
||||||
|
|
||||||
def make_query_text(user_info: UserInfoSuccess, game_data: GameData | None) -> UniMessage:
|
def make_query_text(user_info: UserInfoSuccess, game_data: GameData | None) -> UniMessage:
|
||||||
|
|||||||
Reference in New Issue
Block a user