Python 异步渐进式机器人框架
Project description
Amiya-Bot
简洁高效的 Python 异步渐进式 QQ 频道机器人框架!
可使用内置的适配器创建 KOOK、mirai-api-http、go-cqhttp、ComWeChat Client 以及支持 OneBot v11/12 的机器人实现。
官方文档:www.amiyabot.com
Install
pip install amiyabot
Get started
Single mode
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())
Multiple mode
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())
Use adapter
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())
Get more
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for amiyabot-1.8.5-33-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6762bfb225682c483e3d31d9ff25e09d987ab398d8112f1dbac3fd32a95c4e91 |
|
MD5 | 0389b132ef338a861ef895b77a50fc01 |
|
BLAKE2b-256 | 19bd84e0ac3308510f9c33be579cd3ac1e47c274ca2ab153ff7e1bf523e56996 |