reactions

package
v1.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	NoteID   string `json:"noteId"`
	Reaction string `json:"reaction"`
}

CreateRequest represents an /reactions request.

func (CreateRequest) Validate

func (r CreateRequest) Validate() error

Validate the request.

type DeleteRequest

type DeleteRequest struct {
	NoteID string `json:"noteId"`
}

DeleteRequest represents an /reactions request.

func (DeleteRequest) Validate

func (r DeleteRequest) Validate() error

Validate the request.

type Service

type Service struct {
	Call core.RequestHandlerFunc
}

Service is the base for all the endpoints on this service.

func NewService

func NewService(requestHandler core.RequestHandlerFunc) *Service

NewService creates a new Service instance.

func (*Service) Create

func (s *Service) Create(request CreateRequest) error

Create endpoint.

Example
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))

err := client.Notes().Reactions().Create(reactions.CreateRequest{
	NoteID:   "8dsk7x47y3",
	Reaction: "👋",
})
if err != nil {
	log.Printf("[Notes/Reaction/Create] %s", err)

	return
}
Output:

func (*Service) Delete

func (s *Service) Delete(noteID string) error

Delete endpoint.

Example
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))

err := client.Notes().Reactions().Delete("8dsk7x47y3")
if err != nil {
	log.Printf("[Notes/Reaction/Delete] %s", err)

	return
}
Output:

func (*Service) Show

func (s *Service) Show(request ShowRequest) ([]models.Reaction, error)

Show endpoint.

Example
client, _ := misskey.NewClientWithOptions(misskey.WithSimpleConfig("https://slippy.xyz", os.Getenv("MISSKEY_TOKEN")))

reactions, err := client.Notes().Reactions().Show(reactions.ShowRequest{
	NoteID: "8dsk7x47y3",
	Limit:  10,
})
if err != nil {
	log.Printf("[Notes/Show] %s", err)

	return
}

for _, reaction := range reactions {
	log.Printf("[Notes/Show] <%s> %s", reaction.User.Username, reaction.Type)
}
Output:

type ShowRequest

type ShowRequest struct {
	NoteID  string      `json:"noteId"`
	Type    core.String `json:"type"`
	Limit   uint        `json:"Limit"`
	Offset  uint64      `json:"offset"`
	SinceID string      `json:"sinceId"`
	UntilID string      `json:"untilId"`
}

ShowRequest represents an /reactions request.

func (ShowRequest) Validate

func (r ShowRequest) Validate() error

Validate the request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL