dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.3.1 | You're being logged at https://irclog.whitequark.org/cinch/
Azure has quit [Quit: Oops.]
kith has quit [*.net *.split]
FiXato has quit [*.net *.split]
FiXato has joined #cinch
FiXato is now known as Guest2934
Azure has joined #cinch
kith has joined #cinch
mpapis has joined #cinch
Azure has quit [Read error: Connection reset by peer]
Azure has joined #cinch
vdl has quit [*.net *.split]
Gizmokid2005 has quit [*.net *.split]
dominikh has quit [*.net *.split]
Gizmokid2010 has joined #cinch
vdl has joined #cinch
dominikh has joined #cinch
dominikh has quit [Changing host]
dominikh has joined #cinch
Gizmokid2010 is now known as Gizmokid2005
noraj has joined #cinch
<noraj> Hello guys
<noraj> I'm coding a IRC bot with cinch
<noraj> and I want to use some timers for user response
<noraj> example: I send a question to a user and I want to let him only 2 seconds to answer after that I will display it it's refused
<noraj> how can I do that?
<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]
noraj has joined #cinch
<noraj> So any adia about how to do https://ghostbin.com/paste/gk7ka ?
kith has quit [Quit: kith]
Azure has quit [Ping timeout: 248 seconds]
Azure|dc has joined #cinch
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
noraj has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
noraj has joined #cinch
noraj has quit [Remote host closed the connection]
noraj has joined #cinch
<noraj> thx it works well :)
noraj has quit [Remote host closed the connection]