How to send Direct message?
rsa408 opened this issue · 1 comments
rsa408 commented
Hi
I would like to know how is possible to send a Direct Message to a user?
Also is it possible to send Mass Direct Messages?
Thanks
rodriguesabner commented
you can use the .replyDirectMessage
function. And to send in bulk you will have to get all the ids you want to send, make a loop and send them one by one.
e.g:
const welcomeMessage = 'Hello guyssssss';
const pkListUsers = [function to get your contact list];
for (user of pkListUsers) {
await replyDirectMessage(ig, {userId: user.pk}, welcomeMessage);
}