add followers command
parent
11e2501455
commit
dfbfecd326
|
@ -0,0 +1,24 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/mattn/go-mastodon"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
func cmdFollowers(c *cli.Context) error {
|
||||
client := c.App.Metadata["client"].(*mastodon.Client)
|
||||
account, err := client.GetAccountCurrentUser()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
followers, err := client.GetAccountFollowers(account.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, follower := range followers {
|
||||
fmt.Printf("%v,%v\n", follower.ID, follower.Username)
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue