mirror of
https://github.com/Penguin-71630/meme-bot-frontend-dc.git
synced 2026-03-12 12:30:15 +08:00
- Introduce tracing - Introduce cobra / viper framework - Introduce resty client - Seperate files in api/ and bot/ - Trim unused functions
24 lines
448 B
Go
24 lines
448 B
Go
package bot
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
)
|
|
|
|
// Message listener for "ciallo"
|
|
func (b *Bot) onMessageCreate(
|
|
s *discordgo.Session,
|
|
m *discordgo.MessageCreate,
|
|
) {
|
|
// Ignore messages from the bot itself
|
|
if m.Author.ID == s.State.User.ID {
|
|
return
|
|
}
|
|
|
|
// Check if message is "ciallo" (case insensitive)
|
|
if strings.ToLower(strings.TrimSpace(m.Content)) == "ciallo" {
|
|
s.ChannelMessageSend(m.ChannelID, "Ciallo!")
|
|
}
|
|
}
|