-
Notifications
You must be signed in to change notification settings - Fork 0
/
hellodolly.go
57 lines (50 loc) · 1.5 KB
/
hellodolly.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
package hellodolly
import (
"math/rand"
"strings"
"github.com/Clinet/clinet_cmds"
"github.com/Clinet/clinet_features"
)
var Feature = features.Feature{
Name: "hellodolly",
Desc: "Inspired by the WordPress sample plugin! Responds with a random lyric from Louis Armstrong's Hello, Dolly.",
Cmds: []*cmds.Cmd{
cmds.NewCmd("hellodolly", "Responds with a random lyric from Louis Armstrong's Hello, Dolly", handleHelloDolly),
},
}
var lyrics = `Hello, Dolly
Well, hello, Dolly
It's so nice to have you back where you belong
You're lookin' swell, Dolly
I can tell, Dolly
You're still glowin', you're still crowin'
You're still goin' strong
We feel the room swayin'
While the band's playin'
One of your old favourite songs from way back when
So, take her wrap, fellas
Find her an empty lap, fellas
Dolly'll never go away again
Hello, Dolly
Well, hello, Dolly
It's so nice to have you back where you belong
You're lookin' swell, Dolly
I can tell, Dolly
You're still glowin', you're still crowin'
You're still goin' strong
We feel the room swayin'
While the band's playin'
One of your old favourite songs from way back when
Golly, gee, fellas
Find her a vacant knee, fellas
Dolly'll never go away
Dolly'll never go away
Dolly'll never go away again`
func handleHelloDolly(ctx *cmds.CmdCtx) *cmds.CmdResp {
//Split the lyrics by line into a slice
lines := strings.Split(lyrics, "\n")
//Choose a random line
line := rand.Intn(len(lines))
//Return the chosen line
return cmds.NewCmdRespEmbed("Hello Dolly", lines[line])
}