Ajout de l'intégration twitch
This commit is contained in:
24
common/twitch_connection/twitch_connection.gd
Normal file
24
common/twitch_connection/twitch_connection.gd
Normal file
@@ -0,0 +1,24 @@
|
||||
extends Node
|
||||
|
||||
signal pseudo_gathered_updated(pseudos)
|
||||
|
||||
var pseudo_gathered : Array[String] = []
|
||||
|
||||
func _ready():
|
||||
VerySimpleTwitch.chat_message_received.connect(_on_message_received)
|
||||
GameInfo.settings_data.twitch_changed.connect(connect_to_twitch)
|
||||
|
||||
func connect_to_twitch(settings : SettingsData):
|
||||
pseudo_gathered = []
|
||||
pseudo_gathered_updated.emit(pseudo_gathered)
|
||||
VerySimpleTwitch.end_chat_client()
|
||||
if settings.activate_twitch_integration:
|
||||
connect_to_twitch_account(settings.twitch_channel)
|
||||
|
||||
func connect_to_twitch_account(channel_name: String):
|
||||
VerySimpleTwitch.login_chat_anon(channel_name)
|
||||
|
||||
func _on_message_received(chatter: VSTChatter):
|
||||
if not chatter.login in pseudo_gathered:
|
||||
pseudo_gathered.append(chatter.login)
|
||||
pseudo_gathered_updated.emit(pseudo_gathered)
|
||||
1
common/twitch_connection/twitch_connection.gd.uid
Normal file
1
common/twitch_connection/twitch_connection.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://fm17qbe4kqqo
|
||||
Reference in New Issue
Block a user