Browse Source

Don't look for user in bump response

master
Gregory Rudolph 2 years ago
parent
commit
27d5cf3a62
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 14
      discordMessage.go

14
discordMessage.go

@ -27,10 +27,8 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
} }
if strings.Contains(m.Embeds[0].Description, "Bump done!") { if strings.Contains(m.Embeds[0].Description, "Bump done!") {
log.LogDebug("Finding string %+v", m.Embeds[0].Description) log.LogDebug("Finding string %+v", m.Embeds[0].Description)
re := regexp.MustCompile("<@(.*)>") go bumpTimer()
match := re.FindStringSubmatch(m.Embeds[0].Description) return
activeInteraction(s, match[1])
config.LastBumper = match[1]
} }
return return
@ -59,14 +57,6 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
activeInteraction(s, m.Author.ID) activeInteraction(s, m.Author.ID)
} }
} }
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
}
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,

Loading…
Cancel
Save