/xatAPI

A xat package with a lof ot functions that you can use on your projects.

Primary LanguageJavaScriptMIT LicenseMIT

#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.

What does it has?

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)

How to use it?

First, you will have to install all needed modules to have it working but before you need to have NodeJS and NPM installed on your computer. ``` npm install ``` After that, you will have to include the module named "xatlib" on the beginning of your file like that: ``` var xat = require('xatapi'); ```

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".

How to use other functions?

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.

Questions

"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.

Credits

  • Xat.com - for their API. (Otherwise, this library wouldn't exist.)
  • Huumanoid - For his help.

Updates:

You are now able to use it according to some feedbacks, it should working fine.

Last update: 02/20/2017