lyntr.js
is a simple and lightweight JavaScript library that utilizes the Lyntr API to interact with the Lyntr platform.
$ npm install lyntr
$ yarn add lyntr
$ pnpm add lyntr
import { Lyntr } from 'lyntr';
// Your Lyntr access token, labled as "_TOKEN__DO_NOT_SHARE" in your browser's cookies
const cookie = 'your_cookie_here';
// The base URL of the Lyntr API
const api = 'https://lyntr.com/api/'
// The Lyntr bot instance, with the cookie provided as authentication
const bot = new Lyntr({
cookie,
api
});
bot.on('error', console.error);
bot.on('ready', () => {
console.log('Bot is ready!');
});
// Invoked in an IIFE since the library is asynchronous
(async () => {
await bot.login();
await bot.me().then((me) => { // {
// "id": "8846746536817664",
// "username": "grng",
console.log(me); // "handle": "gr",
// "created_at": "2024-08-06T21:23:33.269Z",
// "iq": 124
}); // }
})();
Contributions are always welcome! Please fork the repository and create a pull request with your changes.