✏️ 人肉 lint

This commit is contained in:
fumiama
2021-12-04 20:56:43 +08:00
parent 793cac09cb
commit 610f04ab87
6 changed files with 21 additions and 12 deletions

View File

@@ -1,10 +1,12 @@
package plugin_sleep_manage
import (
"os"
log "github.com/sirupsen/logrus"
"github.com/FloatTech/ZeroBot-Plugin/plugin_sleep_manage/model"
"github.com/FloatTech/ZeroBot-Plugin/utils/process"
log "github.com/sirupsen/logrus"
"os"
)
func init() {

View File

@@ -1,11 +1,12 @@
package model
import (
"os"
"time"
"github.com/jinzhu/gorm"
_ "github.com/logoove/sqlite"
log "github.com/sirupsen/logrus"
"os"
"time"
)
type SleepDB gorm.DB

View File

@@ -2,12 +2,14 @@ package plugin_sleep_manage
import (
"fmt"
"github.com/FloatTech/ZeroBot-Plugin/control"
"github.com/FloatTech/ZeroBot-Plugin/plugin_sleep_manage/model"
"time"
log "github.com/sirupsen/logrus"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
"time"
"github.com/FloatTech/ZeroBot-Plugin/control"
"github.com/FloatTech/ZeroBot-Plugin/plugin_sleep_manage/model"
)
const dbpath = "data/SleepManage/"
@@ -65,13 +67,13 @@ func timeDuration(time time.Duration) (hour, minute, second int64) {
return hour, minute, second
}
//只统计6点到12点的早安
// 只统计6点到12点的早安
func isMorning(ctx *zero.Ctx) bool {
now := time.Now().Hour()
return now >= 6 && now <= 12
}
//只统计21点到凌晨3点的晚安
// 只统计21点到凌晨3点的晚安
func isEvening(ctx *zero.Ctx) bool {
now := time.Now().Hour()
return now >= 21 || now <= 3