aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2018-11-28 17:41:42 -0800
committerChristine Dodrill <me@christine.website>2018-11-28 17:41:42 -0800
commitfd64075ea32a760527f71c9680d71f99607ffcc3 (patch)
tree9a52d8f66faa0bddcfafdfa186c5c0f3f8ec3629
parent2542025b0fb566f29155472abee96a1d77e86e5c (diff)
downloadx-fd64075ea32a760527f71c9680d71f99607ffcc3.tar.xz
x-fd64075ea32a760527f71c9680d71f99607ffcc3.zip
discord/ilo-kesi: mention people less
-rw-r--r--discord/ilo-kesi/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/discord/ilo-kesi/main.go b/discord/ilo-kesi/main.go
index 251b0a4..6d9f487 100644
--- a/discord/ilo-kesi/main.go
+++ b/discord/ilo-kesi/main.go
@@ -8,6 +8,7 @@ import (
"net/http"
"os"
"os/signal"
+ "regexp"
"syscall"
"time"
@@ -37,6 +38,8 @@ func init() {
rand.Seed(time.Now().UnixNano())
}
+var mentionRex = regexp.MustCompile(`<((@!?\d+)|(:.+?:\d+))>`)
+
func main() {
flag.Parse()
internal.HandleLicense()
@@ -97,7 +100,7 @@ func main() {
return
}
- s.ChannelMessageSend(m.ChannelID, chain.Generate(15))
+ s.ChannelMessageSend(m.ChannelID, mentionRex.ReplaceAllString(chain.Generate(15), "<narvi'a>"))
}
mc := func(s *discordgo.Session, m *discordgo.MessageCreate) {