Instagram-private-api: Send a direct message

Created on 12 Jun 2019  路  6Comments  路  Source: dilame/instagram-private-api

I'm trying in any possible way to send a direct message to an user, but I can't find a way. Please can you help me?

Most helpful comment

Assuming you're logged in:

const userId = await ig.user.getIdByUsername('username');
const thread = ig.entity.directThread([userId.toString()]);
await thread.broadcastText('Message from node');

All 6 comments

I found a way to response to an instanciated chat, but I can't init a new chat. Any advise?

Assuming you're logged in:

const userId = await ig.user.getIdByUsername('username');
const thread = ig.entity.directThread([userId.toString()]);
await thread.broadcastText('Message from node');

Yes it's work. I forgot to write a response. Thank you.

I want create a chatbot for direct Instagram. I need to listen the chat from keep the conversation. This is possible? How?

Hello @trandreluis, you need to use the instagram_mqtt library by Nerixyz.
If you need help I'm available on Discord! Androz#2091

Thanks, man! I will analyze and test!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LouenLeoncoeur picture LouenLeoncoeur  路  12Comments

DenisKrsk picture DenisKrsk  路  33Comments

nikitaulshin picture nikitaulshin  路  17Comments

zalkanorr picture zalkanorr  路  12Comments

delmotte picture delmotte  路  61Comments