socket-bot/ica-rs/plugins/base.py

16 lines
484 B
Python
Raw Normal View History

2024-02-22 12:47:20 +08:00
from typing import TYPE_CHECKING, TypeVar
if TYPE_CHECKING:
from ica_typing import NewMessage, IcaClient
else:
NewMessage = TypeVar("NewMessage")
IcaClient = TypeVar("IcaClient")
2024-02-22 19:10:15 +08:00
_version_ = "1.1.0"
2024-02-22 12:47:20 +08:00
def on_message(msg: NewMessage, client: IcaClient) -> None:
2024-02-22 14:38:37 +08:00
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})")
2024-02-22 12:47:20 +08:00
client.send_message(reply)