I want to make my bot to give me op when I send it a special message. For example I type: "/msg Bot opme".
Code: Select all
bind msg - opme aop_op
proc aop_op {nick host hand chan text} {
pushmode $chan +o $nick
return 0
} Whats's wrong?
Code: Select all
bind msg - opme aop_op
proc aop_op {nick host hand chan text} {
pushmode $chan +o $nick
return 0
} Code: Select all
MSG
bind msg <flags> <command> <proc>
procname <nick> <user@host> <handle> <text>
Description: used for /msg commands. The first word of the user's
msg is the command, and everything else becomes the text argument.
Code: Select all
bind msg - opme opme
proc opme {nick uhost hand arg} {
foreach chan [channels] {
pushmode $chan +o $nick
}
}Code: Select all
bind msg - opme opme
proc opme {nick host hand arg} {
set chan "[lindex [split $arg] 0]"
if {"$chan" == "" || ![string match "#*" "$chan"]} {
puthelp "notice $nick :Wrong Channel Synthax! Try again."
return
} elseif {![validchan $chan]} {
puthelp "notice $nick :$chan isn't in my channellist"
return
} elseif {![botisop $chan]} {
puthelp "notice $nick :I'm not opped in $chan!"
return
} elseif {[isop $nick $chan]} {
puthelp "notice $nick :You're already opped in $chan!"
return
}
pushmode $chan +o $nick
puthelp "notice $nick :Done!"
}