feedback

package
v0.0.0-...-6184a78 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Service is the service to use.
	// It can be "github", "dm", or "all".
	// If it is not set, no service will be used.
	Service []string `yaml:"service" mapstructure:"service"`
	// GitHub is the configuration for the GitHub service.
	GitHub githubConfig `yaml:"github" mapstructure:"github"`
	// DM is the configuration for the DM service.
	DM dmConfig `yaml:"dm" mapstructure:"dm"`
}

Config is the configuration for the service.

func (*Config) Validate

func (c *Config) Validate() error

type ErrUnrecognizedServices

type ErrUnrecognizedServices struct {
	// contains filtered or unexported fields
}

ErrUnrecognizedServices is the error for unrecognized services.

func (*ErrUnrecognizedServices) Error

func (e *ErrUnrecognizedServices) Error() string

Error returns the error message.

func (*ErrUnrecognizedServices) Is

func (e *ErrUnrecognizedServices) Is(target error) bool

Is checks if the target is an ErrUnknownService.

type Request

type Request struct {
	Feedback string       `json:"feedback"`
	Server   string       `json:"server"`
	Username string       `json:"username"`
	UserID   snowflake.ID `json:"user_id"`
}

Request is the request for the feedback.

func (Request) Validate

func (r Request) Validate() error

type Service

type Service interface {
	// Submit submits the feedback.
	Submit(ctx context.Context, req Request, client bot.Client) error
}

Service is the interface for the service.

func NewService

func NewService(c *Config) Service

NewService creates a new feedback service.

Jump to

Keyboard shortcuts

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