miggor-StreamGraph/classes/deck/nodes/twitch_chat_received.gd

29 lines
644 B
GDScript3
Raw Normal View History

extends DeckNode
func _init():
name = "Twitch Chat Received"
node_type = "twitch_chat_received"
description = "Receives Twitch Chat Events from a Twitch Connection"
category = "twitch"
add_output_port(DeckType.Types.STRING, "Username")
add_output_port(DeckType.Types.STRING, "Message")
add_output_port(DeckType.Types.STRING, "Channel")
add_output_port(DeckType.Types.DICTIONARY, "Tags")
func _event_received(event_name : StringName, event_data : Dictionary = {}):
if event_name != &"twitch_chat":
return
send(0, event_data.username)
send(1, event_data.message)
send(2, event_data.channel)
send(3, event_data)