Simple IM Framework based on satori-python
Reason this release was yanked:
bug
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, MessageCreatedEvent, Plugin
Plugin.current().meta(
name="Hello, World!",
author=["Arclet"],
version="0.1.0",
description="A simple plugin that replies 'Hello, World!' to every message."
)
# or __plugin_metadata__ = PluginMetadata(...)
@MessageCreatedEvent.dispatch()
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.3.tar.gz
(18.1 kB
view details)
Built Distribution
File details
Details for the file arclet_entari-0.6.3.tar.gz
.
File metadata
- Download URL: arclet_entari-0.6.3.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.17.1 CPython/3.10.12 Linux/6.5.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 876e394fd2c47dfc5f40fb7f90fc257df6e42d0b2425a195020179728dd693e7 |
|
MD5 | b1e5c43fd87f7ed5cefa96f4a7093f73 |
|
BLAKE2b-256 | 4299ec4cca938acc6d06670ac3d68f694d8b46b382a3bae77ba218fe0a3fd53a |
File details
Details for the file arclet_entari-0.6.3-py3-none-any.whl
.
File metadata
- Download URL: arclet_entari-0.6.3-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.17.1 CPython/3.10.12 Linux/6.5.0-1024-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e68634fc234b0522ffce21c27f17cc31746c0a90c2df492ec7cf621f9bf782af |
|
MD5 | 04ac0ca015588483c12f5a5d4b69b9ac |
|
BLAKE2b-256 | 830362ec993718b27c7e62db7a0bb549d091cfaba45a4170586f6c36e809e375 |