Skip to content

Commit

Permalink
增加/task命令
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Apr 2, 2020
1 parent 6122a27 commit eab92df
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ const (
/bind 绑定新账户
/unbind 解绑账户
/help 帮助
/task 手动执行一次任务(管理员)
源码及使用方法:https://github.com/iyear/E5SubBot
`
)

var (
UserStatus map[int64]int
UserSignOk map[int64]int
UserCid map[int64]string
UserCSecret map[int64]string
BindMaxNum int
notice string
admins []int64
admin []int64
)

const (
Expand All @@ -48,11 +47,13 @@ func init() {

BindMaxNum = viper.GetInt("bindmax")
notice = viper.GetString("notice")
admin = GetAdmin()

viper.WatchConfig()
viper.OnConfigChange(func(e fsnotify.Event) {
BindMaxNum = viper.GetInt("bindmax")
notice = viper.GetString("notice")
admin = GetAdmin()
})

UserStatus = make(map[int64]int)
Expand Down Expand Up @@ -177,3 +178,12 @@ func bOnText(m *tb.Message) {
}
}
}
func bTask(m *tb.Message) {
for _, a := range admin {
if a == m.Chat.ID {
SignTask()
return
}
}

}

0 comments on commit eab92df

Please sign in to comment.