diff --git a/plugins/bmcl.py b/plugins/bmcl.py index 9b3b64a..4d23f88 100644 --- a/plugins/bmcl.py +++ b/plugins/bmcl.py @@ -255,37 +255,36 @@ def bmcl_rank(msg: IcaNewMessage, client: IcaClient | TailchatClient, name: str) client.send_message(reply) -def bangbang_img(msg: IcaNewMessage, client: IcaClient) -> None: - data = requests.get("https://api.bangbang93.top/api/link") - if data.status_code != 200: - reply = msg.reply_with(f"请求失败 {data.status_code} {data.reason}") - client.send_message(reply) - return - raw_name = data.url.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 = urllib.parse.unquote(img_name) - mime_format = f"image/{img_suffix}" - client.info(f"获取到随机怪图: {img_name} {img_suffix}") - reply = msg.reply_with(img_name) - reply.set_img(data.content, mime_format, True) - client.send_message(reply) +# def bangbang_img(msg: IcaNewMessage, client: IcaClient) -> None: +# data = requests.get("https://api.bangbang93.top/api/link") +# if data.status_code != 200: +# reply = msg.reply_with(f"请求失败 {data.status_code} {data.reason}") +# client.send_message(reply) +# return +# raw_name = data.url.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 = urllib.parse.unquote(img_name) +# mime_format = f"image/{img_suffix}" +# client.info(f"获取到随机怪图: {img_name} {img_suffix}") +# reply = msg.reply_with(img_name) +# reply.set_img(data.content, mime_format, True) +# client.send_message(reply) help = """/bmcl -> dashboard /bmcl rank -> all rank /bmcl rank -> rank of -/bm93 -> 随机怪图 /brrs -> rank of 搜索限制: 1- 3 显示全部信息 4-10 显示状态、名称 11+ 不显示 """ - +# /bm93 -> 随机怪图 def on_ica_message(msg: IcaNewMessage, client: IcaClient) -> None: if not (msg.is_from_self or msg.is_reply): @@ -320,8 +319,8 @@ def on_ica_message(msg: IcaNewMessage, client: IcaClient) -> None: if len(name) > 1: name = name[1] bmcl_rank(msg, client, name) - elif msg.content == "/bm93": - bangbang_img(msg, client) + # elif msg.content == "/bm93": + # bangbang_img(msg, client) except: # noqa report_msg = f"bmcl插件发生错误,请呼叫shenjack\n{traceback.format_exc()}" client.warn(report_msg)