2024-01-26 11:26:22 +01:00
|
|
|
# (c) 2023-present Eroax
|
|
|
|
# (c) 2023-present Yagich
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
extends DeckNode
|
|
|
|
|
|
|
|
|
|
|
|
func _init():
|
|
|
|
name = "Twitch Remove EventSub Subscription"
|
|
|
|
node_type = name.to_snake_case()
|
2024-02-11 20:08:11 +01:00
|
|
|
description = "Removes an EventSub Subscription by it's type."
|
2024-02-26 12:36:19 +01:00
|
|
|
appears_in_search = false
|
|
|
|
|
2024-01-26 11:26:22 +01:00
|
|
|
props_to_serialize = []
|
|
|
|
|
2024-02-26 12:36:19 +01:00
|
|
|
add_input_port(
|
|
|
|
DeckType.Types.STRING,
|
|
|
|
"Subscription Type",
|
|
|
|
"field"
|
|
|
|
)
|
|
|
|
|
|
|
|
add_input_port(
|
|
|
|
DeckType.Types.ANY,
|
|
|
|
"Remove Subscription",
|
|
|
|
"button"
|
|
|
|
)
|
|
|
|
|
2024-01-26 11:26:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-26 12:36:19 +01:00
|
|
|
func _receive(to_input_port, data: Variant):
|
2024-01-26 11:26:22 +01:00
|
|
|
|
2024-02-26 12:36:19 +01:00
|
|
|
var sub_type
|
|
|
|
if to_input_port == 0:
|
2024-01-26 11:26:22 +01:00
|
|
|
|
2024-02-26 12:36:19 +01:00
|
|
|
sub_type = str(data)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
sub_type = await resolve_input_port_value_async(0)
|
2024-01-26 11:26:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
Connections.twitch.remove_eventsub_subscription_type(sub_type).response_completed.connect(eventsub_response_received)
|
|
|
|
|
|
|
|
|
2024-02-21 07:34:17 +01:00
|
|
|
func eventsub_response_received(_info):
|
2024-01-26 11:26:22 +01:00
|
|
|
|
|
|
|
pass # TODO: Add Error Handling Later
|
|
|
|
|