alaingilbert / Turntable-API

Allows you to create bots for turntable.fm
http://alaingilbert.github.com/Turntable-API/
MIT License
318 stars 97 forks source link

Chat-Log #194

Closed ghost closed 11 years ago

ghost commented 11 years ago

I want to make my bot keep a log of the chat that goes on in the chat section of the turntable.fm room. Can you guys give me tips and examples on how to code this feature.

Thanks, Turrntablelover

sharedferret commented 11 years ago

You'd add it to your event handler for the bot.on('speak') event. It's up to you on how you want to store it - the simplest way is to simply log it (eg console.log(data.userid + ': ' + data.text);). Sparkle's code is an example of how to store it in a MySQL db - https://github.com/sharedferret/Sparkle-Turntable-Bot/blob/master/events.js#L226

ghost commented 11 years ago

ok, thanks for the help.