Giter Club home page Giter Club logo

Comments (4)

xiliangliang avatar xiliangliang commented on July 21, 2024 1

That's right, thank you for your reply

from jxinsta.

ErrorxCode avatar ErrorxCode commented on July 21, 2024

Currently, there is no direct method for starting a conversation however, here is a workaround

Thread thread = new Thread(jxinsta) // pass the JxInsta reference after login, make sure the login type is MOBILE_AUTHENTICATION
thread.pk = 823652.... // The pk of the use you want to send the message
thread.sendMessage("hi",false);

This will create a new thread with that user. But keep in mind, if the recipient is using the newest Instagram client then you might get error on sending 2nd message. That's because of new Instagram policy that does not allow sending more then one message to a stranger until he/she accepts your DM request.

PS : This code is untested. Please let me know it if does or does not work

from jxinsta.

xiliangliang avatar xiliangliang commented on July 21, 2024

Thank you for your reply. I tested according to your method, but there were some errors. Below is my test code and specific errors

JxInsta insta = new JxInsta("samuel.crawford6440870","zayxkdpc6", JxInsta.LoginType.APP_AUTHENTICATION); Thread thread = new Thread(insta); thread.pk=451573056; thread.sendMessage("hi",false);

Exception in thread "main" java.lang.NullPointerException: Cannot read the array length because "this.messages" is null at com.errorxcode.jxinsta.endpoints.direct.Thread.sendMessage(Thread.java:81) at com.fc.test.main(test.java:19)

Looking forward to your reply

from jxinsta.

ErrorxCode avatar ErrorxCode commented on July 21, 2024

after this line,

thread.pk=451573056;

add this,

thread.messages = new Message[0];

from jxinsta.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.