#Xat API
So I decided to create something like a "module" for NODEJS where it has some functions that you can use. If the document isn't enough for you, feel free to open an issue and i'll explain you more about.
More functions will come later! If you have any ideas of functions related to Xat, feel free to tell me them.
Here are the available functions from this "module" :
- Get a Xat Regname via ID
- Get a Xat ID via Regname
- Get a chat informations
- Get new power informations
- Get chat connection informations (for bots or more)
- Get new user informations (userid, k1, k2 from auser3.php)
If for example, you want to use the function "getID", your code should look like that:
var xat = require('xatapi');
xat.getID('xSlOom', (err, res) => {
if (err !== null) {
console.log("error! : " + err);
} else {
console.log(res);
}
});
If you want to see if it works, just run the cmd :
node YourFileName.js
The output of this example must be "10000070".
Well, on my previous comment, i'm using the object "xat", which is the object to call each functions from xatlib. You just have to call again "xat" + the function name. ``` Example : xat.FunctionName(your arg, (err, res) => { // show the response from the function }); ``` If 'err' (variable for error) is null, it will show a result (res), otherwise it's an error. "The module doesn't work." - Follow and example an try again. (Module has been tested several times and it works.)Otherwise, open a new issue.
You are now able to use it according to some feedbacks, it should working fine.
Last update: 02/20/2017