-
Notifications
You must be signed in to change notification settings - Fork 1
/
Command.py
33 lines (25 loc) · 908 Bytes
/
Command.py
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
#
# Command.py
# Botpy
#
# Created by Ashish Ahuja on 1st August 2017
#
import chatexchange as ce
class Command:
def __init__(self, command_manager, message, arguments, usage_index=0):
self.command_manager = command_manager
self.message = message
self.arguments = arguments
self.usage_index = usage_index
def usage():
raise NotImplementedError("Function 'usage' must be implemented in the command.")
def privileges(self):
return 0
#Whether the command has completed execution.
finished = False
def reply(self, text, length_check=True):
self.message.message.reply(text, length_check=length_check)
def post(self, text, length_check=True):
self.message.room.send_message(text, length_check=length_check)
def run(self):
raise NotImplementedError("Function 'run' must be implemented in the command.")