Giter VIP home page Giter VIP logo

nb2chan's Introduction

nb2chan

nonebot2betaonebotpythonCode 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

例如,qq 1234 加 2129462094 为好友后,即可从以下url发推送消息给 1234。(qq 2129462094 在okteto里提供推送消息服务。)

https://nb2chan-dattw.cloud.okteto.net/nb2chan/?Token=DEMO_TOKEN&qq=1234&msg=hello1

令牌也可在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

nb2chan's People

Contributors

ffreemt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nb2chan's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.