bind pub -|- !removeme removeme:unicon

proc removeme:unicon {nick uhost hand channel text } {
putlog "the removeme command has been triggered" 
global added
global places
set found 0
set userdoc [open users.txt a+]
while {![eof $userdoc]} {
 gets $userdoc line
 if {$line == $nick} { set found 1 }
}
close $userdoc
if {$found} {
set userfile [open users.txt r]
set list [split [read $userfile] \n]
close $userfile
set location [lsearch $list $nick]
set endloc $location
set list [lreplace $list $location $endloc]
file rename -force users.txt users.txt.bak
set usersfile [open users.txt w]
puts $usersfile [join $list \n]
close $usersfile
set newtopic [string map -nocase [list $nick "" ] [topic $channel]]
putlog "$nick used: !removeme on $channel!"
putserv "TOPIC $channel :$newtopic"
putserv "NOTICE $nick :Succesfully removed you out of the topic."
incr places 1
} else {
 puthelp "privmsg $nick :Your not on the list, try !addme or report the bug to Syntax-error"
 }
}
