用 in 替换掉

This commit is contained in:
shenjack 2024-05-27 20:31:40 +08:00
parent bda8a64f2b
commit 2675ada851
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -225,7 +225,7 @@ def bmcl_rank(msg: IcaNewMessage, client: IcaClient, name: str) -> None:
r['index'] = i r['index'] = i
# 搜索是否有这个名字的节点 # 搜索是否有这个名字的节点
names: List[str] = [r["name"].lower() for r in rank_data] names: List[str] = [r["name"].lower() for r in rank_data]
finds = [n.find(name) != -1 for n in names] finds = [name in n for n in names]
if not any(finds): if not any(finds):
reply = msg.reply_with(f"未找到名为{name}的节点") reply = msg.reply_with(f"未找到名为{name}的节点")
client.send_message(reply) client.send_message(reply)