mifi / instauto

Instagram bot / automation library written in Javascript for Node.js
808 stars 145 forks source link

Introduce filter for username #81

Closed matteocrippa closed 2 years ago

matteocrippa commented 2 years ago

Hey @mifi first of all very good job for your bot! I was playing with that and I see there was room for an extra feature, basically a filter that checks if the username of the user contains a partial from an array of strings.

As you can imagine is just enough to set

followUserWithUsernameMatching: ['nice', 'car']

And in this way the script will skip all the user that does not contains in the username the keyword nice or car.

mifi commented 2 years ago

Hi! Thanks for this. I agree it's a nice feature. However could it become even nicer 💯 if it allows providing a function instead? then the developer can do whatever they want with the users. E.g.:

shouldFollowUser: (username) => someCustomLogic(username),

and which would of course default to () => true

Luen commented 2 years ago

@mifi This should be closed now that #99 has been implemented.