Its not that complicated. However the ChanServ, part you would have to make the bot operup and defining different accesses for users, adding lots of flags, hosts could be a rain pain.
The easiest way is to, download a pub cmd tcl from the egghelp tcl archive.
You can have an idea from that; there are plenty availiable which have variations of commands.
There are many simple commands such as !op, !deop, !kick, !ban which are very basic and easy to code in tcl.
You can bind them to dcc for them to work in private, or on a channel as in binding pub, or even in notices, its all upto you.
Example:
Code: Select all
#This code will op a user with flag "+o", when !op is triggered.
#If there are nicks specified, it will op those nicks.
#Triggers on channels only.
#Usage:
!op #ops person triggered
!op <nicks> #ops nicks mentioned
|
|_ <nick1 nick2 nick3.........nick6>
bind pub o !op op:user
proc op:user {nick uhost hand chan text} {
if {([lindex $text 0] == "")} {
putserv "MODE $chan +o $nick"
}
if {([lindex $text 0] != "")} {
putserv "MODE $chan +oooooo [lindex $text 0] [lindext $text 1] [lindex $text 2] [lindex $text 3] [lindext $text 4] [lindex $text 5]"
}
}
We can make it check lots of things in this way. For example make the bot check if its op before opping the person or those people. [botisop $chan].
Even if the bot is not a channel op and is a services/server admin (ircoper) with +a, +A flag, it could use /samode to op the person or those people.
Similarly, the bot be more user friendly, if we make the bot check for ops, if it is opered up, if the user is already opped and asking for ops ([isop $nick $chan]), or not to opped the nicks mentioned which are already opped.
Suppose if the bot is not opered up or opped in the channel and some one requests this trigger then the bot can check if its not opered up, operup and use the command.
I would recommend you keep your bot a services admin atleast +a mode, since you would want your bot to join everychannel as ChanServ doesn't join every network chan. Then you can use bind msg, private message chanserv for help or even bind notc, private notice for the triggers.
We can make the bot check if that person or any of those people are on the channel ([onchan [lindex $text 0] $chan]), before oping and we can even limit the command say to be triggered on the channels you want etc. We can check that user's channel or global flags, even if that user has a specific uhost etc before triggering.
There are many things we would do with just this simple piece of code.