Merge jcaoi's flastgame fix
This commit is contained in:
commit
e54c4274c5
@ -1148,6 +1148,8 @@ def on_nick(cli, prefix, nick):
|
||||
|
||||
def leave(cli, what, nick, why=""):
|
||||
nick, _, _, cloak = parse_nick(nick)
|
||||
|
||||
if what == "part" and why != botconfig.CHANNEL: return
|
||||
|
||||
if why and why == botconfig.CHANGING_HOST_QUIT_MESSAGE:
|
||||
return
|
||||
@ -1187,7 +1189,7 @@ def leave(cli, what, nick, why=""):
|
||||
var.DISCONNECTED[nick] = (cloak, datetime.now(), what)
|
||||
|
||||
#Functions decorated with hook do not parse the nick by default
|
||||
hook("part")(lambda cli, nick, *rest: leave(cli, "part", nick))
|
||||
hook("part")(lambda cli, nick, *rest: leave(cli, "part", nick, rest[0]))
|
||||
hook("quit")(lambda cli, nick, *rest: leave(cli, "quit", nick, rest[0]))
|
||||
hook("kick")(lambda cli, nick, *rest: leave(cli, "kick", rest[1]))
|
||||
|
||||
@ -2616,7 +2618,8 @@ def coin(cli, nick, chan, rest):
|
||||
|
||||
cli.msg(chan, "\2{0}\2 tosses a coin into the air...".format(nick))
|
||||
var.LOGGER.logMessage("{0} tosses a coin into the air...".format(nick))
|
||||
cmsg = "The coin lands on \2{0}\2.".format("heads" if random.random() < 0.5 else "tails")
|
||||
coin = random.choice(["heads", "tails"])
|
||||
cmsg = "The coin lands on \2{0}\2.".format(coin)
|
||||
cli.msg(chan, cmsg)
|
||||
var.LOGGER.logMessage(cmsg)
|
||||
|
||||
|
@ -78,8 +78,8 @@ import botconfig
|
||||
|
||||
RULES = (botconfig.CHANNEL + " channel rules: 1) Be nice to others. 2) Do not share information "+
|
||||
"after death. 3) No bots allowed. 4) Do not play with clones.\n"+
|
||||
"5) Do not quit unless you need to leave. 6) No swearing and keep it "+
|
||||
"family-friendly. 7) Do not paste PM's from the bot during the game. "+
|
||||
"5) Do not quit unless you need to leave. 6) Keep it "+
|
||||
"safe for work. 7) Do not paste PM's from the bot during the game. "+
|
||||
"8) Use common sense. 9) Waiting for timeouts is discouraged.")
|
||||
|
||||
# Other settings:
|
||||
|
Loading…
Reference in New Issue
Block a user