summaryrefslogtreecommitdiff
path: root/crystal
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk+git@omgwallhack.org>2022-09-13 18:50:06 -0700
committerJoe Rayhawk <jrayhawk+git@omgwallhack.org>2022-09-13 18:50:06 -0700
commit281e3eb8d79205b39b6cd8c6697c020587f5391f (patch)
tree9b2007460c8645374cf769eeff8c8d312284e660 /crystal
parentd5020890fd7cfe55307b94c04f59d0c396f32677 (diff)
downloadtwitchtools-281e3eb8d79205b39b6cd8c6697c020587f5391f.tar.gz
twitchtools-281e3eb8d79205b39b6cd8c6697c020587f5391f.zip
crystal/eventsub.cr: fix mistaken json coercion
Diffstat (limited to 'crystal')
-rw-r--r--crystal/eventsub.cr4
1 files changed, 2 insertions, 2 deletions
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" )