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
- Host: GitHub
- URL: https://github.com/rf-tar-railt/avilla-console
- Owner: RF-Tar-Railt
- License: agpl-3.0
- Created: 2023-02-16T06:22:07.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-15T10:06:15.000Z (almost 2 years ago)
- Last Synced: 2025-01-23T16:33:46.354Z (5 months ago)
- Language: Python
- Size: 118 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 Broadcastfrom avilla.core import Avilla, Context, MessageReceived
from avilla.console.protocol import ConsoleProtocolbroadcast = 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)
```