lyntr
v1.1.2
Published
Lyntr.js is a Javascript package that provides bindings to the Lyntr user API.
Downloads
53
Readme
💻 About
lyntr.js
is a simple and lightweight JavaScript library that utilizes the Lyntr API to interact with the Lyntr platform.
🚀 Installation
$ npm install lyntr
$ yarn add lyntr
$ pnpm add lyntr
📚 Usage
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 Instance
const base = 'https://lyntr.com/'
// The Lyntr bot instance, with the cookie provided as authentication
const bot = new Lyntr({
cookie,
base
});
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
}); // }
})();
✍ Contributing
Contributions are always welcome! Please fork the repository and create a pull request with your changes.