Deep Bot - Twitch Streamer Assistant
Deep Bot => Help/Support => Topic started by: xmystico on April 11, 2015, 03:22:12 AM
-
Hi there,
I'm trying to develop using the deepbot websocket connection,
i've tried numerous ways, however despite sending the registration request to the websocket server, i cant get a reply back
-
You are using this right? https://github.com/DeepBot-API/client-websocket
You setup your API secret?
-
I'm using the method - ive checked the ports open via netstat - im using the api key - however nothing seems to work
-
My current connection node code
var net = require('net');
var client = new net.Socket();
client.connect(3337, '127.0.0.1', function() {
console.log('Connected to server..');
client.write('api|register|{APIKEY}');
});
client.on('data', function(data) {
console.log('Received: ' + data);
client.destroy();
});
client.on('close', function() {
console.log('Connection closed');
});
-
Where it says {APIKEY} I am assuming you put your API key there.
-
Yeah i added my API key there,
i've also tried with several different packages, combinations of with/without {}
it connects - i send the registration request, server doesn't reply
Deepbot is running in admin mode
I've changed the api key several times - restarted bot / system - everything i can think of
-
I have not used the net module before - just wrote this test script and it worked with websockets....so perhaps try this?
var WebSocket = require('ws');
var ws = new WebSocket('ws://localhost:3337/');
ws.on('open', function() {
console.log('sending API registration');
ws.send('api|register|EE3A7DJQOMKJFBBHGPdZafNWKbTIHBBadQECT');
});
ws.on('close', function close() {
console.log('disconnected');
});
ws.on('message', function(message) {
console.log('Received: ' + message);
});