####################################
### The #Homicide Efnet Trivia Bot #
####################### Ophmisu ####
############# by WSergio ###########

set etname "$tgpath/txt/etapa.txt"
set etf [open $etname w+]
if {[string range [clock format [clock seconds] -format %m] 0 0]==0} { set etluna [string trim [clock format [clock seconds] -format %m] 0]
} else { set etluna [clock format [clock seconds] -format %m] }
set Year "[clock format [clock seconds] -format %Y]"
if {$etluna == 12} { set Year "[expr $Year + 1]" }
puts $etf "WSergio` final 00 00 [clock format [clock scan "next month"] -format %b] 01 $Year $tgchan both finalul etapei a $etluna\-a"
#puts $etf "WSergio` vacanta 12 00 Dec 22 [clock format [clock seconds] -format %Y] $tgchan announce vacanta de craciun"
#puts $etf "WSergio` revelio 12 00 Dec 31 [clock format [clock seconds] -format %Y] $tgchan announce revelion"
close $etf


set cmdetapa "!cetapa"

bind pubm - "$tgchan %$cmdetapa" etapa
proc etapa {nick host hand chan text} {
	global tgchan etluna tcdannounceevent2
	utimer 10 [puthelp "privmsg $tgchan :[tcdannounceevent2]"]
}

proc Etapa {} {
	if {[string range [clock format [clock seconds] -format %m] 0 0]==0} {
		set etapa [string trim [clock format [clock seconds] -format %m] 0]
	} else { 
		set etapa [clock format [clock seconds] -format %m] 
	
	}
}