💬 Object-oriented library for sending and receiving messages via Instagram! Based on instagram-private-api and made for the PronoteBot project.
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');