1.1.3 • Published 11 months ago

lyntr.js v1.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

💻 About

lyntr.js is a simple and lightweight JavaScript library that utilizes the Lyntr API to interact with the Lyntr platform.

About

A package for developing bots for lyntr.

🚀 Installation

$ npm install lyntr.js
$ yarn add lyntr.js
$ pnpm add lyntr.js

📚 Usage

import * as lyntrjs from 'lyntr.js';
dotenv.config();

const TOKEN = process.env.TOKEN; // The Lyntr httpOnly cookie named _TOKEN__DO_NOT_SHARE

let Bot = new lyntrjs.Client({
    baseURL: "https://lyntr.jnnj.xyz",
    verbose: 0 // 0 to 5
});

Bot.on('ready', (loggedAt, user) => {
    console.log(`Bot is ready, logged at ${loggedAt}`);
    console.log(`Connected as ${user.username} (${user.handle})`);
});

Bot.on('post', lynt => {

    console.log(`[BOT] new lynt (${lynt.id}): ${lynt.username} (${lynt.handle}): ${lynt.content}`, lynt);
    if(lynt.me) return console.log(`[BOT] Lyn is mine. Returning...`);

    lynt.relynt('Hey someone lynted this')
});


Bot.login(TOKEN);

✍ Contributing

Contributions are always welcome! Please fork the repository and create a pull request with your changes.

Links

1.1.3

11 months ago

1.1.2

11 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.0

11 months ago