"dice" added

This commit is contained in:
urlbot
2014-09-18 19:06:54 +02:00
parent 288e41efaf
commit cbb602ad4f

View File

@@ -212,7 +212,7 @@ def parse_commands(data):
return False return False
if 'command' in data: if 'command' in data:
chat_write(reply_user + (""": known commands: 'command', 'info', 'hangup', 'nospoiler', 'ping', 'uptime', 'source', 'version'""")) chat_write(reply_user + (""": known commands: 'command', 'dice', 'info', 'hangup', 'nospoiler', 'ping', 'uptime', 'source', 'version'"""))
elif 'version' in data: elif 'version' in data:
chat_write(reply_user + (''': I'm running ''' + VERSION)) chat_write(reply_user + (''': I'm running ''' + VERSION))
elif 'unikot' in data: elif 'unikot' in data:
@@ -221,6 +221,10 @@ def parse_commands(data):
chat_write(reply_user + (u''': └────────┘''')) chat_write(reply_user + (u''': └────────┘'''))
elif 'source' in data: elif 'source' in data:
chat_write('My source code can be found at %s' % conf('src-url')) chat_write('My source code can be found at %s' % conf('src-url'))
elif 'dice' in data:
rnd = random.randint(1, 6)
dice_char = [u'', u'', u'', u'', u'', u'']
chat_write('rolling a dice for %s: %s (%d)' %(reply_user, dice_char[rnd-1], rnd))
elif 'uptime' in data: elif 'uptime' in data:
u = int(uptime + time.time()) u = int(uptime + time.time())
plural_uptime = 's' plural_uptime = 's'