Androz2091 / insta.js

💬 Object-oriented library for sending and receiving messages via Instagram
138 stars 42 forks source link

TypeError: this.privateChat.send is not a function #44

Closed mertushka closed 3 years ago

mertushka commented 3 years ago
client.on("newFollower", (client, user) => {
user.send(`test`)
});
Androz2091 commented 3 years ago

Use this instead:

client.on("newFollower", (client, user) => {
    if (!user.privateChat) await user.fetchPrivateChat()
    user.privateChat.sendMessage(`test`)
});