bot

package
v0.0.0-...-1120f02 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	// misc.
	Log       *zap.SugaredLogger
	Config    *config.Config
	Stats     *stats.Stats
	StartTime time.Time
	Router    *gumi.Router

	// caches
	BannedUsers  *ttlcache.Cache
	EmbedCache   *cache.EmbedCache
	ArtworkCache *goCache.Cache

	// services
	Sengoku          *sengoku.Sengoku
	NHentai          *nhentai.API
	ArtworkProviders []artworks.Provider
	RepostDetector   repost.Detector

	ShardManager *shards.Manager
	Store        store.Store
}

func New

func New(config *config.Config, store store.Store, logger *zap.SugaredLogger, rd repost.Detector) (*Bot, error)

func (*Bot) AddHandler

func (b *Bot) AddHandler(handler interface{})

func (*Bot) AddProvider

func (b *Bot) AddProvider(provider artworks.Provider)

func (*Bot) AddRouter

func (b *Bot) AddRouter(router *gumi.Router)

func (*Bot) Close

func (b *Bot) Close() error

func (*Bot) Open

func (b *Bot) Open() error

Jump to

Keyboard shortcuts

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