Cleaning bump set
This commit is contained in:
@ -11,10 +11,10 @@ import (
|
|||||||
|
|
||||||
func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
defer log.PanicSafe()
|
defer log.PanicSafe()
|
||||||
if m.Author.ID == "302050872383242240" && strings.Contains(m.Content, "minutes until the server can be bumped") {
|
if m.Author.ID == "302050872383242240" && strings.Contains(m.Embeds[0].Description, "minutes until the server can be bumped") {
|
||||||
log.LogDebug("Failed bump detected")
|
log.LogDebug("Failed bump detected")
|
||||||
re := regexp.MustCompile("Please wait another (.*) minutes until the server can be bumped")
|
re := regexp.MustCompile("Please wait another (.*) minutes until the server can be bumped")
|
||||||
match := re.FindStringSubmatch(m.Content)
|
match := re.FindStringSubmatch(m.Embeds[0].Description)
|
||||||
m.Content = fmt.Sprintf("@Thanos bs %+v", match[1])
|
m.Content = fmt.Sprintf("@Thanos bs %+v", match[1])
|
||||||
s.ChannelMessageSend(config.AdminChannel, m.Content)
|
s.ChannelMessageSend(config.AdminChannel, m.Content)
|
||||||
BumpSet(BotCommand{
|
BumpSet(BotCommand{
|
||||||
@ -22,9 +22,6 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||||||
Session: s,
|
Session: s,
|
||||||
Parts: strings.Split(m.Content, " ")[2:],
|
Parts: strings.Split(m.Content, " ")[2:],
|
||||||
})
|
})
|
||||||
} else if m.Author.ID == "302050872383242240" {
|
|
||||||
log.LogDebug("Not a failed bump.")
|
|
||||||
log.LogDebug(fmt.Sprintf("%+v: %+v", m.Author.ID, m.Embeds[0]))
|
|
||||||
}
|
}
|
||||||
if m.Author.ID == s.State.User.ID || m.Author.Bot {
|
if m.Author.ID == s.State.User.ID || m.Author.Bot {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user