Skip to main content

nb2chan push service Nonebot2酱推送

Project description

nb2chan

testsnonebot2cqhttppythonCode style: blackLicense: MITPyPI version

nonebot2酱(推送服务插件)nonebot2chan (push service plugin)

Install it

pip install nb2chan

# or poetry add nb2chan
# pip install git+https://github.com/ffreemt/nb2chan
# poetry add git+https://github.com/ffreemt/nb2chan

# To upgrade
# pip install nb2chan -U
# or poetry add nb2chan@latest

Use it

# bot.py
import nonebot
...
nonebot.init()
import nb2chan
...

(参看bot.py)

  • 目标qq号(例如QQ号 1234)加nonebot2机器人qq号好友
  • nonebot2部署至外网ip,例如 uvicorn --host 0.0.0.0 bot:app (火墙需放行nonebot2的端口)
  • 给qq号发消息(浏览器地址栏或curl/httpiepython reqests/httpx云函数/claudflare worker etc.):
http://...:port/nb2chan/?Token=DEMO_TOKEN&qq=1234&msg=hello

令牌也可在headers里设定,例如

curl http://...:port/nb2chan/?qq=1234&msg=hello -H "token: DEMO_TOKEN"
http -v "http://...:port/nb2chan/?qq=1234&msg=hello world" "token: DEMO_TOKEN"

其他

nb2chan采用简单令牌鉴权。 有效令牌可在 .env.nb2chan 里设定。 默认有效令牌为['DEMO_TOKEN', 'SECRET_TOKEN'] (参看config.py

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

nb2chan-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

nb2chan-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file nb2chan-0.1.0.tar.gz.

File metadata

  • Download URL: nb2chan-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.7.9 Windows/10

File hashes

Hashes for nb2chan-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7df2479b185fd30789d9f0cf4e4bf930bd21c41fd9c09ef622b0e0caa55e4c18
MD5 684a92c60a76caf24a4753e568129df2
BLAKE2b-256 7592c247d23262d9122d09493eae8f9c1ab29bdea3a334ed182737596b4546ac

See more details on using hashes here.

File details

Details for the file nb2chan-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nb2chan-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.7.9 Windows/10

File hashes

Hashes for nb2chan-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56b85688a41b1cb4ac5f00c9fdc279ff9f16ef8a66d7f0eb9c9300e94ea2465b
MD5 8a65e7ff2d1d83595c41b0d6701695a5
BLAKE2b-256 b331915477f4fc7962a8cf3bc73e0fc9a403ec4195711b0a26ba521227887dc5

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