mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-07 19:49:23 +01:00
Fix bug #1027279, $randomnick should not return msg.nick
This commit is contained in:
parent
cdd07ecb83
commit
5570ba3dbe
@ -420,7 +420,14 @@ def standardSubstitute(irc, msg, text, env=None):
|
|||||||
return time.ctime(t)
|
return time.ctime(t)
|
||||||
def randNick():
|
def randNick():
|
||||||
if channel != 'somewhere':
|
if channel != 'somewhere':
|
||||||
return random.choice(list(irc.state.channels[channel].users))
|
L = list(irc.state.channels[channel].users)
|
||||||
|
if len(L) > 1:
|
||||||
|
n = msg.nick
|
||||||
|
while n != msg.nick:
|
||||||
|
n = random.choice(L)
|
||||||
|
return n
|
||||||
|
else:
|
||||||
|
return msg.nick
|
||||||
else:
|
else:
|
||||||
return 'someone'
|
return 'someone'
|
||||||
ctime = time.ctime()
|
ctime = time.ctime()
|
||||||
|
Loading…
Reference in New Issue
Block a user