5 Commits

Author SHA1 Message Date
suyiiyii d36e75c4f7 🐛 获取后台链接的时候,对没有权限的用户进行提示 2024-07-01 11:49:06 +00:00
github-actions[bot] dacd03d6e8 📝 Update changelog 2024-06-27 09:14:00 +00:00
Komorebi 1ba665cbab 📝 更新 README (#583)
* 📝 更新 README

* 📝 更正文档链接
2024-06-27 17:13:31 +08:00
github-actions[bot] d25ce43b1a 📝 Update changelog 2024-06-27 09:11:49 +00:00
Komorebi ba818b492d 💄 更新 favicon (#585) 2024-06-27 17:11:14 +08:00
5 changed files with 29 additions and 12 deletions
+2
View File
@@ -18,6 +18,8 @@
### 文档
- 📝 更新 README [@KomoriDev](https://github.com/KomoriDev) ([#583](https://github.com/MountainDash/nonebot-bison/pull/583))
- 💄 更新 favicon [@KomoriDev](https://github.com/KomoriDev) ([#585](https://github.com/MountainDash/nonebot-bison/pull/585))
- 修复前端开发部分文档的问题 [@changsun20](https://github.com/changsun20) ([#552](https://github.com/MountainDash/nonebot-bison/pull/552))
## v0.9.2
+14 -8
View File
@@ -1,3 +1,9 @@
<div align="center">
<a href="https://v2.nonebot.dev/store">
<img src="https://nonebot-bison.netlify.app/logo.svg" width="200" alt="logo">
</a>
</div>
<div align="center">
# Bison
@@ -10,7 +16,7 @@ _✨ 通用订阅推送插件 ✨_
<a href="https://pypi.python.org/pypi/nonebot-bison">
<img src="https://img.shields.io/pypi/v/nonebot-bison?logo=python&logoColor=edb641" alt="pypi">
</a>
<img src="https://img.shields.io/badge/python-3.8+-blue?logo=python&logoColor=edb641" alt="python">
<img src="https://img.shields.io/badge/python-3.10+-blue?logo=python&logoColor=edb641" alt="python">
<a href="https://github.com/psf/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg?logo=python&logoColor=edb641" alt="black">
</a>
@@ -52,7 +58,7 @@ _✨ 通用订阅推送插件 ✨_
基于 [`NoneBot2`](https://github.com/nonebot/nonebot2) 开发(诞生于明日方舟的蹲饼活动)
<details>
<summary>本项目原名原名 nonebot-hk-reporter</summary>
<summary>本项目原名 nonebot-hk-reporter</summary>
寓意本 Bot 要做全世界跑的最快的搬运机器人,后因名字过于暴力改名
@@ -79,19 +85,19 @@ _✨ 通用订阅推送插件 ✨_
## 使用方法
**!! 注意,如果要使用后台管理功能请使用 pypi 版本或者 docker 版本,如果直接 clone 源代码
需要按下面方式进行 build**
> [!warning]
> 如果要使用后台管理功能请使用 pypi 版本或者 docker 版本,如果直接 clone 源代码,需要按下面方式进行 build
```bash
cd ./admin-frontend
pnpm && pnpm run build
```
可以使用 Dockerdocker-compose,作为插件安装在 nonebot 中,或者直接运行
可以使用 Dockerdocker-compose,作为插件安装在 NoneBot 中,或者直接运行
在群里 at Bot 或者直接私聊 Bot“添加订阅”,按照提示输入需要订阅的账号,就可以愉快接收消息了。
在群里 @Bot 或者直接私聊 Bot 发送 “添加订阅”,按照提示输入需要订阅的账号,就可以愉快接收消息了。
参考[文档](https://nonebot-bison.vercel.app/usage/#%E4%BD%BF%E7%94%A8)
参考[文档](https://nonebot-bison.netlify.app/usage/#%E4%BD%BF%E7%94%A8)
## FAQ
@@ -104,7 +110,7 @@ pnpm && pnpm run build
3. 微博漏订阅了
微博更新了新的风控措施,某些含有某些关键词的微博会获取不到。
4. 无法使用后台管理页面
1. 确认自己正确配置了 nonebot 的端口,如果在远程或容器外访问网页请确保`HOST=0.0.0.0`
1. 确认自己正确配置了 NoneBot 的端口,如果在远程或容器外访问网页请确保 `HOST=0.0.0.0`
2. 确认自己的云服务器的防火墙配置正确
3. 确认自己使用了正确的方法安装插件
Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 34 KiB

+2
View File
@@ -5,6 +5,8 @@ import sidebar from "./sidebar.js";
export default hopeTheme({
hostname: "https://nonebot-bison.netlify.app",
favicon: "favicon.ico",
author: {
name: "MountainDash Team",
url: "https://github.com/orgs/MountainDash/teams",
+7
View File
@@ -2,6 +2,7 @@ import os
from pathlib import Path
from typing import TYPE_CHECKING
import nonebot
from nonebot.log import logger
from nonebot.rule import to_me
from nonebot.typing import T_State
@@ -9,6 +10,7 @@ from nonebot import get_driver, on_command
from nonebot.adapters.onebot.v11 import Bot
from nonebot.adapters.onebot.v11.event import PrivateMessageEvent
from .api import get_admin_groups
from .api import router as api_router
from ..plugin_config import plugin_config
from .token_manager import token_manager as tm
@@ -65,6 +67,11 @@ def register_get_token_handler():
@get_token.handle()
async def send_token(bot: "Bot", event: PrivateMessageEvent, state: T_State):
qq = event.sender.user_id
if qq and str(qq) not in nonebot.get_driver().config.superusers and len(await get_admin_groups(int(qq))) == 0:
await get_token.finish("没有可以管理的群组")
return
token = tm.get_user_token((event.get_user_id(), event.sender.nickname))
await get_token.finish(f"请访问: {plugin_config.outer_url / 'auth' / token}")