<noraj>
how can you pass options? I tried something like Timer(3, shots=1)
<dominikh>
Timer accepts a block, which is a closure, so just have the closure close over the right variables
<noraj>
I'm not sure to understand, because Timer(3) { command } will repeat the command every 3 sec because of default shots to Float::INFINITY that I want to change to 1, to only execute it 1 time after 3 seconds
<noraj>
Thanks that was exacltly that what I didn't understand
<noraj>
I want to do something like that to allow the user to answer only during 3 first seconds after he receive the question https://ghostbin.com/paste/gk7ka
<noraj>
I can't put on :private inside a on :private, but if I put two on :private at the same level I can't keep the context: user that previously contacted the bot, time of contact, answer because question/answer are random, etc...
noraj has quit [Remote host closed the connection]
mpapis has quit [Quit: Connection closed for inactivity]
Azure has joined #cinch
Azure|dc has quit [Ping timeout: 248 seconds]
rikai has quit [Quit: No Ping reply in 180 seconds.]
rikai has joined #cinch
<leftylink>
noraj: so it becomes clear that the `on :private, /^rep (.*)!/` would have to go on the same level as the other one. So now in the handler for `/^cmd!/` you will need to store in some variable to remember that that user has a question pending. the handler for `rep` has to check that variable to see whether that user has a question pending
<leftylink>
the timer can clear the variable to show that the user ran out of time.
<noraj>
leftylink
<noraj>
leftylink : ok; I'll try that but will ↨`rep`be able to see a variable that is in scope of `cmd`? I'll need a golbal variable so?
<leftylink>
noraj: right. a local variable in a block is local to that block only. it is true that a global would work. I will also say that in my code I used an instance variable since I use plugins. Sorry, I do not know whether instance vars work in `on :private`
<noraj>
Can u show me your code? May be it is better for me to use instance