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, 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


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

Uploaded Source

Built Distribution

arclet_entari-0.6.4-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for arclet_entari-0.6.4.tar.gz
Algorithm Hash digest
SHA256 8b253ec91fd6397755b396e123c7211c5bb64eb83dc12311c3390cceae35e543
MD5 1e912ce0f4c3294492c9b1c5ae661530
BLAKE2b-256 f49398cfbc48a3f80ca2c92ed46d437b5c0b28aacc6adb38b728b885a3da3b66

See more details on using hashes here.

File details

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

File metadata

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

Hashes for arclet_entari-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8e9536fa97a55d4d382c7f91f1546e30c6ade9d41afb065beeae77821c1cc0a6
MD5 ed793084166c57a550fceda6be01eae8
BLAKE2b-256 5074e312df393ec7f755e80bf8c801d8e99bf3b8749a462208ebf5ae97520cf5

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