Simple IM Framework based on satori-python
Project description
Entari
lí no etheclim, nann ze entám rish.
一个基于 Satori
协议的简易 IM framework
示例
复读:
from arclet.entari import Session, Entari, WS
app = Entari(WS(host="127.0.0.1", port=5140, path="satori"))
@app.on_message()
async def repeat(session: Session):
await session.send(session.content)
app.run()
指令 add {a} {b}
:
from arclet.entari import Session, Entari, WS, command
@command.on("add {a} {b}")
async def add(a: int, b: int, session: Session):
await session.send(f"{a + b = }")
app = Entari(WS(port=5500, token="XXX"))
app.run()
编写插件:
from arclet.entari import Session, MessageEvent, PluginMetadata
__plugin_metadata__ = PluginMetadata(
name="Hello, World!",
author=["Arclet"],
version="0.1.0",
description="A simple plugin that replies 'Hello, World!' to every message."
)
on_message = MessageEvent.dispatch()
@on_message()
async def _(session: Session):
await session.send("Hello, World!")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
arclet_entari-0.6.0.tar.gz
(16.8 kB
view details)
Built Distribution
File details
Details for the file arclet_entari-0.6.0.tar.gz
.
File metadata
- Download URL: arclet_entari-0.6.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.16.1 CPython/3.10.12 Linux/6.5.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db4c2c086f81676ecbb4eb273d7c807a82598f857c5cfa2b8ce86f49a26dfdc9 |
|
MD5 | 86bb8da96c413baec409e3367c36dd3c |
|
BLAKE2b-256 | 45d90aa66c6bd8957deeb254fda68a4b56c052bbff48263a668ed04b4eaeb930 |
File details
Details for the file arclet_entari-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: arclet_entari-0.6.0-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.16.1 CPython/3.10.12 Linux/6.5.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41eba2770a4ad048ef7cdd9b696a9cd5cb0073ebc76df8d92c87f9e19eeed5a5 |
|
MD5 | a85eca7f06e6fa119bc2e60c9d9e081c |
|
BLAKE2b-256 | 236b5b997b15cdf5f38355badb6fc0dd618538b3f1b628b00ea319ed561bc024 |