爱发电适配器
Project description
nonebot-adapter-afdian
基于 NoneBot2 的爱发电适配器
使用
-
安装
pip install nonebot-adapter-afdian
-
启用
adapters = [ { name = "Afdian", module_name = "nonebot.adapter.afdian" } ]
-
配置
- 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>
orhttps://<IP>:<PORT>/afdian/webhooks/<user_id>
- NoneBot2
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)
特别感谢
- NoneBot2:开发框架。
贡献与支持
觉得好用可以给这个项目点个 Star
或者去 爱发电 投喂我。
有意见或者建议也欢迎提交 Issues 和 Pull 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
Built Distribution
File details
Details for the file nonebot_adapter_afdian-0.0.8.tar.gz
.
File metadata
- Download URL: nonebot_adapter_afdian-0.0.8.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.11 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5c3910d8e4de879fa8b1c2961538b9f411550677e6a6846fcd1317ddf236d6b |
|
MD5 | 89ee4548cc9afafb18b9052cd6ecb898 |
|
BLAKE2b-256 | 4cab2a870cc29aee15679b89dbb0057bd75e43d6985458928d3d3dcc6e38a821 |
File details
Details for the file nonebot_adapter_afdian-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: nonebot_adapter_afdian-0.0.8-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.11 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc6c7ac485e36c57bed1a9bff0c1aa2276b80381ae04fdf471b590a7a176af47 |
|
MD5 | 3dfafbbfcde175ff2992c87bf7b161af |
|
BLAKE2b-256 | daea0616e8d7f6e600867b6b6f27887d59756d4a4d0e423e9dac8590d24cd820 |