Deep Bot - Twitch Streamer Assistant

Deep Bot => Help/Support => Topic started by: xmystico on April 11, 2015, 03:22:12 AM

Title: API Issue
Post 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

Title: Re: API Issue
Post by: TheNumbLock on April 11, 2015, 03:25:28 AM
You are using this right? https://github.com/DeepBot-API/client-websocket

You setup your API secret?
Title: Re: API Issue
Post by: xmystico on April 11, 2015, 03:26:16 AM
I'm using the method - ive checked the ports open via netstat - im using the api key - however nothing seems to work
Title: Re: API Issue
Post by: xmystico on April 11, 2015, 08:58:48 PM
My current connection node code
Code: [Select]
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');
});



Title: Re: API Issue
Post by: TheNumbLock on April 12, 2015, 01:06:39 AM
Where it says {APIKEY} I am assuming you put your API key there.
Title: Re: API Issue
Post by: xmystico on April 12, 2015, 01:11:38 AM
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
Title: Re: API Issue
Post by: ExpertsOnline on April 23, 2015, 12:22:35 AM
I have not used the net module before - just wrote this test script and it worked with websockets....so perhaps try this?

Code: [Select]
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);
});