added new signal to wait for channel data, required for the example to work as expected
This commit is contained in:
parent
2ff6b2e597
commit
7b42990b39
@ -21,6 +21,8 @@ signal login_attempt(success)
|
||||
signal chat_message(sender_data, message)
|
||||
# User sent a whisper message.
|
||||
signal whisper_message(sender_data, message)
|
||||
# Initial channel data received
|
||||
signal channel_data_received(channel_name)
|
||||
# Unhandled data passed through
|
||||
signal unhandled_message(message, tags)
|
||||
# A command has been called with invalid arg count
|
||||
@ -627,6 +629,7 @@ func handle_message(message : String, tags : Dictionary) -> void:
|
||||
var room = msg[2].right(-1)
|
||||
if (!last_state.has(room)):
|
||||
last_state[room] = tags
|
||||
channel_data_received.emit(room)
|
||||
else:
|
||||
for key in tags:
|
||||
last_state[room][key] = tags[key]
|
||||
|
@ -24,7 +24,8 @@ func _ready() -> void:
|
||||
if (success):
|
||||
request_caps()
|
||||
join_channel(initial_channel)
|
||||
await(connect_to_eventsub())
|
||||
await(channel_data_received)
|
||||
await(connect_to_eventsub()) # Only required if you want to receive EventSub events.
|
||||
# Refer to https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types/ for details on
|
||||
# what events exist, which API versions are available and which conditions are required.
|
||||
# Make sure your token has all required scopes for the event.
|
||||
|
Loading…
x
Reference in New Issue
Block a user