Skip to content

A simple IM framework based on Satori Protocol. 基于 Satori 跨平台协议的 IM 框架

License

Notifications You must be signed in to change notification settings

ArcletProject/Entari

Repository files navigation

Entari

lo su etheclim, ti zo entaem rish.

Licence PyPI PyPI - Python Version Entari

一个基于 Satori 协议的简易 IM framework

示例

复读:

from arclet.entari import ContextSession, Entari, WS

app = Entari(WS(host="127.0.0.1", port=5140, path="satori"))


@app.on_message()
async def repeat(session: ContextSession):
    await session.send(session.content)

app.run()

指令 add {a} {b}:

from arclet.entari import ContextSession, Entari, EntariCommands, WS

command = EntariCommands()


@command.on("add {a} {b}")
async def add(a: int, b: int, session: ContextSession):
    await session.send(f"{a + b = }")


app = Entari(WS(port=5500, token="XXX"))
app.run()