Skip to content

Commit

Permalink
docs:README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SHA-4096 committed Sep 15, 2023
1 parent 7b34ed8 commit f04ac2a
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# chattyDiaryBot

## 概述
一个可以用来写日记的bot后端
支持多用户同时使用(大概)
接入go-cqhttp

## 部署

### 数据库
项目正常运行需要mysql和redis两个数据库
如果只是下载下来玩玩的话,可以使用docker迅速部署mysql和redis

### 配置
将config/config-template.yaml改名为config.yaml,并按照文件里的提示进行配置
bot的图像搜索功能需要bing的图像搜索API,获取方法请自行搜索

### 运行
在终端进入`chattyDiaryBot`文件夹内,执行
```bash
./chattyDiaryBot
```
然后bot就会跑起来啦

### 使用
bot的所有功能都在私聊里面实现
- `/r num` 查询近num天的日记
- `/d xxxxxxx` 记录日记
- `/s xxxxxxx` 搜索图片并随机返回一张
32 changes: 32 additions & 0 deletions config/config-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
host: #设置自身的监听端口
port: "5701"

server: #设置go-cqhttp的监听端口
addr: "localhost"
port: "5700"

logConfig: #日志配置
logPath: "./deploy/logs"
maxAge: 1
rotateTime: 3

database: #设置数据库
mysql:
username: ""
password: ""
host: "localhost"
port: "3306"
dbName: ""
timeout: "10s"
redis:
redisAddr: "localhost:6379"
redisPassword: ""
redisDB: 0 #0 is the default db

bot: #设置bot日记提醒的时间以及bing图片搜索的APIkey
remindHour: 23
bingAPIKey: ""

users: #设置每日日记提醒的qq号
- 114514
- 1919810

0 comments on commit f04ac2a

Please sign in to comment.