|
|
@ -23,6 +23,22 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { |
|
|
|
} |
|
|
|
} |
|
|
|
return |
|
|
|
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) { |
|
|
|
if strings.Contains(m.Content, s.State.User.ID) { |
|
|
|
b := BotCommand{ |
|
|
|
b := BotCommand{ |
|
|
|
Session: s, |
|
|
|
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())) |
|
|
|
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) { |
|
|
|
func handlePM(s *discordgo.Session, m *discordgo.MessageCreate) { |
|
|
|