Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/example/new_module/__init__.py
2023-02-05 22:33:33 +08:00

26 lines
674 B
Python

from core.builtins import Plain, Image
from core.builtins.message import MessageSession
from core.component import on_command
test = on_command('test')
@test.handle()
async def _(session: MessageSession):
await session.sendMessage('Hello World!')
@test.handle('say <word>')
async def _(session: MessageSession):
await session.finish(session.parsed_msg['<word>'])
@test.handle('reply')
async def _(session: MessageSession):
s = await session.waitReply('Send a word')
await s.sendMessage(s.asDisplay())
@test.handle('image')
async def _(session: MessageSession):
await session.sendMessage([Plain('A picture:'), Image('https://http.cat/100.jpg')])