busybox11 / insta.js

💬 Object-oriented library for sending and receiving messages via Instagram

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

💬 Object-oriented library for sending and receiving messages via Instagram! Based on instagram-private-api and made for the PronoteBot project.

Example

Here is a simple chatbot made with the library:

const Insta = require('@androz2091/insta.js');

const client = new Insta.Client();

client.on('connected', () => {
    console.log(`Logged in as ${client.user.username}`);
});

client.on('messageCreate', (message) => {
    if (message.authorID === client.user.id) return

    message.markSeen();

    if (message.content === '!ping') {
        message.chat.send('!pong');
    }
});

client.on('messageDelete', (cachedMessage) => {
    if (!cachedMessage) return;
    console.log(`@${cachedMessage.author.username} has just deleted their message: ${cachedMessage.content}`);
});

// follow back everyone
client.on('newFollower', (user) => {
    user.follow();
});

client.on('followRequest', (user) => {
    user.approveFollow();
});

client.on('pendingRequest', (chat) => {
    chat.approve();
});

client.login('username', 'password');

Links

Credits

🧡 Big thanks to Nerixyz and dilame for their libraries.

About

💬 Object-oriented library for sending and receiving messages via Instagram


Languages

Language:JavaScript 100.0%