moderators

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: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddRequest

type AddRequest struct {
	UserID string `json:"userId"`
}

AddRequest represents an Add moderator request.

func (AddRequest) Validate

func (r AddRequest) Validate() error

Validate the request.

type RemoveRequest

type RemoveRequest struct {
	UserID string `json:"userId"`
}

RemoveRequest represents an Remove moderator request.

func (RemoveRequest) Validate

func (r RemoveRequest) 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) Add

func (s *Service) Add(userID string) error

Add a moderator.

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

err := client.Admin().Moderators().Add("88v9vu5nbu")
if err != nil {
	log.Printf("[Admin/Moderators/Add] %s", err)

	return
}
Output:

func (*Service) Remove

func (s *Service) Remove(userID string) error

Remove a moderator.

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

err := client.Admin().Moderators().Remove("88v9vu5nbu")
if err != nil {
	log.Printf("[Admin/Moderators/Remove] %s", err)

	return
}
Output:

Jump to

Keyboard shortcuts

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