summaryrefslogtreecommitdiff
path: root/crystal
diff options
context:
space:
mode:
Diffstat (limited to 'crystal')
-rw-r--r--crystal/irc.cr9
1 files changed, 7 insertions, 2 deletions
diff --git a/crystal/irc.cr b/crystal/irc.cr
index 391f2c8..5d2283c 100644
--- a/crystal/irc.cr
+++ b/crystal/irc.cr
@@ -142,7 +142,7 @@ end
lastvoice = Array(String).new
-# OBS
+# obs-websocket
spawn do
loop do
begin
@@ -179,6 +179,8 @@ spawn do
obsipc.send( request.to_json )
when "SourceFilterVisibilityChanged"
ircipc.send( { "##{settings["channel"]}", "| obs: source #{json["sourceName"]} filter #{json["filterName"]} visibility is now #{json["filterEnabled"]}" } )
+ when "SceneItemVisibilityChanged"
+ ircipc.send( { "##{settings["channel"]}", "| obs: source #{json["item-name"]} visibility is now #{json["item-visible"].as_bool}" } )
end
print( "RECEIVED: ")
print( json.to_pretty_json )
@@ -204,12 +206,15 @@ spawn do
end
end
obs_pubsub.run
+ rescue ex : IO::Error
+ pp ex
+ ircipc.send( { "#" + settings["channel"], "obs.cr:obs: " + ex.to_s.gsub(/\r|\n/, ' ') + ": Maybe try again in 10 seconds?" } )
rescue ex : Socket::ConnectError
# these are a bit noisy
pp ex
obs_pubsub && obs_pubsub.close
rescue ex
- ircmsg( settings["home"], settings["channel"], "irc.cr: " + ex.to_s.gsub(/\r|\n/, ' ') )
+ ircmsg( settings["home"], settings["channel"], "irc.cr:obs: " + ex.to_s.gsub(/\r|\n/, ' ') )
puts ex
obs_pubsub && obs_pubsub.close
end