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

Uploaded Source

Built Distribution

arclet_entari-0.6.2-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: arclet_entari-0.6.2.tar.gz
  • Upload date:
  • Size: 17.1 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.2.tar.gz
Algorithm Hash digest
SHA256 0c439454ef11b1ea53ba2b473c644addfd48579661b7ec420a58f526d513e05a
MD5 dd579114d88d0d5136ac5dcac41c3b23
BLAKE2b-256 41b13be3ebfa93fb74ae1a096ceac53551e2c6105109b32becc911a8e71b2927

See more details on using hashes here.

File details

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

File metadata

  • Download URL: arclet_entari-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 21.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cbbe15e381423127c386c561fab095b711a80390b16ac496fd5b4e75ed5b63b7
MD5 d260ada895a225bc04fca93dd9783a3f
BLAKE2b-256 af66fb5f01c435b5b6452b7e946bff41564ef0b26ecd2348fe1fbaf2f757411d

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