1.0.2 • Published 8 years ago
phantombot-node-connector v1.0.2
Node Phantombot Connector
This is a NodeJS Connector for Phantombot, made to immitate (mostly) their own PHP Connector.
Installation
###Prerequisites:###
- Node.js ###Required Information:###
- Bot Address: The IP address of your bot, if you've installed PhantomBot locally this will be localhost.
- Bot Name: The Twitch username of the account your bot is using.
- Bot Oauth Token: This will be in a file called botlogin.txt, within the root of the folder you installed PhantomBot in.
###Installation:###
npm install phantombot-node-connector
###Usage:###
#Adding the Connector
var phantombot = require('phantombot-node-connector');
#Setting Options
phantombot.options = {
'host': 'localhost', // Server where bot is hosted
'port': 25000 // Port where bot is hosted
'oauth': 'oauth' // The oauth code excluding the "oauth:" bit.
}
#Get from inistore
phantombot.getTable('points', function(data) { // Replace points with the file you need
console.log(data);
});
#Get from Logs
phantombot.getLogFile('chat/date.txt', function(data) {
console.log(data);
});
#Get from Addons
phantombot.getAddonFile('followHandler/latestFollower.txt', function(data) {
console.log(data);
});
#Get from Web Folder
phantombot.getWebFile('style.css', function(data) {
console.log(data);
});
Return Data
Inistore request
[{variable: val, value: val2}]
Normal request
[{line: val}]