mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 12:41:05 +08:00
稍微改一下检测
This commit is contained in:
parent
2449dda432
commit
d564350275
|
@ -15,21 +15,21 @@ else:
|
|||
IcaNewMessage = TypeVar("NewMessage")
|
||||
IcaClient = TypeVar("IcaClient")
|
||||
|
||||
_version_ = "0.1.0"
|
||||
_version_ = "0.2.0"
|
||||
|
||||
|
||||
def on_ica_message(msg: IcaNewMessage, client: IcaClient) -> None:
|
||||
if not msg.content.startswith("/name"):
|
||||
if not msg.content.startswith("/namerena"):
|
||||
return
|
||||
if msg.content.find("\n") == -1:
|
||||
client.send_message(
|
||||
msg.reply_with(
|
||||
"请使用 /name 命令,然后换行输入名字,例如:\n/name\n张三\n李四\n王五\n"
|
||||
"请使用 /namerena 命令,然后换行输入名字,例如:\n/namerena\n张三\n李四\n王五\n"
|
||||
)
|
||||
)
|
||||
return
|
||||
# 去掉 /name
|
||||
names = msg.content.split("/name")[1]
|
||||
names = msg.content.split("/namerena")[1]
|
||||
# 去掉第一个 \n
|
||||
names = names[names.find("\n") + 1 :]
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user