2023-01-08 08:47:32 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-04-21 02:27:38 +00:00
|
|
|
"go.elara.ws/go-lemmy"
|
2023-01-08 08:47:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
ctx := context.Background()
|
|
|
|
|
|
|
|
c, err := lemmy.New("https://lemmygrad.ml")
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
2023-10-04 23:23:31 +00:00
|
|
|
err = c.ClientLogin(ctx, lemmy.Login{
|
2023-01-08 08:47:32 +00:00
|
|
|
UsernameOrEmail: "user@example.com",
|
|
|
|
Password: `TestPwd`,
|
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
2023-10-04 23:23:31 +00:00
|
|
|
_, err = c.SaveUserSettings(ctx, lemmy.SaveUserSettings{
|
|
|
|
BotAccount: lemmy.NewOptional(true),
|
2023-01-08 08:47:32 +00:00
|
|
|
})
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|