-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgreetings.go
85 lines (80 loc) · 1.78 KB
/
greetings.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
81
82
83
84
85
package main
import (
"math/rand"
"strings"
)
//greetings add slack reaction response to greetings
func greetings(msg string) string {
slackGreetings := map[string]bool{
"hej": true,
"hello": true,
"hejo": true,
"witam": true,
"siema": true,
"siemka": true,
"siemanko": true,
"siemano": true,
"bonjorno": true,
"ahoj": true,
"joł": true,
"howgh": true,
"czołem": true,
"czesc": true,
"cześć": true,
"cze": true,
"elo": true,
":uszanowanko:": true,
":howdy:": true,
":ahoj:": true,
":hellohello:": true,
":hellohello2:": true,
":hellohello3:": true,
":hellohello4:": true,
":hellohello5:": true,
":hellohello6:": true,
":hellohello7:": true,
":hellohello8:": true,
":hellohelloleft:": true,
":hellohelloright:": true,
":hellohellowell:": true,
":hello_there:": true,
":pepe-witam:": true,
}
slackGreetingsEmoji := []string{
"howdy",
"hellohello",
"hellohello2",
"hellohello3",
"hellohello4",
"hellohelloleft",
"hello_there",
"vi-tam",
"uszanowanko",
"ship",
"spock-hand",
"hand",
"handshake",
"raising_hand",
"man-raising-hand",
"bonzur",
"good_moaning",
"rocker",
"the_horns",
"hey-girl",
"zheyguys",
"hotdog_hello",
"pig_hello",
"pig_hello2",
"pig_hello_door",
"pikachu-hello",
"ahoj",
"dobre_ranko",
"pepe-witam",
}
greetingsWord := strings.Split(strings.ToLower(msg), " ")
if slackGreetings[greetingsWord[0]] {
i := rand.Intn(len(slackGreetingsEmoji))
return slackGreetingsEmoji[i]
}
return ""
}