Add bumpset
This commit is contained in:
10
config.go
10
config.go
@ -141,6 +141,16 @@ func saveConfig() {
|
||||
}
|
||||
}
|
||||
|
||||
func bumpSetTime(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||
bump = false
|
||||
parts := strings.Split(m.Content, " ")
|
||||
timer, err := strconv.Atoi(parts[1])
|
||||
if err != nil {
|
||||
s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("Unable to decode timer: %+v", parts[1]))
|
||||
}
|
||||
config.BumpTime = time.Now().Add(time.Duration(timer) * time.Minute).Add(-2 * time.Hour)
|
||||
s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("New bump time: %+v, expecting bump at %+v", config.BumpTime, config.BumpTime.Add(2*time.Hour)))
|
||||
}
|
||||
func findVerification(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||
defer log.PanicSafe()
|
||||
parts := strings.Split(m.Content, " ")
|
||||
|
||||
3
main.go
3
main.go
@ -366,6 +366,9 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||
if strings.HasPrefix(m.Content, rebootToken) {
|
||||
exit(s)
|
||||
}
|
||||
if strings.HasPrefix(m.Content, "!bumpset") {
|
||||
bumpSetTime(s, m)
|
||||
}
|
||||
if strings.HasPrefix(m.Content, "!veri") {
|
||||
findVerification(s, m)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user