Is it possible to record the kicks and bans to a file.. and getting the infos via IRC.. when we type !banfind .. where the bot will gives info in the channel.. abt who kicked/banned the user and for what reason.
set logging dir "~/eggdrop/logs"
setudef flag kick
logging binds
bind kick - * log:kick
proc log:kick {nick host hand chan targ text} {
global logdir
if {[lsearch -exact [channel info $chan] +kick] == -1} {return 0}
set logstr "\[[strftime %H:%M]\] *** $targ was kicked by $nick ($text)"
set addlog [open $logdir/[string range [string tolower $chan] 1 end].log a]
puts $addlog "$logstr"
close $addlog
}
set logging dir "~/eggdrop/logs"
set logchan "#test"
logging binds
bind kick - * log:kick
bind mode - "* +b" log:mode
proc log:kick {nick host hand chan targ text} {
global logdir
if {![channel get $logchan kick]} {return 0}
set logstr "\[[strftime %H:%M]\] *** $targ was kicked by $nick ($text)"
set addlog [open $logdir/[string range [string tolower $chan] 1 end].log a]
puts $addlog "$logstr"
close $addlog
}
proc log:mode {nick uhost hand chan chag vict} {
global logdir
if {![channel get $logchan mode]} {return 0}
set logstr "\[[strftime %H:%M]\] *** $nick sets mode: $chag $vict"
set addlog [open $logdir/[string range [string tolower $chan] 1 end].log a]
puts $addlog "$logstr"
close $addlog
}
I used logchan coz.. i dont want to log all the channels.. thats why used for specific channels.
Is it correct? And if its correct .. let me know how to find the bans from the file.. when i type !banfind nick.
maintaining a separate logfile for kickbans only is absolutely pointless, eggdrop already logs those for you, simply search through the bot's logfile(s)