This commit is contained in:
2023-03-31 20:49:50 +00:00
parent 6e5450aa80
commit 5e6a433b92
15 changed files with 75 additions and 46 deletions

View File

@ -11,6 +11,7 @@ type Mastodon struct {
client *mastodon.Client
}
// NewMastodon initializes a new Mastodon client
func NewMastodon(server string, clientID string, clientSecret string, username string, password string) *Mastodon {
m := &Mastodon{}

View File

@ -6,6 +6,7 @@ import (
"github.com/mattn/go-mastodon"
)
// Toot publishes a toot on Mastodon
func (m *Mastodon) Toot(message string) error {
_, err := m.client.PostStatus(context.Background(), &mastodon.Toot{
Status: message,