mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-13 02:30:26 +00:00
✏️ 人肉 lint
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user