Comments (8)
Can you provide some logs and your modification?
And how you're calling this function?
from insta-bot.
ofcourse ... i clone hole repository for contribute , i think this is really great project
in your sample directory sampels/follow/followUserFollowers i just replace the user value with some id like this val user = "my_id"
but i get this
Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at bot.InstagramBot.getUserIdByName(InstagramBot.kt:425) at bot.InstagramBot.convertToUserId(InstagramBot.kt:446) at bot.InstagramBot.getUserFollowers(InstagramBot.kt:556) at bot.InstagramBot.getUserFollowers$default(InstagramBot.kt:551) at bot.InstagramBot.followUserFollowers(InstagramBot.kt:1621) at bot.InstagramBot.followUserFollowers$default(InstagramBot.kt:1619) at samples.follow.FollowUsersFollowersKt$main$1.invokeSuspend(FollowUsersFollowers.kt:22) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56) at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:271) at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:79) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:54) at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:36) at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) at samples.follow.FollowUsersFollowersKt.main(FollowUsersFollowers.kt:10) at samples.follow.FollowUsersFollowersKt.main(FollowUsersFollowers.kt)
from insta-bot.
You need to use your username in that function, not (numeric) user id. Try with username and let me know the result.
from insta-bot.
i just do this , here is my code
`@ExperimentalCoroutinesApi
fun main() = runBlocking {
val username = Credentials.USERNAME
val password = Credentials.PASSWORD
val bot = InstagramBot()
bot.prepare(username)
bot.login(username, password)
val user = "@mohsen_alak"
val howManyFollowersYouWantToFollow = 10
bot.followUserFollowers(user, howManyFollowersYouWantToFollow).collect { println(it) }
}`
note) now the account is disabled
the log is belongs to convertToUserId() function in 439th line of InstagramBot class
from insta-bot.
This was due to bug in case of user is not found on instagram. I've fixed it. Please check now.
from insta-bot.
i still face the same log .
the function value.toLongOrNull()
in convertToUserId throw these .
i put valid and available username , but get the same log end errors.
can u explain why use value.toLongOrNull()
?
i replace that with correct function but still not work!
from insta-bot.
You need to clone the updated repository as i've fixed the issue. It no more throw that error.
value.toLongOrNull()
is there to parse userId if userId is given in place of username.
from insta-bot.
I've fixed another bug that was causing issue in getUserIdByName()
method. Please check now.
from insta-bot.
Related Issues (2)
- can not use in android HOT 4
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 insta-bot.