简洁高效的 Python 异步渐进式 QQ 机器人框架!
现已支持:
官方文档:www.amiyabot.com
pip install amiyabot
import asyncio
from amiyabot import AmiyaBot, Message, Chain
bot = AmiyaBot(appid='******', token='******')
@bot.on_message(keywords='hello')
async def _(data: Message):
return Chain(data).text(f'hello, {data.nickname}')
asyncio.run(bot.start())
import asyncio
from amiyabot import MultipleAccounts, AmiyaBot, Message, Chain
bots = MultipleAccounts(
AmiyaBot(appid='******', token='******'),
AmiyaBot(appid='******', token='******'),
...
)
@bots.on_message(keywords='hello')
async def _(data: Message):
return Chain(data).text(f'hello, {data.nickname}')
asyncio.run(bots.start())
import asyncio
from amiyabot import AmiyaBot, Message, Chain
from amiyabot.adapters.onebot.v11 import onebot11
bot = AmiyaBot(
appid='******',
token='******',
adapter=onebot11(host='127.0.0.1', http_port=8080, ws_port=8060)
)
@bot.on_message(keywords='hello')
async def _(data: Message):
return Chain(data).text(f'hello, {data.nickname}')
asyncio.run(bot.start())