Comments (4)
That's right, thank you for your reply
from jxinsta.
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.
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.
after this line,
thread.pk=451573056;
add this,
thread.messages = new Message[0];
from jxinsta.
Related Issues (10)
- Upload video/reels HOT 1
- I checked your code and found that the login api did not encrypt the password, but I found that the ins login password of the current webpage was encrypted HOT 1
- Library not on jitpack HOT 3
- Handle is missing error when posting picture. HOT 3
- Please make it work with Java8 HOT 1
- error: cannot access PublicAPIs HOT 7
- Acces token HOT 1
- how to create a group HOT 1
- PublicAPIs.getPosts got an Rate limited error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jxinsta.