Skip to content

Error CLI: can't become an admin #2261

Answered by mnvr
iSLuP4l477u asked this question in Q&A
Jun 22, 2024 · 4 comments · 12 replies
Discussion options

You must be logged in to vote

So the gist seems to be that admin is present after reading the config

settings := viper.AllSettings()

But is lost when we try to get in with

admins := viper.GetIntSlice("internal.admins")

If you're up for debugging then you could try and find out where in the middle it is getting lost. Also might be a good idea to add a printf for admins := viper.GetIntSlice("internal.admins") at the same point where you're doing the test print from settings := viper.AllSettings().


All that's if you wish to debug. OTOH, if you just wish to unblock yourself, one easy way is to change:

if int64(admin) == userID { 

to

if YOUR_ID == userID { 

Another way is to directly modify the storage in the DB, someth…

Replies: 4 comments 12 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@mnvr
Comment options

mnvr Jun 23, 2024
Maintainer

@iSLuP4l477u
Comment options

@iSLuP4l477u
Comment options

Comment options

You must be logged in to vote
9 replies
@iSLuP4l477u
Comment options

@iSLuP4l477u
Comment options

@iSLuP4l477u
Comment options

@mnvr
Comment options

mnvr Jun 25, 2024
Maintainer

Answer selected by iSLuP4l477u
@mnvr
Comment options

mnvr Jun 25, 2024
Maintainer

@iSLuP4l477u
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants