Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复复读不能复读图片的问题 #573

Merged
merged 2 commits into from
May 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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