Disable !join until opped and try to regain op

This commit is contained in:
nyuszika7h 2014-07-15 22:59:08 +02:00
parent af253593c3
commit cce7c34caf

View File

@ -145,8 +145,13 @@ def connect_callback(cli):
cli.mode(botconfig.CHANNEL, "q") # unquiet all
cli.mode(botconfig.CHANNEL, "-m") # remove -m mode from channel
var.OPPED = True
elif modeaction == "+o" and target == botconfig.NICK and var.PHASE != "none":
decorators.unhook(HOOKS, 294) # forget about it
elif modeaction == "-o" and target == botconfig.NICK:
var.OPPED = False
cli.msg("ChanServ", "op " + botconfig.CHANNEL)
cli.who(botconfig.CHANNEL, "%nuhaf")
@ -417,6 +422,10 @@ def join(cli, nick, chann_, rest):
nick, _, __, cloak = parse_nick(nick)
if not var.OPPED:
cli.notice(nick, "Sorry, I'm not opped in {0}.".format(chan))
return
try:
cloak = var.USERS[nick]['cloak']
if cloak is not None and cloak in var.STASISED:
@ -1167,6 +1176,8 @@ def on_join(cli, raw_nick, chan, acc="*", rname=""):
break
if nick in var.DCED_PLAYERS.keys():
var.PLAYERS[nick] = var.DCED_PLAYERS.pop(nick)
if nick == "ChanServ" and not var.OPPED:
cli.msg("ChanServ", "op " + chan)
@cmd("goat")
def goat(cli, nick, chan, rest):