Skip to content

Commit 6e1a67c

Browse files
committed
Added some new base commands
1 parent be36c6f commit 6e1a67c

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

messages.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from user import User
2-
from models import Command, session, CommandCommand, QuoteCommand, CubeCommand, SocialCommand, ScheduleCommand
2+
from models import Command, session, CommandCommand, QuoteCommand, CubeCommand, SocialCommand, ScheduleCommand, WhoAmICommand, UptimeCommand, CactusCommand
33
from asyncio import async, coroutine
44
from functools import partial
55

@@ -47,6 +47,9 @@ def message_handler(self, data):
4747
"cube": CubeCommand,
4848
"social": SocialCommand,
4949
"schedule": ScheduleCommand,
50+
"whoami": WhoAmICommand,
51+
"uptime": UptimeCommand,
52+
"cactus": CactusCommand
5053
}
5154
if args[0][1:] in commands:
5255
yield from self.send_message(

models.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from datetime import datetime
77
from re import sub, findall
88
from random import randrange
9-
from schedule import Schedule
109

1110
from user import User
1211

@@ -185,13 +184,26 @@ def __call__(self, args, data=None):
185184
if action is "add":
186185
time = interval[:-1]
187186
modifer = interval[-1:]
188-
189-
190187
elif action is "remove":
191188
pass
192189
else:
193190
pass
194191

192+
193+
class WhoAmICommand(Command):
194+
def __call__(self, args, data=None):
195+
return 'Ohai, {name}! Want a :cactus ?'.format(name=data['token'])
196+
197+
198+
class UptimeCommand(Command):
199+
def __call__(self, args, data=None):
200+
return 'This isn\'t done yet. #BlameLiveLoading :cactus'
201+
202+
203+
class CactusCommand(Command):
204+
def __call__(command):
205+
return 'Ohai! I\'m CactusBot! And you are?'
206+
195207
# #### TO BE REDONE IN USERS MODEL #### #
196208

197209

0 commit comments

Comments
 (0)