Browse Source

Don't look for user in bump response

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

Loading…
Cancel
Save