mattn / go-mastodon

mastodon client for golang
MIT License
599 stars 85 forks source link

Can't get it working. #163

Open iota17 opened 1 year ago

iota17 commented 1 year ago

I know I'm just an idiot, but I can't figure out how to get it working. Please, send instructions. I have been trying to get it to work for 1+ hrs. I use Win11, I have Go installed.

till commented 1 year ago

The readme contains examples how to use this code. :) They work. So in order to get help, it would be great if you shared what doesn't work.

lmas commented 1 year ago

Follow this guide for example, for registering a new application on your account and get an Access Token to login with.

Then you just have to provide the token when setting up a new client:

c := mastodon.NewClient(&mastodon.Config{
    Server:      "http://localhost:8000", // or whatever server you're trying to connect to
    AccessToken: "longtokenhere",
})

Works flawlessly for me.

ktpx commented 11 months ago

Docs doesnt mention accesstoken.

This does not work either if you have 2FA enabled, btw.