mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 20:45:06 +08:00
避免错误信息太长,以及加点提前过滤
This commit is contained in:
parent
dade195e76
commit
b3e9588763
|
@ -323,6 +323,8 @@ def on_ica_message(msg: IcaNewMessage, client: IcaClient) -> None:
|
||||||
bangbang_img(msg, client)
|
bangbang_img(msg, client)
|
||||||
except: # noqa
|
except: # noqa
|
||||||
report_msg = f"bmcl插件发生错误,请呼叫shenjack\n{traceback.format_exc()}"
|
report_msg = f"bmcl插件发生错误,请呼叫shenjack\n{traceback.format_exc()}"
|
||||||
|
if len(report_msg) > 200:
|
||||||
|
report_msg = report_msg[:200] + "..." # 防止消息过长
|
||||||
reply = msg.reply_with(report_msg)
|
reply = msg.reply_with(report_msg)
|
||||||
client.send_and_warn(reply)
|
client.send_and_warn(reply)
|
||||||
|
|
||||||
|
@ -364,6 +366,8 @@ def on_tailchat_message(msg, client) -> None:
|
||||||
bangbang_img(msg, client)
|
bangbang_img(msg, client)
|
||||||
except: # noqa
|
except: # noqa
|
||||||
report_msg = f"bmcl插件发生错误,请呼叫shenjack\n{traceback.format_exc()}"
|
report_msg = f"bmcl插件发生错误,请呼叫shenjack\n{traceback.format_exc()}"
|
||||||
|
if len(report_msg) > 200:
|
||||||
|
report_msg = report_msg[:200] + "..." # 防止消息过长
|
||||||
reply = msg.reply_with(report_msg)
|
reply = msg.reply_with(report_msg)
|
||||||
client.send_and_warn(reply)
|
client.send_and_warn(reply)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user