A few remarks...
Code: Select all
set advertismentid($advertisment) [timer $advertismenttime "showadvertisment $chan \"$advertisment\" \"$advertisment\""]
This is a very bad way of starting timers.. Since the contents of
advertisment originates from a possibly untrusted user, it could contain malicious things such as [adduser badboy *!*@*] and [chattr badboy +n].
As the timer expires, that would be executed, adding a new user to the bot with owner privileges...
The proper way is to use
list
Code: Select all
set advertismentid($advertisment) [timer $advertismenttime [list showadvertisment $chan $advertisment $advertisment]]
Code: Select all
set advertismenttime [join [lrange [split $arg] 0 0]]
This could be simplified:
Code: Select all
set advertismenttime [lindex [split $arg] 0]
Code: Select all
set arg [join [lrange [split $arg] 0 end]]
This is pretty much a no-op... you split the string to a list, select a subset from the first to the last element (inclusive, being the whole list), and then convert it back into a string (should be the very same string you started with).