forked from endyourif/PythonSlackBot
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.py
More file actions
Latest commit
27 lines (20 loc) · 615 Bytes
/
Copy pathcommand.py
File metadata and controls
27 lines (20 loc) · 615 Bytes
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
classCommand(object):
def__init__(self):
self.commands= {
"jump" : self.jump,
"help" : self.help
}
defhandle_command(self, user, command):
response="<@"+user+">: "
ifcommandinself.commands:
response+=self.commands[command]()
else:
response+="Sorry I don't understand the command: "+command+". "+self.help()
returnresponse
defjump(self):
return"Kris Kross will make you jump jump"
defhelp(self):
response="Currently I support the following commands:\r\n"
forcommandinself.commands:
response+=command+"\r\n"
returnresponse