-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandler.go
80 lines (74 loc) · 2.02 KB
/
handler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package main
import (
"fmt"
"strings"
"github.com/bwmarrin/discordgo"
)
func messageHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
// Ignore all messages created by the bot itself
if m.Author.ID == BotID {
return
}
// message contain some text and the bot mention
switch {
case strings.Contains(strings.ToUpper(m.Content), "BOT"):
{
_, err = s.ChannelMessageSend(m.ChannelID, "Hi there!")
if err != nil {
fmt.Print(err)
}
}
case strings.Contains(strings.ToUpper(m.Content), "HELLO"):
{
_, err = s.ChannelMessageSend(m.ChannelID, "Hello sir, how can I help you!")
if err != nil {
fmt.Print(err)
}
}
case strings.Contains(strings.ToUpper(m.Content), "HI"):
{
_, err = s.ChannelMessageSend(m.ChannelID, "Hello sir, how can I help you!")
if err != nil {
fmt.Print(err)
}
}
case strings.Contains(strings.ToUpper(m.Content), "LTV"):
{
_, err = s.ChannelMessageSend(m.ChannelID, "tu LTV panchooda")
if err != nil {
fmt.Print(err)
}
}
}
// if message contain personal mentions
if m.ContentWithMentionsReplaced() == `<@&998929334645563502>` { //@fudi deya
_, err = s.ChannelMessageSend(m.ChannelID, "kithe marre aa kuriyave sare")
if err != nil {
fmt.Print(err)
}
}
if m.ContentWithMentionsReplaced() == `<@&765554608172957696>` { //@kings
_, err = s.ChannelMessageSend(m.ChannelID, "Acha, gusse sare king bnate aa")
if err != nil {
fmt.Print(err)
}
}
if m.ContentWithMentionsReplaced() == `<@&789483612072181771>` { //@ace
_, err = s.ChannelMessageSend(m.ChannelID, "aces te oda he FUDU aa")
if err != nil {
fmt.Print(err)
}
}
if m.ContentWithMentionsReplaced() == `<@&1090312377876107324>` { //@shady sandhu sunyara squad
_, err = s.ChannelMessageSend(m.ChannelID, "serious kaamm aa jalde kathe hovo")
if err != nil {
fmt.Print(err)
}
}
if m.ContentWithMentionsReplaced() == `@Sahil Sandhu` { // personal
_, err = s.ChannelMessageSend(m.ChannelID, "peo nu kato vaja marre janda")
if err != nil {
fmt.Print(err)
}
}
}