StreamOverlay/general_commands.gd
2026-02-23 18:38:03 -06:00

15 lines
685 B
GDScript

extends Node
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()))
func _handle_test(_from_username: String, info: TwitchCommandInfo, _args: PackedStringArray) -> void:
var msg: TwitchChatMessage = info.original_message
Globals.twitcher.reply_message("Test Command Works!", msg.message_id)