mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-12 13:50:59 +00:00
fix(process): 判断消息类型时的数组越界风险
This commit is contained in:
@@ -138,7 +138,7 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes
|
|||||||
if hasattr(config, "rate_limitation"):
|
if hasattr(config, "rate_limitation"):
|
||||||
ratelimit.add_usage(session_name)
|
ratelimit.add_usage(session_name)
|
||||||
|
|
||||||
if reply is not None and (type(reply[0]) == str or type(reply[0]) == mirai.Plain):
|
if reply is not None and len(reply) > 0 and (type(reply[0]) == str or type(reply[0]) == mirai.Plain):
|
||||||
logging.info(
|
logging.info(
|
||||||
"回复[{}]文字消息:{}".format(session_name,
|
"回复[{}]文字消息:{}".format(session_name,
|
||||||
reply[0][:min(100, len(reply[0]))] + (
|
reply[0][:min(100, len(reply[0]))] + (
|
||||||
|
|||||||
Reference in New Issue
Block a user