156:5747c959c293 | 157:aaa5618e8dc2 |
---|---|
32 import re | 32 import re |
33 import modulecore | 33 import modulecore |
34 import utility | 34 import utility |
35 import calc | 35 import calc |
36 import urllib.parse | 36 import urllib.parse |
37 import datetime | |
37 | 38 |
38 @modulecore.irc_command (args='<value> as <valuetype>') | 39 @modulecore.irc_command (args='<value> as <valuetype>') |
39 def convert (bot, args, reply, error, **rest): | 40 def convert (bot, args, reply, error, **rest): |
40 '''Performs numeric conversion.''' | 41 '''Performs numeric conversion.''' |
41 try: | 42 try: |
164 if result[0] == 'Traceback (most recent call last):': | 165 if result[0] == 'Traceback (most recent call last):': |
165 reply ('\x0f' + result[-1]) | 166 reply ('\x0f' + result[-1]) |
166 else: | 167 else: |
167 for line in result: | 168 for line in result: |
168 reply ('\x0f' + line) | 169 reply ('\x0f' + line) |
170 | |
171 @modulecore.irc_command (args='<format...>') | |
172 def strftime (reply, args, **rest): | |
173 reply ('\x0f' + datetime.datetime.utcnow().strftime (args['format'])) |