From 281e3eb8d79205b39b6cd8c6697c020587f5391f Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Tue, 13 Sep 2022 18:50:06 -0700 Subject: crystal/eventsub.cr: fix mistaken json coercion --- crystal/eventsub.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crystal') diff --git a/crystal/eventsub.cr b/crystal/eventsub.cr index 1dc8e29..48b3762 100644 --- a/crystal/eventsub.cr +++ b/crystal/eventsub.cr @@ -83,9 +83,9 @@ File.open("/tmp/eventsub.#{Process.pid}.txt", "w", 0o644 ) do |file| sub_sender = ( json["event"]["user_login"]?.as_s? || "anonymous" ) sub_recver = ( json["event"]["broadcaster_user_login"]?.as_s? || sub_sender ) sub_plan = ( json["event"]["tier"]?.as_s? || "unknown" ) - sub_total = ( json["event"]["total"]?.as_s? || "0" ) + sub_total = ( json["event"]["total"]?.as_i? || 0 ) sub_cumulative = ( json["event"]["cumulative_total"]?.as_i? || 0 ) - effectsmsg( "overlay gltext 10 " + sub_sender + " donated " + sub_total + " subs!" ) + effectsmsg( "overlay gltext 10 #{sub_sender} donated #{sub_total} subs!" ) ircmsg( settings["channel"], "#{sub_sender} has gifted #{sub_total} tier #{sub_plan} subscription for a total of #{sub_cumulative}" ) when "channel.subscription.message" sub_sender = ( json["event"]["user_login"]?.as_s? || "anonymous" ) -- cgit v1.2.3