tyrope / lionroarbot

A Sopel bot designed for moderating Twitch.TV channels.
http://twitch.tv/lionroarbot
Other
2 stars 0 forks source link

Timers throwing error when attempting to fire #2

Closed belthesar closed 9 years ago

belthesar commented 9 years ago

I'm getting:

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/willie/bot.py", line 212, in _call func(self.bot) File "/home/twitchbots/.willie/modules-thirdparty/lionroarbot/LRB-Timer.py", line 74, in timed_message msg = ret.fetchone()[0] TypeError: 'NoneType' object has no attribute '__getitem__''

when a timer attempts to fire. I'm guessing this has to do with database handle changes with the new updates, but I'm not hip enough to using databases with Willie to debug this well enough. I've tried to make changes to fix this to no avail.

BTW, not the best place for this obviously, but thanks for your work on this. I'm intending to sub a pull request with a slight rewrite to addcom to make it more clearly emulate Nightbot's syntax.

tyrope commented 9 years ago

Thank you for using LRB! Could you use Willie's .version command to inform me of the version you're using?

belthesar commented 9 years ago

Sorry about the delay on this! I was away on work, and lost sight of this.

Willie 5.2.0 (running on python 2.7.6) http://willie.dftba.net/

Now that I'm looking at this, I'm wondering if I should be running Willie with Python 3 vs. 2.

tyrope commented 9 years ago

Willie 5.2 on Python 2.7.* should work fine, The only thing is that I haven't made the timer module really friendly for people who can't/won't edit the sqlite database outside of chat.

You're probably encountering this error because your timer table is empty. Luckily the structure is pretty simple: id = a 1-index integer counter. The highest ID must match the amount of timers for the cycle to work correctly. message = the message LRB will say. If you want to have a click-to-tweet link, use http://ctt.ec/%s (this is to accommodate people who use more than 1 ctt, which I used to do)

I personally use a little program called "SQLite Database Browser", it's been too long however to link you to it, but perhaps a quick google search might find it.

tyrope commented 9 years ago

Closing due to inactivity... if my answer does not solve the problem, please feel free to reopen and reply.