From 7215dffb3b59e9c36dcb1855e957262331788f4a Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 30 Jun 2017 18:36:40 +0200 Subject: [PATCH] Improved bot --- jobs/discord/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jobs/discord/main.go b/jobs/discord/main.go index af3bbf0b..6e3749cd 100644 --- a/jobs/discord/main.go +++ b/jobs/discord/main.go @@ -67,6 +67,14 @@ func onMessage(s *discordgo.Session, m *discordgo.MessageCreate) { **!tag** [forum tag]`) } + // Has the bot been mentioned? + for _, user := range m.Mentions { + if user.ID == discord.State.User.ID { + s.ChannelMessageSend(m.ChannelID, m.Author.Mention()+" :heart:") + return + } + } + if strings.HasPrefix(m.Content, "!user ") { s.ChannelMessageSend(m.ChannelID, "https://notify.moe/+"+strings.Split(m.Content, " ")[1]) return