bot

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDFromToken

func IDFromToken(token string) (*discord.Snowflake, error)

IDFromToken returns the applicationID from the BotToken

func New

func New(token string, opts ...ConfigOpt) (*core.Bot, error)

New creates a new core.Bot instance with the provided bot token & ConfigOpt(s)

Types

type Config

type Config struct {
	Logger log.Logger

	RestClient       rest.Client
	RestClientConfig *rest.Config
	RestServices     rest.Services

	EventManager       core.EventManager
	EventManagerConfig *core.EventManagerConfig

	Collectors       core.Collectors
	CollectorsConfig *core.CollectorsConfig

	Gateway       gateway.Gateway
	GatewayConfig *gateway.Config

	ShardManager       sharding.ShardManager
	ShardManagerConfig *sharding.Config

	HTTPServer       httpserver.Server
	HTTPServerConfig *httpserver.Config

	Caches      core.Caches
	CacheConfig *core.CacheConfig

	AudioController       core.AudioController
	EntityBuilder         core.EntityBuilder
	MemberChunkingManager core.MemberChunkingManager
	MemberChunkingFilter  *core.MemberChunkingFilter
}

Config lets you configure your Bot instance Config is the core.Bot config used to configure everything

func (*Config) Apply

func (c *Config) Apply(opts []ConfigOpt)

type ConfigOpt

type ConfigOpt func(config *Config)

func WithAsyncEventsEnabled

func WithAsyncEventsEnabled() ConfigOpt

func WithAudioController

func WithAudioController(audioController core.AudioController) ConfigOpt

func WithCacheConfig

func WithCacheConfig(cacheConfig core.CacheConfig) ConfigOpt

func WithCacheOpts

func WithCacheOpts(opts ...core.CacheConfigOpt) ConfigOpt

func WithCaches

func WithCaches(caches core.Caches) ConfigOpt

func WithCollectors

func WithCollectors(collectors core.Collectors) ConfigOpt

func WithCollectorsConfig

func WithCollectorsConfig(collectorsConfig core.CollectorsConfig) ConfigOpt

func WithEntityBuilder

func WithEntityBuilder(entityBuilder core.EntityBuilder) ConfigOpt

func WithEventListeners

func WithEventListeners(listeners ...core.EventListener) ConfigOpt

func WithEventManager

func WithEventManager(eventManager core.EventManager) ConfigOpt

func WithGateway

func WithGateway(gateway gateway.Gateway) ConfigOpt

func WithGatewayConfig

func WithGatewayConfig(gatewayConfig gateway.Config) ConfigOpt

func WithGatewayOpts

func WithGatewayOpts(opts ...gateway.ConfigOpt) ConfigOpt

func WithHTTPServer

func WithHTTPServer(httpServer httpserver.Server) ConfigOpt

func WithHTTPServerConfig

func WithHTTPServerConfig(httpServerConfig httpserver.Config) ConfigOpt

func WithHTTPServerOpts

func WithHTTPServerOpts(opts ...httpserver.ConfigOpt) ConfigOpt

func WithLogger

func WithLogger(logger log.Logger) ConfigOpt

WithLogger lets you inject your own logger implementing log.Logger

func WithMemberChunkingFilter

func WithMemberChunkingFilter(memberChunkingFilter core.MemberChunkingFilter) ConfigOpt

func WithMemberChunkingManager

func WithMemberChunkingManager(memberChunkingManager core.MemberChunkingManager) ConfigOpt

func WithRawEventsEnabled

func WithRawEventsEnabled() ConfigOpt

func WithRestClient

func WithRestClient(restClient rest.Client) ConfigOpt

func WithRestClientConfig

func WithRestClientConfig(restClientConfig rest.Config) ConfigOpt

func WithRestClientOpts

func WithRestClientOpts(opts ...rest.ConfigOpt) ConfigOpt

func WithRestServices

func WithRestServices(restServices rest.Services) ConfigOpt

func WithShardManager

func WithShardManager(shardManager sharding.ShardManager) ConfigOpt

func WithShardManagerConfig

func WithShardManagerConfig(shardManagerConfig sharding.Config) ConfigOpt

func WithShardManagerOpts

func WithShardManagerOpts(opts ...sharding.ConfigOpt) ConfigOpt

Jump to

Keyboard shortcuts

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