mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-05 19:36:43 +08:00
update doc
This commit is contained in:
parent
ae59674c8c
commit
de2a8bfd61
@ -1,6 +1,4 @@
|
|||||||
FROM python:3.9
|
FROM python:3.9
|
||||||
RUN echo "deb http://mirrors.aliyun.com/debian/ buster main contrib non-free\ndeb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free" > /etc/apt/sources.list
|
|
||||||
RUN apt-get update && apt-get install -y fonts-wqy-microhei chromium
|
|
||||||
RUN python3 -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
|
RUN python3 -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
|
||||||
RUN python3 -m pip install poetry && poetry config virtualenvs.create false
|
RUN python3 -m pip install poetry && poetry config virtualenvs.create false
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
12
Dockerfile_browser
Normal file
12
Dockerfile_browser
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
FROM python:3.9
|
||||||
|
RUN echo "deb http://mirrors.aliyun.com/debian/ buster main contrib non-free\ndeb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free" > /etc/apt/sources.list
|
||||||
|
RUN apt-get update && apt-get install -y fonts-wqy-microhei chromium
|
||||||
|
RUN python3 -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
|
||||||
|
RUN python3 -m pip install poetry && poetry config virtualenvs.create false
|
||||||
|
WORKDIR /app
|
||||||
|
COPY ./pyproject.toml ./poetry.lock* /app/
|
||||||
|
RUN poetry install --no-root --no-dev
|
||||||
|
# RUN PYPPETEER_DOWNLOAD_HOST='http://npm.taobao.org/mirrors' pyppeteer-install
|
||||||
|
COPY . /app/
|
||||||
|
ENV HOST=0.0.0.0
|
||||||
|
CMD ["python", "bot.py"]
|
11
README.md
11
README.md
@ -35,17 +35,6 @@
|
|||||||
本项目可作为单独插件使用,仅包含订阅相关功能(绝对simple和stupid),也可直接克隆项目进行使用(包含自动同意superuser,自动接受入群邀请等功能)
|
本项目可作为单独插件使用,仅包含订阅相关功能(绝对simple和stupid),也可直接克隆项目进行使用(包含自动同意superuser,自动接受入群邀请等功能)
|
||||||
作为插件使用请安装`nonebot-hk-reporter`包,并在`bot.py`中加载`nonebot_hk_reporter`插件;或直接克隆本项目进行使用
|
作为插件使用请安装`nonebot-hk-reporter`包,并在`bot.py`中加载`nonebot_hk_reporter`插件;或直接克隆本项目进行使用
|
||||||
配置与安装请参考[nonebot2文档](https://v2.nonebot.dev/)
|
配置与安装请参考[nonebot2文档](https://v2.nonebot.dev/)
|
||||||
<details>
|
|
||||||
<summary>Docker部署方法</summary>
|
|
||||||
|
|
||||||
Docker镜像地址为`felinae98/nonebot-hk-reporter`。例子:
|
|
||||||
```bash
|
|
||||||
docker run --name nonebot-hk-reporter --network <network name> -d -e 'SUPERUSERS=[<Your QQ>]' -v <config dir>:/data -e 'hk_reporter_config_path=/data' -e 'HK_REPORTER_USE_PIC=True' -e 'HK_REPORTER_USE_LOCAL=True' felinae98/nonebot-hk-reporter
|
|
||||||
```
|
|
||||||
go-cqhttp镜像可使用`felinae98/go-cqhttp-ffmpeg`(数据目录为`/data`),需要注意,两个容器需要在同一个network中。
|
|
||||||
|
|
||||||
并且docker版本中提供了自动同意SUPERUSER好友申请和自动同意SUPERUSER的入群邀请的功能。
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### 配置变量
|
### 配置变量
|
||||||
* `HK_REPORTER_CONFIG_PATH` (str) 配置文件保存目录,如果不设置,则为当前目录下的`data`文件夹
|
* `HK_REPORTER_CONFIG_PATH` (str) 配置文件保存目录,如果不设置,则为当前目录下的`data`文件夹
|
||||||
|
22
docker-compose.yml
Normal file
22
docker-compose.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
cq-http:
|
||||||
|
image: felinae98/go-cqhttp-ffmpeg
|
||||||
|
volumes:
|
||||||
|
- ./bot-data:/data
|
||||||
|
browserless:
|
||||||
|
image: browserless/chrome
|
||||||
|
nonebot:
|
||||||
|
image: felinae98/nonebot-hk-reporter
|
||||||
|
volumes:
|
||||||
|
- ./nonebot-data:/data
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
HOST: 0.0.0.0
|
||||||
|
# SUPERUSERS: '[<your QQ>]'
|
||||||
|
HK_REPORTER_CONFIG_PATH: /data
|
||||||
|
HK_REPORTER_BROWSER: ws://browserless:3000
|
||||||
|
depends_on:
|
||||||
|
- browserless
|
||||||
|
- cq-http
|
@ -3,8 +3,10 @@ module.exports = {
|
|||||||
description: 'Docs for Nonebot HK Reporter',
|
description: 'Docs for Nonebot HK Reporter',
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
nav: [
|
nav: [
|
||||||
|
{ text: '主页', link: '/' },
|
||||||
{ text: '部署与使用', link: '/usage/' },
|
{ text: '部署与使用', link: '/usage/' },
|
||||||
{ text: '开发', link: '/dev/' }
|
{ text: '开发', link: '/dev/' },
|
||||||
|
{ text: 'Github', link: 'https://github.com/felinae98/nonebot-hk-reporter' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
---
|
---
|
||||||
home: true
|
home: true
|
||||||
heroText: Nonebot HK Reporter
|
heroText: Nonebot HK Reporter
|
||||||
|
tagline: 全网跑到什么地方,比其他的....bot跑得还快
|
||||||
actionText: 快速部署
|
actionText: 快速部署
|
||||||
actionLink: /usage/
|
actionLink: /usage/
|
||||||
features:
|
features:
|
||||||
- title: KISS
|
- title: KISS
|
||||||
details: 作为插件可以Simple和Stupid,作为插件可以Simple和Stupid,作为Bot提供适用的功能
|
details: 作为插件可以Simple和Stupid,作为插件可以Simple和Stupid,作为Bot提供适用的功能
|
||||||
- title: 拓展性强
|
- title: 拓展性强
|
||||||
details: 可以快速的添加新的网站
|
details: 没有自己想要的网站?只要简单的爬虫知识就可以给它适配一个新的网站
|
||||||
|
- title: 通用,强大
|
||||||
|
details: 社交媒体?网站更新?游戏开服?只要能爬就都能推,还支持自定义过滤
|
||||||
footer: MIT Licensed
|
footer: MIT Licensed
|
||||||
---
|
---
|
||||||
|
@ -2,6 +2,49 @@
|
|||||||
sidebar: auto
|
sidebar: auto
|
||||||
---
|
---
|
||||||
# 部署和使用
|
# 部署和使用
|
||||||
本节将教你快速部署和使用一个nonebot-hk-reporter
|
本节将教你快速部署和使用一个nonebot-hk-reporter,如果你不知道要选择哪种部署方式,推荐使用[docker-compose](#docker-compose部署-推荐)
|
||||||
|
|
||||||
## 快速上手
|
## 部署
|
||||||
|
本项目可以作为单独的Bot使用,可以作为nonebot2的插件使用
|
||||||
|
### 作为Bot使用
|
||||||
|
额外提供自动同意超级用户的好友申请和同意超级用户的加群邀请的功能
|
||||||
|
#### docker-compose部署(推荐)
|
||||||
|
1. 在一个新的目录中下载[docker-compose.yml](https://raw.githubusercontent.com/felinae98/nonebot-hk-reporter/main/docker-compose.yml)
|
||||||
|
将其中的`<your QQ>`改成自己的QQ号
|
||||||
|
```bash
|
||||||
|
wget https://raw.githubusercontent.com/felinae98/nonebot-hk-reporter/main/docker-compose.yml
|
||||||
|
```
|
||||||
|
2. 运行配置cq-http
|
||||||
|
```bash
|
||||||
|
docker-compose run cq-http
|
||||||
|
```
|
||||||
|
通信方式选择:3: 反向 Websocket 通信
|
||||||
|
编辑`bot-data/config.yml`,更改下面字段:
|
||||||
|
```
|
||||||
|
account: # 账号相关
|
||||||
|
uin: <QQ号> # QQ账号
|
||||||
|
password: "<QQ密码>" # 密码为空时使用扫码登录
|
||||||
|
|
||||||
|
............
|
||||||
|
|
||||||
|
servers:
|
||||||
|
- ws-reverse:
|
||||||
|
universal: ws://nonebot:8080/cqhttp/ws # 将这个字段写为这个值
|
||||||
|
```
|
||||||
|
3. 登录cq-http
|
||||||
|
再次
|
||||||
|
```bash
|
||||||
|
docker-compose run cq-http
|
||||||
|
```
|
||||||
|
参考[cq-http文档](https://docs.go-cqhttp.org/faq/slider.html#%E6%96%B9%E6%A1%88a-%E8%87%AA%E8%A1%8C%E6%8A%93%E5%8C%85)
|
||||||
|
完成登录
|
||||||
|
4. 确定完成登录后,启动bot:
|
||||||
|
```bash
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
#### docker部署
|
||||||
|
#### 直接运行(不推荐)
|
||||||
|
### 作为插件使用
|
||||||
|
本部分假设大家会部署nonebot2
|
||||||
|
## 配置
|
||||||
|
## 使用
|
||||||
|
Loading…
x
Reference in New Issue
Block a user