service

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotCollector

type BotCollector interface {
	prometheus.Collector
	TrackMessage(channel, userHandle string)
	TrackBotUsage(channel, userHandle string)
}

type Option

type Option func(*Service) error

Option is an optional setting for the Service

func Address

func Address(addr string) Option

Address option for the service

func Collector

func Collector(collector BotCollector) Option

Collector option for the service

func Dictionary

func Dictionary(path string) Option

Dictionary option for the service

func Jokes added in v0.2.0

func Jokes() Option

Jokes option for the service

func Logger

func Logger(log logrus.FieldLogger) Option

Logger option for the service

func PinnedMessages added in v0.4.0

func PinnedMessages(token string, update time.Duration) Option

type Service

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

func New

func New(token string, options ...Option) (Service, error)

New creates a new instance of the service, which creates a new discord session and manage them.

func (*Service) Close

func (srv *Service) Close()

Close shut down the current discord session

func (*Service) HelpMessage

func (srv *Service) HelpMessage() []string

HelpMessage returns all commands of the bot

func (*Service) ListenAndServe

func (srv *Service) ListenAndServe() error

ListenAndServe listen on the tcp connection

func (*Service) Publish added in v0.2.0

func (srv *Service) Publish(channel, author string, message string)

func (*Service) TrackRequest

func (srv *Service) TrackRequest(channel, authorID string)

Jump to

Keyboard shortcuts

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