Skip to main content

爱发电适配器

Project description

nonebot-adapter-afdian

基于 NoneBot2 的爱发电适配器

使用

  1. 安装

    pip install nonebot-adapter-afdian
    
  2. 启用

    adapters = [
        { name = "Afdian", module_name = "nonebot.adapter.afdian" }
    ]
    
  3. 配置

    • NoneBot2
      DRIVER=~fastapi+~httpx
      HOST=0.0.0.0
      AFDIAN_BOTS='[
          {
              "user_id": "<Your User id>",
              "api_token": "<Your Api Token>"
          }
      ]'
      
    • 爱发电开发者控制台
      http://<IP>:<PORT>/afdian/webhooks/<user_id>
      
      or
      https://<IP>:<PORT>/afdian/webhooks/<user_id>
      

API

from nonebot import on_notice
from nonebot.adapters.afdian import OrderNotifyEvent, Bot

test_afd = on_notice()


@test_afd.handle()
async def handle_afd(bot: Bot, event: OrderNotifyEvent):
    result1 = await bot.query_order_by_page(page=1)
    print(result1)

    result2 = await bot.query_order_by_out_trade_no(
        out_trade_no="202308200000000000000000001"
        )
    print(result2)

    result3 = await bot.query_order_by_order_list(
        order_list=["202308200000000000000000000", "202308200000000000000000001"]
        )
    print(result3)

    result4 = await bot.query_sponsor(page=1)
    print(result4)

    result5 = await bot.query_sponsor(page=1, per_page=20) # 查询第一页,每页20个
    print(result5)

特别感谢

贡献与支持

觉得好用可以给这个项目点个 Star 或者去 爱发电 投喂我。

有意见或者建议也欢迎提交 IssuesPull requests

开源许可

本项目使用 MIT 作为开源许可证。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_adapter_afdian-0.1.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

nonebot_adapter_afdian-0.1.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_adapter_afdian-0.1.1.tar.gz.

File metadata

  • Download URL: nonebot_adapter_afdian-0.1.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.11 Linux/6.8.0-1021-azure

File hashes

Hashes for nonebot_adapter_afdian-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dc6e073b3f9e4bb4a095bc86053bdd3ea7f2324bf3d086375cfeb929489d1e46
MD5 9c566954d99fad964ee7eaf5dea254b3
BLAKE2b-256 45f6c77f74174f89ff77c6b07d1b2318478403f8a729922599babc02fae8880f

See more details on using hashes here.

File details

Details for the file nonebot_adapter_afdian-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_adapter_afdian-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 08653db5943a4f8a37dab1aa68140b4970946113e65b7a6ad89718441bced7f1
MD5 08ed536060d73ef843b65d85189ff8b1
BLAKE2b-256 18324e5932a46d117145714e679dedd34575158920b4de255d14fdd496301695

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