demand a roll prefix on the Dice module
This commit is contained in:
parent
b9ef46606d
commit
5b44b66c4d
@ -28,6 +28,7 @@ class Dice(Module):
|
||||
def do(self, connection, event, nick, userhost, replypath, what, admin_unlocked):
|
||||
overallroll = what
|
||||
|
||||
if what.split(' ')[0] == 'roll':
|
||||
rolls = re.split(';\s*', overallroll)
|
||||
reply = ""
|
||||
for roll in rolls:
|
||||
@ -63,7 +64,7 @@ class Dice(Module):
|
||||
else:
|
||||
modifier = int(matches.group(6))
|
||||
|
||||
result = ''
|
||||
result = nick + ': ' + roll + ': '
|
||||
if comment is not None:
|
||||
result += comment + ': '
|
||||
|
||||
@ -95,6 +96,8 @@ class Dice(Module):
|
||||
reply += "; "
|
||||
if reply is not "":
|
||||
return self.reply(connection, replypath, reply)
|
||||
else:
|
||||
print(what.split(' ')[0])
|
||||
|
||||
# vi:tabstop=4:expandtab:autoindent
|
||||
# kate: indent-mode python;indent-width 4;replace-tabs on;
|
||||
|
Loading…
x
Reference in New Issue
Block a user