StreamOverlay/ChatAvatars/CatSlimes/chat_avatar_commands.gd
2026-02-23 18:38:03 -06:00

14 lines
553 B
GDScript

extends Node
@export var avatars: Node2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var nodes := get_children()
for node in nodes:
if node is TwitchCommand:
var cmd: TwitchCommand = node
if self.has_method("_handle_%s" % cmd.name.to_camel_case()):
cmd.command_received.connect(Callable(self, "_handle_%s" % cmd.name.to_camel_case()))
if self.has_method("_cooldown_%s" % cmd.name.to_camel_case()):
cmd.command_received.connect(Callable(self, "_cooldown_%s" % cmd.name.to_camel_case()))