|
|
|
@ -12,7 +12,8 @@ import (
@@ -12,7 +12,8 @@ import (
|
|
|
|
|
func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { |
|
|
|
|
defer log.PanicSafe() |
|
|
|
|
|
|
|
|
|
if m.Author.ID == "302050872383242240" && len(m.Embeds) > 0 && strings.Contains(m.Embeds[0].Description, "minutes until the server can be bumped") { |
|
|
|
|
if m.Author.ID == "302050872383242240" && len(m.Embeds) > 0 { |
|
|
|
|
if strings.Contains(m.Embeds[0].Description, "minutes until the server can be bumped") { |
|
|
|
|
log.LogDebug("Failed bump detected") |
|
|
|
|
re := regexp.MustCompile("Please wait another (.*) minutes until the server can be bumped") |
|
|
|
|
match := re.FindStringSubmatch(m.Embeds[0].Description) |
|
|
|
@ -22,6 +23,20 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
@@ -22,6 +23,20 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|
|
|
|
Session: s, |
|
|
|
|
Parts: strings.Split(m.Content, " ")[2:], |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if strings.Contains(m.Embeds[0].Description, "Bump done!") { |
|
|
|
|
log.LogDebug("Finding string %+v", m.Embeds[0].Description) |
|
|
|
|
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 |
|
|
|
|
} |
|
|
|
|
activeInteraction(s, m.Author.ID) |
|
|
|
|
config.LastBumper = m.Author.ID |
|
|
|
|
//go bumpTimer(s)
|
|
|
|
|
} |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if m.Author.Bot || m.Author.ID == s.State.User.ID { |
|
|
|
|
return |
|
|
|
|