new InstagramBot(browser, page, authenticatedopt)
Parameters:
Name |
Type |
Attributes |
Default |
Description |
browser |
puppeteer.Browser
|
|
|
|
page |
puppeteer.Page
|
|
|
|
authenticated |
Boolean
|
<optional>
|
false
|
|
Properties:
Name |
Type |
Description |
browser |
puppeteer.Browser
|
|
page |
puppeteer.Page
|
|
queue |
Queue
|
|
authenticated |
Boolean
|
|
username |
String
|
|
cache |
Cache
|
|
- Source:
Methods
(async, static) launch(headlessopt, sessionopt) → {Promise.<InstagramBot>}
Parameters:
Name |
Type |
Attributes |
Default |
Description |
headless |
Boolean
|
<optional>
|
false
|
|
session |
Object
|
<optional>
|
{}
|
|
- Source:
Returns:
-
Type
-
Promise.<InstagramBot>
(async, static) loadSession(filePath) → {Promise.<Object>}
Parameters:
Name |
Type |
Description |
filePath |
String
|
|
- Source:
Returns:
session, which probably stores your credentials
-
Type
-
Promise.<Object>
(async) addObserver(func) → {Promise}
Parameters:
Name |
Type |
Description |
func |
function
|
|
- Source:
Returns:
-
Type
-
Promise
(async) close() → {Promise.<void>}
closes the browser
- Source:
Returns:
-
Type
-
Promise.<void>
Parameters:
Name |
Type |
Description |
postIdentifier |
String
|
Post
|
this can either be the link of a post or an instance of the Post Class |
comment |
String
|
the text you want to comment on the post |
- Source:
Returns:
-
Type
-
Promise.<any>
(async) directMessageUser(userIdentifier, message) → {Promise.<void>}
Parameters:
Name |
Type |
Description |
userIdentifier |
String
|
SearchResult
|
User
|
can either be a username, link, an instance of the User class or a SearchResult which links to a User |
message |
String
|
|
- Source:
Returns:
-
Type
-
Promise.<void>
(async) follow(identifier) → {Promise.<any>}
Parameters:
Name |
Type |
Description |
identifier |
String
|
User
|
SearchResult
|
can either be a username, link, an instance of the User class or a SearchResult which links to a User |
- Source:
Returns:
-
Type
-
Promise.<any>
(async) getChannelMessages(page, userIdentifier) → {Promise.<Array.<DirectMessage>>}
Parameters:
Name |
Type |
Description |
page |
puppeteer.Page
|
|
userIdentifier |
User
|
SearchResult
|
String
|
can either be a username, link, an instance of the User class or a SearchResult which links to a User |
- Source:
Returns:
-
Type
-
Promise.<Array.<DirectMessage>>
(async) getCookies() → {Promise.<Object>}
- Source:
Returns:
-
Type
-
Promise.<Object>
(async) getFollower(identifier, minLengthopt) → {Promise.<Array.<User>>}
Parameters:
Name |
Type |
Attributes |
Default |
Description |
identifier |
String
|
User
|
SearchResult
|
|
|
can either be a username, link, an instance of the User class or a SearchResult which links to a User |
minLength |
Number
|
<optional>
|
50
|
|
- Source:
Returns:
-
Type
-
Promise.<Array.<User>>
(async) getFollowing(identifier, minLengthopt) → {Promise.<Array.<User>>}
Parameters:
Name |
Type |
Attributes |
Default |
Description |
identifier |
String
|
User
|
SearchResult
|
|
|
can either be a username, link, an instance of the User class or a SearchResult which links to a User |
minLength |
Number
|
<optional>
|
50
|
|
- Source:
Returns:
-
Type
-
Promise.<Array.<User>>
Parameters:
Name |
Type |
Attributes |
Default |
Description |
postIdentifier |
String
|
Post
|
|
|
can either be the link to a post or an instance of the Post class |
minComments |
Number
|
<optional>
|
5
|
|
- Source:
Returns:
-
Type
-
Promise.<Array.<Comment>>
(async) getPostDetails(identifier) → {Promise.<PostDetails>}
Parameters:
Name |
Type |
Description |
identifier |
String
|
Post
|
this can either be the link of a post or an instance of the Post Class |
- Source:
Returns:
-
Type
-
Promise.<PostDetails>
(async) getPosts(identifier, minLengthopt) → {Promise.<Array.<Post>>}
Parameters:
Name |
Type |
Attributes |
Default |
Description |
identifier |
String
|
User
|
SearchResult
|
|
|
can either be a username, link, an instance of the User class or a SearchResult which links to a User |
minLength |
Number
|
<optional>
|
50
|
|
- Source:
Returns:
-
Type
-
Promise.<Array.<Post>>
(async) getSession() → {Promise.<Object>}
- Source:
Returns:
session, which normally stores credentials
-
Type
-
Promise.<Object>
(async) getUserDetails(identifier) → {Promise.<UserDetails>}
Parameters:
Name |
Type |
Description |
identifier |
String
|
User
|
SearchResult
|
can either be a username, link, an instance of the User class or a SearchResult which links to a User |
- Source:
Returns:
-
Type
-
Promise.<UserDetails>
(async) goto(identifier) → {Promise.<any>}
Parameters:
Name |
Type |
Description |
identifier |
String
|
SearchResult
|
User
|
Post
|
can either be a link, username, SearchResult, User or Post |
- Source:
Returns:
-
Type
-
Promise.<any>
(async) isFollowing(userIdentifier) → {Promise.<Boolean>}
Parameters:
Name |
Type |
Description |
userIdentifier |
String
|
User
|
SearchResult
|
can either be a username, link, an instance of the User class or a SearchResult which links to a User |
- Source:
Returns:
whether you are following the specified user or not
-
Type
-
Promise.<Boolean>
(async) likePost(identifier) → {Promise.<any>}
Parameters:
Name |
Type |
Description |
identifier |
String
|
Post
|
this can either be the link of a post or an instance of the Post Class |
- Source:
Returns:
-
Type
-
Promise.<any>
(async) login(username, password) → {Promise.<any>}
Parameters:
Name |
Type |
Description |
username |
String
|
|
password |
String
|
|
- Source:
Returns:
-
Type
-
Promise.<any>
(async) logout() → {Promise.<any>}
- Source:
Returns:
-
Type
-
Promise.<any>
(async) saveSession(filePath) → {Promise}
Parameters:
Name |
Type |
Description |
filePath |
String
|
|
- Source:
Returns:
-
Type
-
Promise
(async) search(searchTerm) → {Promise.<Array.<SearchResult>>}
Parameters:
Name |
Type |
Description |
searchTerm |
String
|
|
- Source:
Returns:
-
Type
-
Promise.<Array.<SearchResult>>
(async) stop() → {Promise.<void>}
stops the bot
- Source:
Returns:
-
Type
-
Promise.<void>
(async) unfollow(identifier) → {Promise.<any>}
Parameters:
Name |
Type |
Description |
identifier |
String
|
User
|
SearchResult
|
can either be a username, link, an instance of the User class or a SearchResult which links to a User |
- Source:
Returns:
-
Type
-
Promise.<any>
(async) unlikePost(identifier) → {Promise.<any>}
Parameters:
Name |
Type |
Description |
identifier |
String
|
Post
|
this can either be the link of a post or an instance of the Post Class |
- Source:
Returns:
-
Type
-
Promise.<any>