From d13ee51aa6f1c651f713df793381614b3727b9b5 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Tue, 7 Dec 2021 07:16:13 -0500 Subject: [PATCH] Remove bump chaser --- config.go | 3 --- discordMessage.go | 19 +++++++------------ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/config.go b/config.go index d3edc13..e3acd1a 100644 --- a/config.go +++ b/config.go @@ -98,9 +98,6 @@ func bumpTimer(s *discordgo.Session) { bump = false config.BumpTime = time.Now() time.Sleep(2 * time.Hour) - if time.Since(lastActiveTime) < (5 * time.Minute) { - s.ChannelMessageSend(lastActiveChan, "!d bump is ready, please use it. (say \"!d bump\" without the quotes)") - } s.ChannelMessageSend(config.AdminChannel, "!d bump is ready.") bump = true } diff --git a/discordMessage.go b/discordMessage.go index 2780594..afb8718 100644 --- a/discordMessage.go +++ b/discordMessage.go @@ -2,9 +2,9 @@ package main import ( "fmt" + "regexp" "strings" "time" - "regexp" "github.com/bwmarrin/discordgo" ) @@ -12,18 +12,18 @@ import ( func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { defer log.PanicSafe() - if m.Author.ID == "302050872383242240" && len(m.Embeds) > 0 { + 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) - m.Content = fmt.Sprintf("%+v bs %+v", s.State.User.Mention(), match[1]) + m.Content = fmt.Sprintf("%+v bs %+v", s.State.User.Mention(), match[1]) BumpSet(BotCommand{ Message: m, Session: s, - Parts: strings.Split(m.Content, " ")[2:], + Parts: strings.Split(m.Content, " ")[2:], }) - + } if strings.Contains(m.Embeds[0].Description, "Bump done!") { log.LogDebug("Finding string %+v", m.Embeds[0].Description) @@ -35,7 +35,7 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { return } - if m.Author.Bot || m.Author.ID == s.State.User.ID { + if m.Author.Bot || m.Author.ID == s.State.User.ID { return } if m.GuildID == "" { @@ -52,7 +52,7 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { } return } - + if m.ChannelID != config.AdminChannel { lastActiveChan = m.ChannelID lastActiveTime = time.Now() @@ -103,11 +103,6 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { } } } - } else { - log.LogDebug("strings.Contains(m.Content, s.State.User.ID) was false for %+v", m.Content) - if bump { - s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("%+v please say \"!d bump\" without the quotes to bump our server :)", m.Author.Mention())) - } } }