An open API service indexing awesome lists of open source software.

https://github.com/rf-tar-railt/avilla-console

Avilla Console Protocol
https://github.com/rf-tar-railt/avilla-console

Last synced: 3 months ago
JSON representation

Avilla Console Protocol

Awesome Lists containing this project

README

        

# Avilla-Console

`avilla` 的 `Console` 适配,使用 `Textual`

参考: [`nonebot-adapter-console`](https://github.com/nonebot/adapter-console)

## 样例

```python
from creart import create
from launart import Launart
from graia.broadcast import Broadcast

from avilla.core import Avilla, Context, MessageReceived
from avilla.console.protocol import ConsoleProtocol

broadcast = create(Broadcast)
launart = Launart()
avilla = Avilla(broadcast, launart, [ConsoleProtocol()])

@broadcast.receiver(MessageReceived)
async def on_message_received(ctx: Context):
await ctx.scene.send_message("Hello, Avilla!")

launart.launch_blocking(loop=broadcast.loop)

```