Skip to content

Instantly share code, notes, and snippets.

@m4dfry
Created June 9, 2016 13:17
Show Gist options
  • Save m4dfry/004d83db35ae3cb844f5a3995e8b68cc to your computer and use it in GitHub Desktop.
Save m4dfry/004d83db35ae3cb844f5a3995e8b68cc to your computer and use it in GitHub Desktop.
# encoding: utf-8
require 'cinch'
require 'dotenv'
Dotenv.load
CHANNEL = ENV['CHANNEL']
CHANNEL_PSW = ENV['CHANNEL_PSW']
CHANNEL_AND_PSW = "#{CHANNEL} #{CHANNEL_PSW}"
NETWORK = ENV['NETWORK']
NETWORK_PORT = ENV['NETWORK_PORT']
bot = Cinch::Bot.new do
configure do |c|
c.server = NETWORK
c.channels = [CHANNEL_AND_PSW]
c.port = NETWORK_PORT
c.ssl.use = true
c.nick = "RASP_" << DateTime.now.strftime('%y%m%d_%H%M')
end
on :message, "tempRASP" do |m|
TEMP = %x(~/test_temp_perf/temp.bin)
TEMP.sub! "\n","°C"
m.reply "hi bro! I'm cooking at #{TEMP}"
end
end
bot.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment