-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbasic.go
67 lines (56 loc) · 1.89 KB
/
basic.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
package jarvisbot
import (
"strings"
"github.com/tucnak/telebot"
)
// SayHello says hi.
func (j *JarvisBot) SayHello(msg *message) {
j.SendMessage(msg.Chat, "Hello there, "+msg.Sender.FirstName+"!", nil)
}
// Echo parrots back the argument given by the user.
func (j *JarvisBot) Echo(msg *message) {
if len(msg.Args) == 0 {
so := &telebot.SendOptions{ReplyTo: *msg.Message, ReplyMarkup: telebot.ReplyMarkup{ForceReply: true, Selective: true}}
j.SendMessage(msg.Chat, "/echo Jarvis Parrot Mode \U0001F426\nWhat do you want me to parrot?\n\n", so)
}
response := ""
for _, s := range msg.Args {
response = response + s + " "
}
j.SendMessage(msg.Chat, response, nil)
}
// Clear returns a message that clears out the folder
func (j *JarvisBot) Clear(msg *message) {
j.SendMessage(msg.Chat, "Lol, sure."+strings.Repeat("\n", 41)+"Cleared.", nil)
}
// Source returns a link to Jarvis's source code.
func (j *JarvisBot) Source(msg *message) {
j.SendMessage(msg.Chat, "Touch me: https://github.com/ejamesc/jarvisbot", nil)
}
// Start returns some help text.
func (j *JarvisBot) Start(msg *message) {
j.SendMessage(msg.Chat, `Hi there! I can help you with the following things:
/img - gets an image
/gif - gets a gif
/google - does a Google search
/xchg - does an exchange rate conversion
/youtube - does a Youtube search
/clear - clears your NSFW images for you
/psi - returns the current PSI numbers
/echo - parrots stuff back at you
/urbandict - does an Urban Dictionary search
Give these commands a try!`, nil)
}
func (j *JarvisBot) Help(msg *message) {
j.SendMessage(msg.Chat, `Some commands:
/img - gets an image
/gif - gets a gif
/google - does a Google search
/xchg - does an exchange rate conversion
/youtube - does a Youtube search
/clear - clears your NSFW images for you
/psi - returns the current PSI numbers
/echo - parrots stuff back at you
/urbandict - does an Urban Dictionary search
`, nil)
}