-
Notifications
You must be signed in to change notification settings - Fork 0
/
mdeop.etcl
executable file
·53 lines (49 loc) · 1.9 KB
/
mdeop.etcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
###
# Usage: /msg botnick mdeop [<channel>]
###
### MDEOP:
bind msg - mdeop "msg_error msg_mdeop"
bind pub - $set(cmd)mdeop "pub_error pub_mdeop"
### CHANNEL:
proc pub_mdeop {nick uhost handle chan text} {
if {[validuser $handle]} {
all_mdeop c $nick $uhost $handle $chan $text
}
}
### QUERY:
proc msg_mdeop {nick uhost handle text} {
if {![validuser $handle]} {
return
} elseif {[lindex $text 0] == ""} {
notice $nick $handle "Invalid request: Wheres the channel name?"
} elseif {![string match #* [lindex $text 0]]} {
notice $nick $handle "Invalid request: [lindex $text 0] is not a channel"
} else {
all_mdeop m $nick $uhost $handle [lindex $text 0] [lrange $text 1 end]
}
}
### MAIN:
proc all_mdeop {type nick uhost handle chan text} {
global set botnick
chan_settings mdeop $type $nick $uhost $handle $chan $text
if {[level $handle $chan] == "0" || ![auth_check $nick $uhost $handle $chan] || [backup_check $chan]} {
return
} elseif {![validchan $chan]} {
notice $nick $handle "Invalid request: $chan is not a valid channel"
} elseif {[string tolower $type] == "c" && [changet $chan nochanmsg]} {
notice $nick $handle "$set(cmd)commands have been disabled for $chan"
} elseif {[level $handle $chan] < [comget $chan mdeop]} {
notice $nick $handle "Your level of [level $handle $chan] is less then the required [comget $chan mdeop] for this command"
} elseif {![botisop $chan]} {
notice $nick $handle "I am not currently an operator in $chan."
putlog "> \[ERROR\] !$handle! ($nick!$uhost) i need operator status for mdeop"
} else {
msg $chan "MassDeop requested by \002$nick\002"
foreach n [chanlist $chan] {
if {[isop $n $chan] && [string tolower $n] != [string tolower $botnick]} {
pushmode $chan -o $n
}
}
putcmdlog "> !$handle! ($nick!$uhost) MDEOP\[$type\] ($chan)"
}
}