Dice: apply the irc formatting outside of the !roll handler
This commit is contained in:
parent
f5b367406b
commit
60b7a33f7b
@ -131,11 +131,11 @@ class Dice(Module):
|
|||||||
total += mode * res
|
total += mode * res
|
||||||
if repeat == 1:
|
if repeat == 1:
|
||||||
if comment != None:
|
if comment != None:
|
||||||
output = "%d %s 14(%s)" % (total, comment.strip(), curr_str)
|
output = "%d %s (%s)" % (total, comment.strip(), curr_str)
|
||||||
else:
|
else:
|
||||||
output = "%d 14(%s)" % (total, curr_str)
|
output = "%d (%s)" % (total, curr_str)
|
||||||
else:
|
else:
|
||||||
output += "%d 14(%s)" % (total, curr_str)
|
output += "%d (%s)" % (total, curr_str)
|
||||||
if i == repeat - 1:
|
if i == repeat - 1:
|
||||||
if comment != None:
|
if comment != None:
|
||||||
output += " (%s)" % (comment.strip())
|
output += " (%s)" % (comment.strip())
|
||||||
@ -285,7 +285,10 @@ class Dice(Module):
|
|||||||
match = re.search('!roll\s+(.*)$', what)
|
match = re.search('!roll\s+(.*)$', what)
|
||||||
if match:
|
if match:
|
||||||
dicestr = match.group(1)
|
dicestr = match.group(1)
|
||||||
return self.reply(connection, event, nick + ": " + self.do_roll(dicestr))
|
reply = nick + ": " + self.do_roll(dicestr)
|
||||||
|
# irc format it
|
||||||
|
return self.reply(connection, event,
|
||||||
|
re.sub(r"(\d+)(.*?\s+)(\(.*?\))", r"\1\214\3", reply))
|
||||||
|
|
||||||
match = re.search('!ctech\s+(.*)$', what)
|
match = re.search('!ctech\s+(.*)$', what)
|
||||||
if match:
|
if match:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user