Skip to content

Commit

Permalink
✏️ 人肉 lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Dec 4, 2021
1 parent 793cac0 commit 610f04a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ zerobot -h -t token -u url [-d|w] [-g 监听地址:端口] qq1 qq2 qq3 ...
- [x] /还原 xxx (在发送的群/用户还原xxx的开启状态到初始状态)
- [x] /用法 xxx
- [x] /服务列表
- [x] /服务详情
- [x] @Bot 插件冲突检测 (会在本群发送一条消息并在约 1s 后撤回以检测其它同类 bot 中已启用的插件并禁用)
- **聊天** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_chat"`
- [x] [BOT名字]
Expand All @@ -54,7 +55,7 @@ zerobot -h -t token -u url [-d|w] [-g 监听地址:端口] qq1 qq2 qq3 ...
- [x] 群温度
- [x] 设置温度[正整数]
- **ATRI** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_atri"`
- [x] 具体指令看代码
- [x] 具体指令看 /用法 atri
- 注:本插件基于 [ATRI](https://github.com/Kyomotoi/ATRI) ,为 Golang 移植版
- **群管** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_manager"`
- [x] 禁言[@xxx][分钟]
Expand Down Expand Up @@ -145,6 +146,8 @@ zerobot -h -t token -u url [-d|w] [-g 监听地址:端口] qq1 qq2 qq3 ...
- **每日运势** `import _ github.com/FloatTech/ZeroBot-Plugin/plugin_fortune`
- [x] 运势|抽签
- [x] 设置底图[车万 DC4 爱因斯坦 星空列车 樱云之恋 富婆妹 李清歌 公主连结 原神 明日方舟 碧蓝航线 碧蓝幻想 战双 阴阳师]
- **睡眠管理** `import _ github.com/FloatTech/ZeroBot-Plugin/plugin_sleep_manage`
- [x] 早安|晚安
- **浅草寺求签** `import _ github.com/FloatTech/ZeroBot-Plugin/plugin_omikuji`
- [x] 求签|占卜
- **bilibili** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_bilibili"`
Expand Down
3 changes: 2 additions & 1 deletion plugin_chat/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
package chat

import (
"github.com/FloatTech/ZeroBot-Plugin/control"
"math/rand"
"strconv"
"time"

zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/extension/rate"
"github.com/wdvxdr1123/ZeroBot/message"

"github.com/FloatTech/ZeroBot-Plugin/control"
)

var poke = rate.NewManager(time.Minute*5, 8) // 戳一戳
Expand Down
2 changes: 1 addition & 1 deletion plugin_manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package manager

import (
"fmt"
"github.com/FloatTech/ZeroBot-Plugin/control"
"io"
"math/rand"
"os"
Expand All @@ -18,6 +17,7 @@ import (
"github.com/wdvxdr1123/ZeroBot/extension/rate"
"github.com/wdvxdr1123/ZeroBot/message"

"github.com/FloatTech/ZeroBot-Plugin/control"
"github.com/FloatTech/ZeroBot-Plugin/plugin_manager/timer"
"github.com/FloatTech/ZeroBot-Plugin/utils/file"
"github.com/FloatTech/ZeroBot-Plugin/utils/math"
Expand Down
6 changes: 4 additions & 2 deletions plugin_sleep_manage/data.go
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
5 changes: 3 additions & 2 deletions plugin_sleep_manage/model/model.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 7 additions & 5 deletions plugin_sleep_manage/sleep_manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 610f04a

Please sign in to comment.