go-lemmy/README.md

29 lines
467 B
Markdown
Raw Normal View History

2022-12-10 17:17:16 +00:00
# Go-Lemmy
Go bindings to the [Lemmy](https://join-lemmy.org) API
Example:
```go
ctx := context.Background()
c, err := lemmy.New("https://lemmy.ml")
if err != nil {
panic(err)
}
err = c.Login(ctx, types.Login{
UsernameOrEmail: "email@example.com",
Password: `TestPwd`,
})
if err != nil {
panic(err)
}
_, err = c.SaveUserSettings(ctx, types.SaveUserSettings{
BotAccount: types.NewOptional(true),
})
if err != nil {
panic(err)
}
```