Altered lithp command to handle 'z' and changed a list comprehension with a builtin to a map

This commit is contained in:
Jeremy Fincher 2003-03-31 10:45:41 +00:00
parent bfc6533d22
commit 988618af4f
1 changed files with 3 additions and 1 deletions

View File

@ -244,7 +244,7 @@ class FunCommands(callbacks.Privmsg):
arg = privmsgs.getArgs(args)
m = re.match(self._dicere, arg)
if m:
(dice, sides) = [int(s) for s in m.groups()]
(dice, sides) = map(int, m.groups())
if dice > 6:
irc.error(msg, 'You can\'t roll more than 6 dice.')
elif sides > 100:
@ -265,7 +265,9 @@ class FunCommands(callbacks.Privmsg):
text = text.replace('ss', 'th')
text = text.replace('SS', 'th')
text = text.replace('s', 'th')
text = text.replace('z', 'th')
text = text.replace('S', 'TH')
text = text.replace('Z', 'TH')
text = text.replace('x', 'kth')
text = text.replace('X', 'KTH')
irc.reply(msg, text)