Python 异步渐进式机器人框架
Project description
Amiya-Bot
简洁高效的 Python 异步渐进式 QQ 机器人框架!
现已支持:
官方文档:www.amiyabot.com
Install
pip install amiyabot
Get started
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())
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.9.8-515-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4433c118139ea9ff4ef8fa84dde254db5b15110ea76a8f174bd7f68f2227724d |
|
MD5 | fc0de7f867020a1d0c9e54b1f1a99a67 |
|
BLAKE2b-256 | 49f6b654a837131c545036a3955523cc6365c019c08f18f77a3fb1948b0be634 |