|
11 | 11 | from plugins.welcome_machine import WelcomeMachine
|
12 | 12 | from plugins.dice_roller import DiceRoller
|
13 | 13 | from plugins.reddit import RedditManager
|
| 14 | +from plugins.star_date import StarDate |
14 | 15 |
|
15 | 16 | class IRCBot(irc.IRCClient):
|
16 | 17 |
|
@@ -184,6 +185,9 @@ def evaluate_command(self, user, channel, msg):
|
184 | 185 |
|
185 | 186 | elif msg == "!randtime":
|
186 | 187 | self.msg(channel, "Random Hour:Minute %d:%.2d" % (random.randint(0,23), random.randint(0,59)) )
|
| 188 | + |
| 189 | + elif msg == "!stardate": |
| 190 | + self.msg(channel, StarDate.current_stardate()) |
187 | 191 |
|
188 | 192 | elif msg.startswith( ('!commands', '!help') ):
|
189 | 193 | if len(msg_splits) == 1:
|
@@ -270,7 +274,7 @@ def _help_command(self, command=None):
|
270 | 274 | """This method returns the help message"""
|
271 | 275 |
|
272 | 276 | help_msg = "Valid commands: !help <command>, !commands, !karma [user], !roll Nd(3|4|6|8|10|20), !rand arg, !randtime,"
|
273 |
| - help_msg += "!reddit [entries] [subject], !lastseen USER, !beskarma, !worstkarma, !bestwords, !worstwords" |
| 277 | + help_msg += "!reddit [entries] [subject], !lastseen USER, !beskarma, !worstkarma, !bestwords, !worstwords, !stardate" |
274 | 278 |
|
275 | 279 | if command is not None:
|
276 | 280 |
|
@@ -305,6 +309,9 @@ def _help_command(self, command=None):
|
305 | 309 | elif command == "worstkarma":
|
306 | 310 | help_msg = "!worstkarma returns a list of the worst karmed users. Short form: !wk"
|
307 | 311 |
|
| 312 | + elif command == "stardate": |
| 313 | + help_msg = "!stardate returns the current Star Trek stardate (info [it] http://it.wikipedia.org/wiki/Data_stellare - Test: http://goo.gl/DEc4n)" |
| 314 | + |
308 | 315 | else:
|
309 | 316 | help_msg = "%s is not a valid command!" % command
|
310 | 317 |
|
|
0 commit comments