Skip to content

Instantly share code, notes, and snippets.

@ecylmz
Created February 17, 2016 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ecylmz/4b037da377326d6725dc to your computer and use it in GitHub Desktop.
Save ecylmz/4b037da377326d6725dc to your computer and use it in GitHub Desktop.
require 'zircon'
require 'colorize'
client = Zircon.new(
server: 'irc.twitch.tv',
port: '6667',
channel: '#admiralbulldog',
username: 'username',
password: 'oauth:your_token'
)
removed_colors = [:black, :white, :light_black, :light_white]
colors = String.colors - removed_colors
f = File.open('chat.txt', 'w')
client.on_message do |message|
puts ">>> #{message.from}: #{message.body}".colorize(colors.sample)
f.write(message.body.to_s + "\n")
end
client.run!
f.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment