Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
lgc2333 committed Jun 30, 2024
1 parent b59c689 commit 1ed3a95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion nonebot_plugin_multincm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"▶ Bot 会自动解析你发送的网易云链接\n" if config.ncm_auto_resolve else ""
)

__version__ = "1.1.0"
__version__ = "1.1.0.post1"
__plugin_meta__ = PluginMetadata(
name="MultiNCM",
description="网易云多选点歌",
Expand Down
9 changes: 4 additions & 5 deletions nonebot_plugin_multincm/interaction/message/song_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
from nonebot_plugin_alconna.uniseg import UniMessage

from ...config import config
from ...data_source import BaseSong
from ...data_source import BaseSong, SongInfo


async def sign_music_card(song: BaseSong) -> str:
async def sign_music_card(info: SongInfo) -> str:
assert config.ncm_card_sign_url
info = await song.get_info()
async with AsyncClient(
follow_redirects=True,
timeout=config.ncm_card_sign_timeout,
Expand All @@ -33,14 +32,14 @@ async def sign_music_card(song: BaseSong) -> str:


async def send_song_card_msg(song: BaseSong):
info = await song.get_info()
if config.ncm_card_sign_url:
with warning_suppress(
f"Failed to send signed card for song {song}, fallback to MusicShare seg",
):
return await UniMessage.hyper("json", await sign_music_card(song)).send(
return await UniMessage.hyper("json", await sign_music_card(info)).send(
fallback=False,
)
info = await song.get_info()
return await UniMessage(
MusicShare(
kind=MusicShareKind.NeteaseCloudMusic,
Expand Down

0 comments on commit 1ed3a95

Please sign in to comment.