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.0.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

nonebot_adapter_afdian-0.0.3-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_adapter_afdian-0.0.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.19 Linux/6.5.0-1025-azure

File hashes

Hashes for nonebot_adapter_afdian-0.0.3.tar.gz
Algorithm Hash digest
SHA256 642ef0c82f50924b79884dd02f6c5751fca995b8ffca1e124e3c1d6e16ef8d8b
MD5 05a129e17b93c2a059d884817317045f
BLAKE2b-256 082c1ddc98c088ab5930dfa07290b0941130063f241b8b6054cc08e68941a129

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_adapter_afdian-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8224844a5bb3a7e99af13ff5fb5ffb66040bd34a1d00827f473011999ab2600f
MD5 b67c900e6e2ca168aea524d337b2d26e
BLAKE2b-256 79e44d6fe546a49c74b192377bbaa3bd9948613f7d6f68cc76abe64cc19da730

See more details on using hashes here.

Supported by

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