bot

package
v0.0.0-...-7de3f38 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: MIT Imports: 4 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 {
	Name *string
	// contains filtered or unexported fields
}

Bot is a set of Responders connected to Discord.

func New

func New(spec Spec) (*Bot, error)

New builds a bot and connects it to Discord.

func (*Bot) Close

func (b *Bot) Close() error

Close disconnects the bot from Discord cleanly.

type Spec

type Spec struct {
	Name       string
	AuthToken  *string
	Responders []*responder.Responder
}

Spec is the data needed to build and connect a bot.

func (*Spec) SetAuthToken

func (spec *Spec) SetAuthToken(authToken string)

SetAuthToken sets the auth token used to connect a bot to Discord. You must set this before creating a bot with bot.New. You can get this from the Discord Developer Portal (https://discord.com/developers/applications) under [your app] -> Bot -> Token.

Jump to

Keyboard shortcuts

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