dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.0.11
ColdBlooder has joined #cinch
<ColdBlooder>
Hi. Anyone here?
<dominikh>
Yes
<ColdBlooder>
I got a little issue. After god decided to punish me and killed my PC + my backup in one go... I gotta redo my bot >-(
<ColdBlooder>
So i basically got twitter to work... I can fetch the new tweets popping up in a timeline... With one tiny issue... I can't, for the love of god, get my bot to put thr tweet into the chat.
<ColdBlooder>
Oh so the listen_to line and the def line connect the class to the bot?
<dominikh>
it's a method that gets called by the bot's event dispatcher, so yes, in a way
<dominikh>
more importantly it's an instance method, and plugin instances have a reference to the bot
<ColdBlooder>
Okay. Thatwas my missing piece of the puzzle.
<ColdBlooder>
Still not working
<dominikh>
you'll need to give me more than "not working"
<ColdBlooder>
But it outputs the tweet now twice in the terminal
<ColdBlooder>
Looks like its still not connecting to the bot
<dominikh>
a) it says "outpout" in your send line, which is a typo b) it should very clearly raise an exception because of that c) thus it should be written very clearly in your terminal
<ColdBlooder>
renamed output to thistweet nd now it works. THANKS!
<ColdBlooder>
Well sry to ask again... Wanted to sleep before taking care of this but its bugging me too much. I get the tweets to appear in the chat now but they always appear twice.
<ColdBlooder>
This code results in nothing happening. If i post the code for closing on discopnnection after the Channel.send command i get double posts
jmaister has joined #cinch
<jmaister>
hi
<ColdBlooder>
hi
<ayonix>
that looks very strange
<jmaister>
what's the best way to add configuration to plugins?
<jmaister>
like API keys
<ColdBlooder>
Dont mind the code for showing the thread count. I just added that to check of 1 or 2 weree running
<ayonix>
you used listen_to :disconnection IN the on_connect method?
<ColdBlooder>
Dosent it need to be in the thread to work?
<ayonix>
no
<ColdBlooder>
Huh? My Qbasic / Visual Basic 6 mind is blown
<ayonix>
so it might be on_connect gets called twice without a disconnect in between, so two threads get started and the reference to one of them will be overridden
<ayonix>
you could try the initialize version if you don't mind missed tweets
<ColdBlooder>
So i can't cancel the obsolete thread?
<ayonix>
you could also check if the thread is existing and running so you don't create a second one
<ColdBlooder>
Would be better. Missed tweets is not an option
<ayonix>
well, that won't help with that I'm afraid
<ayonix>
best is to find out why two threads are getting created
<ayonix>
like debug when a thread is created and debug when a thread gets killed
<ColdBlooder>
But thats happening. IF i completely disable the "listen_to" and "on connect" lines i can output the tweets vis "puts" command just fine. So theres a thread already active before the bot even connects
rikai has quit [Ping timeout: 264 seconds]
<ayonix>
okay
xeviox|afk is now known as xeviox
<ColdBlooder>
I FIXED IT!!! Yes!! finally!!!
<Netfeed>
yay?
<Netfeed>
what was the problem?
<ColdBlooder>
I just used the :connect method inside the bot "on :connect" and create tge thread in there.
<ColdBlooder>
End result: 1 thread and no double posts
txdv has quit [Ping timeout: 272 seconds]
<ayonix>
where's the difference to my proposed solution?
kith has quit [Ping timeout: 252 seconds]
txdv has joined #cinch
<ColdBlooder>
Im creating the thread without a class.