mirror of
http://aero2k.de/t/repos/urlbot-native.git
synced 2017-09-06 15:25:38 +02:00
enhanced random mode for the "dice" command
This commit is contained in:
@@ -241,9 +241,13 @@ def parse_commands(data):
|
|||||||
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:
|
elif 'dice' in data:
|
||||||
rnd = random.randint(1, 6)
|
if reply_user in conf('enhanced-random-user'):
|
||||||
dice_char = [u'⚀', u'⚁', u'⚂', u'⚃', u'⚄', u'⚅']
|
rnd = 0 # this might confuse users. good.
|
||||||
chat_write('rolling a dice for %s: %s (%d)' %(reply_user, dice_char[rnd-1], rnd))
|
else:
|
||||||
|
rnd = random.randint(1, 6)
|
||||||
|
|
||||||
|
dice_char = [u'◇', u'⚀', u'⚁', u'⚂', u'⚃', u'⚄', u'⚅']
|
||||||
|
chat_write('rolling a dice for %s: %s (%d)' %(reply_user, dice_char[rnd], 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'
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ if '__main__' == __name__:
|
|||||||
config = {}
|
config = {}
|
||||||
config['src-url'] = 'FIXME'
|
config['src-url'] = 'FIXME'
|
||||||
|
|
||||||
|
# the "dice" feature will use more efficient random data (0) for given users
|
||||||
|
config['enhanced-random-user'] = ( 'FIXME', 'FIXME' )
|
||||||
|
|
||||||
def conf(val):
|
def conf(val):
|
||||||
if val in config.keys():
|
if val in config.keys():
|
||||||
return config[val]
|
return config[val]
|
||||||
|
|||||||
Reference in New Issue
Block a user