Actually, I think you're looking at the wrong kind of binding..
msg bindings are used for user-to-user messages, not user-to-channel messages. As such, there is no channel information related to the message.
Or were you thinking of forcing the user to supply the channel name in the message? If so, extract the channel from the message, and use the
matchattr command to test the privileges.
As for the flags-mask, the syntax is "globalflags[(&|)[channelflags[(&|)botflags]]]", where & specifies that all flags must match, and | any flag will be sufficient. For applications that does not provide a channelname, the channelflags part is tested against any/all channels.
A few examples of different "flag-masks". I've used bindings here, but they could easily be swapped for the matchattr command (msg binding would be equivalent of omitting the channel argument, pub would be including it).
Code: Select all
bind msg o msg:test
#Triggers for any global op.
bind msg o|o msg:test2
#Triggers for any global op, and any local op in any channel
bind pub o pub:test
#Triggers for any global op.
bind pub o|o pub:test2
#Triggers for any global op, and any local op in the channel it's invoked within.
bind pub o&o pub:test3
#Triggers for any user who is both a global op and a local op for the channel it's invoked within.
bind pub fp| pub:test4
#Triggers for any global friend or partyline access user.
bind pub fp& pub:test5
#Triggers for any user with both global op and partyline access.
Reading your post a second time, I believe this is what you are looking for:
Code: Select all
bind msg o|o qban msg:qban
proc msg:qban {nick host handle stuff} {
... extracting chan and storing it in $chan...
if {![matchattr $handle "o&o" $chan]} {
#User does not have permission for this command, abort
return 0
}
... Rest of code here...
}