mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 06:20:08 +08:00
* feat:添加b站推送,写了一半 * feat:添加b站推送(后续看情况,替换掉chromepd) * fix:修复一直推送直播的bug * fix:添加缓存路径 * feat:添加推送列表,修复重复发消息的bug * feat:发现禁用有用,删除多余指令 * fix:修改格式 * fix:sleep无效 * fix:修改直播card * fix:增加长度 * fix:修改readme * fix:修lint,并去掉cron * fix:修lint * fix:去掉日志 Co-authored-by: Guohuiyuan <haibaraguo@yeahka.com>
29 lines
540 B
Go
29 lines
540 B
Go
package bilibilipush
|
|
|
|
import (
|
|
"github.com/FloatTech/zbputils/process"
|
|
log "github.com/sirupsen/logrus"
|
|
"os"
|
|
)
|
|
|
|
const (
|
|
cachePath = dbpath + "cache/"
|
|
dbpath = "data/bilibilipush/"
|
|
dbfile = dbpath + "push.db"
|
|
)
|
|
|
|
// bdb bilibili推送数据库
|
|
var bdb *bilibilipushdb
|
|
|
|
// 加载数据库
|
|
func init() {
|
|
go func() {
|
|
process.SleepAbout1sTo2s()
|
|
_ = os.MkdirAll(dbpath, 0755)
|
|
os.RemoveAll(cachePath)
|
|
_ = os.MkdirAll(cachePath, 0755)
|
|
bdb = initialize(dbfile)
|
|
log.Println("[bilibilipush]加载bilibilipush数据库")
|
|
}()
|
|
}
|