bot

package
v0.0.0-...-3f13264 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 41 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 {
	// contains filtered or unexported fields
}

Bot is a Discord bot account.

func New

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

New creates a new Bot.

func (*Bot) Start

func (b *Bot) Start(ctx context.Context) error

Start opens a connection to Discord and enables the internal image cache's automatic deletion.

type Option

type Option func(*Bot)

Option configures a Bot.

func WithAdmins

func WithAdmins(admins ...discord.UserID) Option

WithAdmins adds one or more admins to the Bot.

func WithDB

func WithDB(db *sql.DB) Option

WithDB sets a Bot's DB.

func WithDebug

func WithDebug(debug bool) Option

WithDebug toggles debug mode on a Bot.

func WithFeedbackWebhook

func WithFeedbackWebhook(hook *webhook.Client) Option

WithFeedbackWebhook sets the Bot's feedback webhook.

func WithLogger

func WithLogger(l *zap.Logger) Option

WithLogger sets a Bot's logger.

func WithLoggingWebhook

func WithLoggingWebhook(hook *webhook.Client) Option

WithLoggingWebhook sets the Bot's error log webhook.

func WithSiteAddr

func WithSiteAddr(site string) Option

WithSiteAddr sets a Bot's site address.

func WithSteamAPIKey

func WithSteamAPIKey(key string) Option

WithSteamAPIKey sets a Bot's Steam API key.

func WithTopsterAddr

func WithTopsterAddr(t string) Option

WithTopsterAddr sets the Bot's address for a Topster microservice.

Jump to

Keyboard shortcuts

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