daemon

package
v0.0.0-...-b19cdf9 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDiscordClient

func NewDiscordClient(token, deviceName, browser string) *state.State

NewDiscordClient creates a new Discord state.State instance. deviceName and browser are optional.

Types

type Daemon

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

Daemon is a Discord instance that watches the gateway and updates the database storer.

func New

func New(token string, storer discspy.Storer, opts DaemonOpts) *Daemon

New creates a new Daemon.

func (*Daemon) Connect

func (d *Daemon) Connect(ctx context.Context) error

Connect connects the daemon to the Discord gateway.

type DaemonOpts

type DaemonOpts struct {
	// WatchGuilds is a list of guild IDs to be watched. If nil, then all guilds
	// are watched.
	WatchGuilds []discord.GuildID
	// DeviceName is the optional device name to be used for identifying with
	// the gateway. If empty, then the hostname is used.
	DeviceName string
}

DaemonOpts are options for NewDaemon.

Jump to

Keyboard shortcuts

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