Skip to main content

Simple IM Framework based on satori-python

Project description

Entari

lí no etheclim, nann ze entám rish.

Licence PyPI PyPI - Python Version Entari

一个基于 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


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.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

arclet_entari-0.6.1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file arclet_entari-0.6.1.tar.gz.

File metadata

  • Download URL: arclet_entari-0.6.1.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

Hashes for arclet_entari-0.6.1.tar.gz
Algorithm Hash digest
SHA256 5ef00cef8f1635a2d2efe84a0e83af52605705ccb381be878b3f02cf7bd467c1
MD5 a9742a97404be3f09af5455e5511172c
BLAKE2b-256 01af7610bed83c13eb61560dac9480630d69ab7b206fb659864bdb5aae4a0a79

See more details on using hashes here.

File details

Details for the file arclet_entari-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: arclet_entari-0.6.1-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

Hashes for arclet_entari-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 154b1e7fe5cd9ceef9cd95b27180722fc6302e4781749ac94e3c32530a2afeb1
MD5 be76382c8b5b38b34adfe9be8e5642fd
BLAKE2b-256 136fa40b470220dee76e205386b30787613475abb851a4c2e2ae003946262db7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page