icalingua-python-bot/ica-rs/plugins/base.py
shenjack 469db17c3b
更新 IcaClient 类,添加 version 属性***
***更新 IcaClientPy 类,添加 get_version 方法***
***更新 base.py,修改回复消息中的版本号显示
2024-02-25 21:33:11 +08:00

16 lines
484 B
Python

from typing import TYPE_CHECKING, TypeVar
if TYPE_CHECKING:
from ica_typing import NewMessage, IcaClient
else:
NewMessage = TypeVar("NewMessage")
IcaClient = TypeVar("IcaClient")
_version_ = "1.1.0"
def on_message(msg: NewMessage, client: IcaClient) -> None:
if not (msg.is_from_self or msg.is_reply):
if msg.content == "/bot":
reply = msg.reply_with(f"ica-async-rs-sync-py {_version_}({client.version})")
client.send_message(reply)