爱发电适配器
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_HOOK_SECRET='<Your Secret>' AFDIAN_BOTS='[ { "user_id": "<Your User Id>", "token": "<Your Token>" } ]' -
爱发电开发者控制台
http://<IP>:<PORT>/afdian/webhooks/<user_id>
or
https://<IP>:<PORT>/afdian/<Your Secret>/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):
print("订单:" + event.data.order)
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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_adapter_afdian-0.1.5.tar.gz.
File metadata
- Download URL: nonebot_adapter_afdian-0.1.5.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d84ae9b93340f85111282c35ce62b27314127745bfdfcf588a2cf850abeded5f
|
|
| MD5 |
82bd74952055e89824970bf6bb427490
|
|
| BLAKE2b-256 |
b20280bc705e797996090857d6bd1e98c3983036b1ed967bc7a63711e4f12eeb
|
File details
Details for the file nonebot_adapter_afdian-0.1.5-py3-none-any.whl.
File metadata
- Download URL: nonebot_adapter_afdian-0.1.5-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04d8b9d8d0d1c007c18a677cfd50f21e842b86add39a58163b0f5bac3cbd72d4
|
|
| MD5 |
cc1ae895a05113acfae6142e2fec829a
|
|
| BLAKE2b-256 |
00cbd9b6c27c871f54e29f2295364c37d2830688aa465005e42abf1cf662a3fe
|