-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmdevoice.etcl
executable file
·53 lines (49 loc) · 1.9 KB
/
mdevoice.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 mdevoice [<channel>]
###
### MDEVOICE:
bind msg - mdevoice "msg_error msg_mdevoice"
bind pub - $set(cmd)mdevoice "pub_error pub_mdevoice"
### CHANNEL:
proc pub_mdevoice {nick uhost handle chan text} {
if {[validuser $handle]} {
all_mdevoice c $nick $uhost $handle $chan $text
}
}
### QUERY:
proc msg_mdevoice {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_mdevoice m $nick $uhost $handle [lindex $text 0] [lrange $text 1 end]
}
}
### MAIN:
proc all_mdevoice {type nick uhost handle chan text} {
global set botnick
chan_settings mdevoice $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 mdevoice]} {
notice $nick $handle "Your level of [level $handle $chan] is less then the required [comget $chan mdevoice] 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 mdevoice"
} else {
msg $chan "MassDevoice requested by \002$nick\002"
foreach n [chanlist $chan] {
if {[isvoice $n $chan]} {
pushmode $chan -v $n
}
}
putcmdlog "> !$handle! ($nick!$uhost) MDEVOICE\[$type\] ($chan)"
}
}