Skip to content

Commit

Permalink
Fix: Pixiv插件发送榜单消息时作品名与作者为空的问题
Browse files Browse the repository at this point in the history
- 修复Pixiv插件发送榜单消息时作品名与作者为空的问题
  • Loading branch information
Ailitonia committed Apr 17, 2021
1 parent 1572076 commit 23098f3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions omega_miya/plugins/pixiv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ async def handle_pixiv(bot: Bot, event: GroupMessageEvent, state: T_State):
for rank, illust_data in dict(rank_result.result).items():
rank += 1
illust_id = illust_data.get('illust_id')
illust_title = illust_data.get('title')
illust_uname = illust_data.get('user_name')
illust_title = illust_data.get('illust_title')
illust_uname = illust_data.get('illust_uname')

image_result = await PixivIllust(pid=illust_id).pic_2_base64()
if image_result.success():
msg = f'{rank}{illust_title}」/「{illust_uname}」'
msg = f'No.{rank} - ID: {illust_id}\n{illust_title}」/「{illust_uname}」'
img_seg = MessageSegment.image(image_result.result)
await pixiv.send(Message(img_seg).append(msg))
else:
Expand All @@ -120,12 +120,12 @@ async def handle_pixiv(bot: Bot, event: GroupMessageEvent, state: T_State):
for rank, illust_data in dict(rank_result.result).items():
rank += 1
illust_id = illust_data.get('illust_id')
illust_title = illust_data.get('title')
illust_uname = illust_data.get('user_name')
illust_title = illust_data.get('illust_title')
illust_uname = illust_data.get('illust_uname')

image_result = await PixivIllust(pid=illust_id).pic_2_base64()
if image_result.success():
msg = f'{rank}{illust_title}」/「{illust_uname}」'
msg = f'No.{rank} - ID: {illust_id}\n{illust_title}」/「{illust_uname}」'
img_seg = MessageSegment.image(image_result.result)
await pixiv.send(Message(img_seg).append(msg))
else:
Expand All @@ -142,12 +142,12 @@ async def handle_pixiv(bot: Bot, event: GroupMessageEvent, state: T_State):
for rank, illust_data in dict(rank_result.result).items():
rank += 1
illust_id = illust_data.get('illust_id')
illust_title = illust_data.get('title')
illust_uname = illust_data.get('user_name')
illust_title = illust_data.get('illust_title')
illust_uname = illust_data.get('illust_uname')

image_result = await PixivIllust(pid=illust_id).pic_2_base64()
if image_result.success():
msg = f'{rank}{illust_title}」/「{illust_uname}」'
msg = f'No.{rank} - ID: {illust_id}\n{illust_title}」/「{illust_uname}」'
img_seg = MessageSegment.image(image_result.result)
await pixiv.send(Message(img_seg).append(msg))
else:
Expand Down

0 comments on commit 23098f3

Please sign in to comment.