Skip to content

Commit

Permalink
Merge pull request #573 from jk6589jk/patch-2
Browse files Browse the repository at this point in the history
修复复读不能复读图片的问题
  • Loading branch information
HibiKier authored May 24, 2022
2 parents 1fb913e + 9c8f2e7 commit c63d4b8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions plugins/fudu.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,21 @@ async def _(event: GroupMessageEvent):
"fudu", "FUDU_PROBABILITY"
) and not _fudu_list.is_repeater(event.group_id):
if random.random() < 0.2:
await fudu.finish("[[_task|fudu]]打断施法!")
if msg.endswith("打断施法!"):
await fudu.finish("[[_task|fudu]]打断" + msg)
else:
await fudu.finish("[[_task|fudu]]打断施法!")
_fudu_list.set_repeater(event.group_id)
if img and msg:
rst = msg + image(f"compare_{event.group_id}_img.jpg", "temp")
rst = msg + image(TEMP_PATH / f"compare_{event.group_id}_img.jpg")
elif img:
rst = image(f"compare_{event.group_id}_img.jpg", "temp")
rst = image(TEMP_PATH / f"compare_{event.group_id}_img.jpg")
elif msg:
rst = msg
else:
rst = ""
if rst:
if rst.endswith("打断施法!"):
rst = "打断" + rst
await fudu.send("[[_task|fudu]]" + rst)
await fudu.finish("[[_task|fudu]]" + rst)


async def get_fudu_img_hash(url, group_id):
Expand Down

0 comments on commit c63d4b8

Please sign in to comment.