Skip to content

Commit

Permalink
优化代码,启用一键更新
Browse files Browse the repository at this point in the history
  • Loading branch information
764763903a committed Dec 9, 2021
1 parent ff12fe9 commit 359e694
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 4 deletions.
106 changes: 106 additions & 0 deletions conf/demo_qbot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# go-cqhttp 默认配置文件

account: # 账号相关
uin: 1565396344 # QQ账号
password: '' # 密码为空时使用扫码登录
encrypt: false # 是否开启密码加密
status: 0 # 在线状态 请参考 https://docs.go-cqhttp.org/guide/config.html#在线状态
relogin: # 重连设置
delay: 3 # 首次重连延迟, 单位秒
interval: 3 # 重连间隔
max-times: 0 # 最大重连次数, 0为无限制

# 是否使用服务器下发的新地址进行重连
# 注意, 此设置可能导致在海外服务器上连接情况更差
use-sso-address: true

heartbeat:
# 心跳频率, 单位秒
# -1 为关闭心跳
interval: 5

message:
# 上报数据类型
# 可选: string,array
post-format: string
# 是否忽略无效的CQ码, 如果为假将原样发送
ignore-invalid-cqcode: false
# 是否强制分片发送消息
# 分片发送将会带来更快的速度
# 但是兼容性会有些问题
force-fragment: false
# 是否将url分片发送
fix-url: false
# 下载图片等请求网络代理
proxy-rewrite: ''
# 是否上报自身消息
report-self-message: false
# 移除服务端的Reply附带的At
remove-reply-at: false
# 为Reply附加更多信息
extra-reply-data: false
# 跳过 Mime 扫描, 忽略错误数据
skip-mime-scan: false

output:
# 日志等级 trace,debug,info,warn,error
log-level: warn
# 日志时效 单位天. 超过这个时间之前的日志将会被自动删除. 设置为 0 表示永久保留.
log-aging: 15
# 是否在每次启动时强制创建全新的文件储存日志. 为 false 的情况下将会在上次启动时创建的日志文件续写
log-force-new: true
# 是否启用 DEBUG
debug: false # 开启调试模式

# 默认中间件锚点
default-middlewares: &default
# 访问密钥, 强烈推荐在公网的服务器设置
access-token: ''
# 事件过滤器文件目录
filter: ''
# API限速设置
# 该设置为全局生效
# 原 cqhttp 虽然启用了 rate_limit 后缀, 但是基本没插件适配
# 目前该限速设置为令牌桶算法, 请参考:
# https://baike.baidu.com/item/%E4%BB%A4%E7%89%8C%E6%A1%B6%E7%AE%97%E6%B3%95/6597000?fr=aladdin
rate-limit:
enabled: false # 是否启用限速
frequency: 1 # 令牌回复频率, 单位秒
bucket: 1 # 令牌桶大小

database: # 数据库相关设置
leveldb:
# 是否启用内置leveldb数据库
# 启用将会增加10-20MB的内存占用和一定的磁盘空间
# 关闭将无法使用 撤回 回复 get_msg 等上下文相关功能
enable: true

# 连接服务列表
# 连接服务列表
servers:
# 添加方式,同一连接方式可添加多个,具体配置说明请查看文档
#- http: # http 通信
#- ws: # 正向 Websocket
#- ws-reverse: # 反向 Websocket
#- pprof: #性能分析服务器
# 正向WS设置
# - ws:
# # 正向WS服务器监听地址
# host: 127.0.0.1
# # 正向WS服务器监听端口
# port: 6700
# middlewares:
# <<: *default # 引用默认中间件
# 反向WS设置
# - ws-reverse:
# # 反向WS Universal 地址
# # 注意 设置了此项地址后下面两项将会被忽略
# universal: ws://127.0.0.1:8765/ws
# # 反向WS API 地址
# api: ws://127.0.0.1:8765/api
# # 反向WS Event 地址
# event: ws://127.0.0.1:8765/event
# # 重连间隔 单位毫秒
# reconnect-interval: 3000
# middlewares:
# <<: *default # 引用默认中间件
2 changes: 1 addition & 1 deletion models/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func initConfig() {
if _, err := os.Stat(confDir); err != nil {
os.MkdirAll(confDir, os.ModePerm)
}
for _, name := range []string{"app.conf", "config.yaml", "reply.php"} {
for _, name := range []string{"app.conf", "config.yaml", "reply.php", "qbot.yaml"} {
f, err := os.OpenFile(ExecPath+"/conf/"+name, os.O_RDWR|os.O_CREATE, 0777)
if err != nil {
logs.Warn(err)
Expand Down
9 changes: 6 additions & 3 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ aarch64)
arch="arm"
;;
esac
filename="xdd_linux_${arch}"
url="https://ghproxy.com/https://github.com/cdle/jd_study/releases/download/main/${filename}"
filename="xdd-linux-${arch}"
url="https://github.91chi.fun/https://github.com/764763903a/xdd-plus/releases/download/main/${filename}"
dirname="xdd"
cd $HOME
if [ ! -d dirname ];then
mkdir dirname
fi
cd xdd
curl -L $url -O $filename
#curl -L $url -O $filename
curl -L $url -o xdd
chmod 777 xdd
./xdd -d

0 comments on commit 359e694

Please sign in to comment.