1 from connection
import hal
2 from globals import commands
, private
, nick
3 from basic_commands
import reply
6 def panic(who
, where
, args
):
7 "$panic: Engages panic mode in the channel. Hal will set mode +mi, clear all voices, and disable autovoice. The inverse is $unpanic."
9 reply(who
, where
, "Command not available in private, send it in a channel.")
11 hal
.connection
.mode(where
, "+mi")
12 hal
.connection
.privmsg("ChanServ", "ACCESS %s ADD %s 100" % (where
, nick
))
13 hal
.connection
.privmsg("ChanServ", "CLEAR %s VOICES" % where
)
14 hal
.connection
.privmsg("ChanServ", "ACCESS %s ADD %s 50" % (where
, nick
))
15 hal
.connection
.privmsg("ChanServ", "LEVELS %s SET AUTOVOICE 30" % where
)
16 commands
['panic'] = (perms
.op
, panic
)
18 def unpanic(who
, where
, args
):
19 "$unpanic: Disables $panic mode in the channel. Hall will set mode -i, voice everyone, and re-engage autovoice. Note that he leaves +m, since everyone is autovoiced anyway."
21 reply(who
, where
, "Command not available in private, send it in a channel.")
23 hal
.connection
.mode(where
, "-i")
24 hal
.connection
.privmsg("ChanServ", "LEVELS %s SET AUTOVOICE 0" % where
)
25 if where
in hal
.channels
:
28 for user
in hal
.channels
[where
].userdict
:
29 if len(buffer) < buffer_size
:
32 hal
.connection
.mode(where
, "+%s %s" % (("v" * buffer_size
),
36 hal
.connection
.mode(where
, "+%s %s" % (("v" * len(buffer)),
38 commands
['unpanic'] = (perms
.op
, unpanic
)