Skip to main content

爱发电Bot SDK

Project description

AfdianBot-Core

一款轻量化,简单且易用的爱发电机器人库

快速入门

import AfdianBot

bot = AfdianBot.Bot(account="xxxxx", password="xxxx") # 填写账号密码

@bot.register("hello") # 注册一个指令
def hello(msg:AfdianBot.types.TextMsg):
    sender_name = AfdianBot.api.get_user_info(msg.sender_id)['name']
    bot.send_msg(f"hello {sender_name}!", msg.sender_id) # 回复消息至对方

# 在一般情况下,程序默认使用单线程模式,即一个一个处理回复
# 但在一些需要并发需求(即同时处理多个消息)情况时,你可以加上threded参数启用多线程模式
# bot.run(threded=True)
bot.run()

更多文档内容详见AfdianBot-Core文档

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.

AfdianBot-1.0.1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file AfdianBot-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: AfdianBot-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.10

File hashes

Hashes for AfdianBot-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f0f22eeb20af20935540816e77d1789960554686b0f6c96c95df32f9e1c1055
MD5 37ebc9cf286168b009a8f35dde66a3fb
BLAKE2b-256 54e9fc7a1125c8ed0d3ff5071156a3ea4f0d97fd3f6738c3b6809dfe481b10ea

See more details on using hashes here.

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