Cleaning up/Happy path
This commit is contained in:
@ -23,6 +23,22 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if isAdmin(m.Member) {
|
||||
adminInteraction(s, m.Author.ID)
|
||||
}
|
||||
if m.ChannelID != config.AdminChannel {
|
||||
lastActiveChan = m.ChannelID
|
||||
lastActiveTime = time.Now()
|
||||
}
|
||||
if strings.HasPrefix(m.Content, "!d bump") {
|
||||
if time.Since(config.BumpTime) < 2*time.Hour {
|
||||
s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("Sorry, <@%+v> already claimed the bump. Better luck next time!", config.LastBumper))
|
||||
return
|
||||
}
|
||||
config.LastBumper = m.Author.ID
|
||||
go bumpTimer(s)
|
||||
return
|
||||
}
|
||||
if strings.Contains(m.Content, s.State.User.ID) {
|
||||
b := BotCommand{
|
||||
Session: s,
|
||||
@ -63,22 +79,7 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||
s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("%+v please say \"!d bump\" without the quotes to bump our server :)", m.Author.Mention()))
|
||||
}
|
||||
}
|
||||
if isAdmin(m.Member) {
|
||||
adminInteraction(s, m.Author.ID)
|
||||
}
|
||||
if m.ChannelID != config.AdminChannel {
|
||||
lastActiveChan = m.ChannelID
|
||||
lastActiveTime = time.Now()
|
||||
}
|
||||
if strings.HasPrefix(m.Content, "!d bump") {
|
||||
if time.Since(config.BumpTime) < 2*time.Hour {
|
||||
s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("Sorry, <@%+v> already claimed the bump. Better luck next time!", config.LastBumper))
|
||||
return
|
||||
}
|
||||
config.LastBumper = m.Author.ID
|
||||
go bumpTimer(s)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func handlePM(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||
|
||||
Reference in New Issue
Block a user