moderation

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: 1

Documentation

Index

Examples

Constants

View Source
const (
	// AllState for all reports.
	AllState ReportState = ""
	// ResolvedState for resolved reports.
	ResolvedState ReportState = "resolved"
	// UnresolvedState for unresolved reports.
	UnresolvedState ReportState = "unresolved"

	// OriginCombined for local and remote users.
	OriginCombined UserOrigin = "combined"
	// OriginLocal for only local users.
	OriginLocal UserOrigin = "local"
	// OriginRemote for only remote users.
	OriginRemote UserOrigin = "remote"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ReportState

type ReportState string

ReportState is the state of a report.

type ResolveReportRequest

type ResolveReportRequest struct {
	ID string `json:"reportId"`
}

ResolveReportRequest represents an ResolveReport Announcement request.

func (ResolveReportRequest) Validate

func (r ResolveReportRequest) 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) ResolveReport

func (s *Service) ResolveReport(id string) error

ResolveReport lists all announcements.

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

err := client.Admin().Moderation().ResolveReport("8evj2lmh10")
if err != nil {
	log.Printf("[Admin/Moderation] %s", err)

	return
}
Output:

func (*Service) UserReports

func (s *Service) UserReports(request UserReportsRequest) ([]models.Report, error)

UserReports lists all announcements.

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

response, err := client.Admin().Moderation().UserReports(moderation.UserReportsRequest{})
if err != nil {
	log.Printf("[Admin/Moderation] %s", err)

	return
}

for _, item := range response {
	log.Printf("[Admin/Moderation] %s", item.Comment)
}
Output:

type UserOrigin

type UserOrigin string

UserOrigin of a user.

type UserReportsRequest

type UserReportsRequest struct {
	Limit            uint        `json:"limit,omitempty"`
	SinceID          string      `json:"sinceId,omitempty"`
	UntilID          string      `json:"untilId,omitempty"`
	State            ReportState `json:"state,omitempty"`
	ReporterOrigin   UserOrigin  `json:"reporterOrigin,omitempty"`
	TargetUserOrigin UserOrigin  `json:"targetUserOrigin,omitempty"`
}

UserReportsRequest represents an UserReports Announcement request.

func (UserReportsRequest) Validate

func (r UserReportsRequest) Validate() error

Validate the request.

Jump to

Keyboard shortcuts

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