Skip to main content

Python 异步渐进式机器人框架

Project description

Amiya-Bot

PyPI

简洁高效的 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


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

If you're not sure about the file name format, learn more about wheel file names.

amiyabot-2.0.8-286-py3-none-any.whl (11.4 MB view details)

Uploaded Python 3

File details

Details for the file amiyabot-2.0.8-286-py3-none-any.whl.

File metadata

  • Download URL: amiyabot-2.0.8-286-py3-none-any.whl
  • Upload date:
  • Size: 11.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for amiyabot-2.0.8-286-py3-none-any.whl
Algorithm Hash digest
SHA256 278ef3f4d7675ace671fa220c281784e8b1804eff8ba93cd2b7df2c9849b7405
MD5 102f9af90764e2b564430df4c0b9590d
BLAKE2b-256 0ce20ce28b3bd7a9155b76ecca52ce07a41c63e70b1c9d8de6c24fe701b308bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for amiyabot-2.0.8-286-py3-none-any.whl:

Publisher: pypi.yml on AmiyaBot/Amiya-Bot-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page