Comments (38)
https://github.com/huttarichard/instagram-private-api/blob/master/client/v1/thread.js#L232
Client.V1.Thread.configureText(session, userId, "text you would love to send").then((t) => console.log(t))
from instagram-private-api.
sorry did not read title
from instagram-private-api.
Client.Feed.Inbox
how to work with feeds checkout readme...
this will provide you list of threads, every thread has .configureText
or . configureMediaShare
hastag etc ... for more checkout source
from instagram-private-api.
Thanks! Do you mind if I keep this issue open, just in case I have any other problems to do with this?
from instagram-private-api.
sure
from instagram-private-api.
How far off am I? I have currently got the following code:
`
var feed = new Client.Feed.Inbox(session);
Promise.map(_.range(0, 20), function() {
return feed.get();
})
.then(function(results) {
// result should be Media[][]
var media = _.flatten(results);
var urls = _.map(media, function(medium) {
return _.last(medium.configureText)
});
console.log(urls);
})`
However it justs returns an array of undefined
from instagram-private-api.
I realise all that will do is list the DMs I am still can't work out how to send one (to an existing group)
from instagram-private-api.
do you have an valid session?
from instagram-private-api.
var feed = new Client.Feed.Inbox(session, 100);
feed.all().then(function(threads) {
if (threads.length > 0)
throw new Error("..... no messeges in inbox ....")
return threads[0].configureText("text to someone")
})
.then(function(){
console.log("text sended!")
})
from instagram-private-api.
Sorry, I feel kinda stupid for asking all this questions, so thanks again for taking time to help me. From there how do I declare what group im sending it too, is there like group IDs or something
from instagram-private-api.
you need to iterate over inbox, find conversation you want to reply and then you broadcast.
threads
coming from inbox is an array [Thread]
of classes which is holding all info about thread, if you are looking for group conversation, you can inspect thread.params.title
or what ever is in thread.params
(you will find title
property and others). Once you get right thread you can just use thread.broadcast<Text, Hashtag, Profile, Medium>
and send what ever you want... Just take a look on source of thread class, it is not that complicated.
from instagram-private-api.
With your example:
Client.Session.create(device, storage, 'user', 'Passoword') .then(function(session) { var feed = new Client.Feed.Inbox(session, 100); feed.all().then(function(threads) { if (threads.length > 0) throw new Error("..... no messeges in inbox ...."); return threads[0].configureText("text to someone"); }) .then(function(){ console.log("text sent!") }); });
It throws the error, ......No messages in inbox......
Even though there is. However if I comment that out, it throws thread[0].configureText is not a function
from instagram-private-api.
Crap I just put the password to tes the account in that, I have edited it now, but I realise the email notifying you about the post will have it in :/
from instagram-private-api.
@wizardsambolton you just got pwned :D
from instagram-private-api.
im going to investigate what is going on hold on
from instagram-private-api.
Thanks!
from instagram-private-api.
@wizardsambolton I actually try this with your account, but got checkpoint since you we are using different ip. However with my account it is working... So, try npm update
library should be at version 0.5.1
, then try different account, must be sure there are some threads conversation in inbox. Also try Thread.approveAll()
.
from instagram-private-api.
Ok will do.
from instagram-private-api.
and if nothing helps try to run git clone on repository ... run npm test
and insert credentials when it ask you..
from instagram-private-api.
Thanks!
from instagram-private-api.
Well it did not work, so I am going to try doing what you said!
from instagram-private-api.
Ok from that I got 1 failed test
from instagram-private-api.
put it here, but I just try it with your account and got all threads, first one s group conversation, of
mar.fmf,sophia_c_sprenkel,loulee.jones,helena_cookies,tbh.lozzer,hopefoxhope, feel free to tell me if I should delete it...
from instagram-private-api.
you are doing something wrong...
from instagram-private-api.
Strange :/ I have no clue what im doing wrong though :/ (Also it would be nice for you to delete it, but not yet, as it may be useful to help xD)
from instagram-private-api.
no I mean, delete the names I mentioned...., your account is safe with me because you are going to change password as soon as you get what you working on ...
from instagram-private-api.
put the failiture you got from tests...
from instagram-private-api.
Yeah, you dont need to delete the names its fine dw.
from instagram-private-api.
Ok will do one sec
from instagram-private-api.
Unhandled rejection AssertionError: expected '340282366841710300949128132075360282508' not to be '340282366841710300949128132075360282508' (false negative fail)
at Assertion.fail (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/should/lib/assertion.js:92:17)
at Assertion.Object.defineProperty.value (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/should/lib/assertion.js:174:17)
at /Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/tests/cases/feeds/inbox.js:73:43
at tryCatcher (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._resolveCallback (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:431:57)
at Promise._settlePromiseFromHandler (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:522:17)
at Promise._settlePromise (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._settlePromise (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:580:21)
at Promise._settlePromise0 (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._settlePromise (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:580:21)
at Promise._settlePromise0 (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._settlePromise (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:580:21)
at Promise._settlePromise0 (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._settlePromise (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:580:21)
at Promise._settlePromise0 (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._resolveCallback (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:431:57)
at Promise._settlePromiseFromHandler (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:522:17)
at Promise._settlePromise (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._resolveCallback (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:431:57)
at Promise._settlePromiseFromHandler (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:522:17)
at Promise._settlePromise (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:636:18)
at Promise._resolveCallback (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:431:57)
at Promise._settlePromiseFromHandler (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:522:17)
at Promise._settlePromise (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:691:18)
at Promise._fulfill (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:636:18)
at PromiseArray._resolve (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise_array.js:125:19)
at PromiseArray._promiseFulfilled (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise_array.js:143:14)
at Promise._settlePromise (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:572:26)
at Promise._settlePromise0 (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/async.js:138:16)
at Async._drainQueues (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/async.js:148:10)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/sambolton/Documents/Github1/InstagramPCDM/test/instagram-private-api/node_modules/bluebird/js/release/async.js:17:14)
at processImmediate [as _immediateCallback] (timers.js:383:17)
1) should not be problem to get threads
from instagram-private-api.
Ok test is failing because you have only 4 conversations in inbox... which leads to failiture ... should be repaired, but it is not an bug in library...
from instagram-private-api.
run suite again but put console.log in it, you will find what is going on, how to respond to thread...
from instagram-private-api.
Sory feel like im being stupid, but put console.log where?
from instagram-private-api.
from instagram-private-api.
tests directory, there is describe block with Inbox class
specs so start over there...
from instagram-private-api.
I am so sorry to keep bothering you :/ however I added cnsole.log to the top of the describe block, however when I ran it I got tons of errors, so I removed it, and ran it again, and I am still getting the errors
from instagram-private-api.
I know that starting with programming can be hard, but if you do it by yourself, it is much easier then. Learn, inspect try more, this library is great source of learning. Good luck.
from instagram-private-api.
and google a lot man, for example you can start with promises and then continue to mocha
from instagram-private-api.
Related Issues (20)
- using existing token HOT 2
- 400 Bad Request; You'll need to update Instagram to the latest version before you can use the app. HOT 10
- How to develop your own color picker tool
- Post shared on Story issue
- Unexpected `VideoSourceDurationCheckException` Error when uploading short video HOT 4
- Can i send message to broadcast channel ?
- Account got deleted after using this repo HOT 2
- HELP "400 Bad Request; challenge_required" Can you support the solution? HOT 3
- local response vs staging response
- signup with phone number
- .
- HELP ! How can I get more than 21 user tags medias?
- API Endpoint not found HOT 3
- IgUserIdNotFoundError: Could not extract userid (pk)
- How to properly get Reel (Clip) from the given URL and download reel? HOT 2
- Creating a session logs out others
- "We've detected automated behavior on your account" scary warning HOT 1
- baseUrl configuration
- The class DiscoverFeedResponseUser is not reflecting the object that is received
- About this Account
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 instagram-private-api.