mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 12:41:05 +08:00
a?
This commit is contained in:
parent
80c5c18bdb
commit
f8332f7761
|
@ -264,9 +264,13 @@ def bangbang_img(msg: IcaNewMessage, client: IcaClient) -> None:
|
||||||
return
|
return
|
||||||
raw_name = data.url.split("/")[-1]
|
raw_name = data.url.split("/")[-1]
|
||||||
img_suffix = raw_name.split(".")[-1]
|
img_suffix = raw_name.split(".")[-1]
|
||||||
|
# mine 映射一下
|
||||||
|
if img_suffix.lower() in ("jpeg", "jpg"):
|
||||||
|
img_suffix = "jpeg"
|
||||||
img_name = raw_name[:-len(img_suffix) - 1]
|
img_name = raw_name[:-len(img_suffix) - 1]
|
||||||
img_name = urllib.parse.unquote(img_name)
|
img_name = urllib.parse.unquote(img_name)
|
||||||
mime_format = f"image/{img_suffix}"
|
mime_format = f"image/{img_suffix}"
|
||||||
|
client.info(f"获取到随机怪图: {img_name} {img_suffix}")
|
||||||
reply = msg.reply_with(img_name)
|
reply = msg.reply_with(img_name)
|
||||||
reply.set_img(data.content, mime_format, True)
|
reply.set_img(data.content, mime_format, True)
|
||||||
client.send_message(reply)
|
client.send_message(reply)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user