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