-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvarious.go
More file actions
69 lines (55 loc) · 1.23 KB
/
various.go
File metadata and controls
69 lines (55 loc) · 1.23 KB
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
package various
import (
"github.com/go-chat-bot/bot"
)
func stabble(cmd *bot.Cmd) (msg string, err error) {
if len( cmd.Args) == 0 {
msg = "\u0001ACTION stabbles no-one. :(\u0001"
} else {
msg = "\u0001ACTION stabbles "+cmd.RawArgs+".\u0001"
}
return
}
func hugglefuck(cmd *bot.Cmd) (msg string, err error) {
if len( cmd.Args) == 0 {
msg = "\u0001ACTION hugglefucks no-one. :(\u0001"
} else {
msg = "\u0001ACTION hugglefucks "+cmd.RawArgs+" <3\u0001"
}
return
}
func newcmd(cmd *bot.Cmd) (msg string, err error) {
if len( cmd.Args) == 0 {
msg = "no command specified"
} else if len( cmd.Args) == 1 {
msg = "no action specified"
} else {
args := cmd.Args
bot.RegisterCommand(
cmd.Args[0],
"made",
"",
func(cmd2 *bot.Cmd) (msg string, err error) {
msg = args[1]
return msg, err
})
}
return
}
func init() {
bot.RegisterCommand(
"stabble",
"stabbles someone",
"",
stabble)
bot.RegisterCommand(
"hf",
"hugglefucks someone",
"",
hugglefuck)
bot.RegisterCommand(
"new",
"",
"",
newcmd)
}