# Connecting to twitch with godot

**URL:** <https://discuss.dev.twitch.com/t/connecting-to-twitch-with-godot/35479>\
**Category:** Chat and IRC\
**Created:** [December 19, 2021, 7:32pm UTC](https://discuss.dev.twitch.com/t/connecting-to-twitch-with-godot/35479 "2021-12-19T19:32:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirgladshoes](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@sirgladshoes](https://discuss.dev.twitch.com/u/sirgladshoes)\
**Post date:** [December 19, 2021, 7:32pm UTC](https://discuss.dev.twitch.com/t/connecting-to-twitch-with-godot/35479/1 "2021-12-19T19:32:53Z")

</div>

Hi im trying to make a game for twitch chat to play from scratch and I cant seem to get it to connect, please help, heres the code:

extends Node

onready var tcpClient = StreamPeerTCP.new()  
onready var has\_connected = false

const CLIENT\_PASS = ‘’  
const CLIENT\_NICK = ‘sirgladshoes’

# Called when the node enters the scene tree for the first time.

func \_ready():  
set\_process(true)  
tcpClient  
\_connect()

func \_process(delta):  
print(tcpClient.get\_available\_bytes())  
if tcpClient.get\_status() == 2 and !has\_connected:  
\_connect\_to\_channel()

func \_connect():  
print(“connecting…”)  
var err = tcpClient.connect\_to\_host(“[irc.chat.twitch.tv](http://irc.chat.twitch.tv)”, 6697)  
print(err)

func \_connect\_to\_channel():  
print(“sending data”)  
has\_connected = true

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [December 19, 2021, 7:33pm UTC](https://discuss.dev.twitch.com/t/connecting-to-twitch-with-godot/35479/2 "2021-12-19T19:33:45Z")

</div>

Duplicate on [What info do I need to send to the twitch api when I establish a connection with godot?](https://discuss.dev.twitch.com/t/what-info-do-i-need-to-send-to-the-twitch-api-when-i-establish-a-connection-with-godot/35478/)

Please do not make duplicate threads for the same problem

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [December 19, 2021, 7:33pm UTC](https://discuss.dev.twitch.com/t/connecting-to-twitch-with-godot/35479/3 "2021-12-19T19:33:49Z")

</div>


