snart

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 11 Imported by: 0

README

Snart

A Discord bot framework in Go. Currently still a little janky, but feel free to use it if you know what you're doing!

Documentation

Overview

Package snart contains the general workings of a Snart Bot.

Index

Constants

BaseIntents is the basic intents needed by a Bot.

View Source
const KeyToken = "token"

KeyToken is the Confy key used to fetch the Bot's token.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot added in v0.4.1

type Bot struct {
	*route.Route

	Intents gateway.Intents
	Gamers  []Gamer
	Errs    chan error
}

Bot holds all the workings of a Snart bot.

func New

func New(c confy.Confy) (*Bot, error)

New creates a Bot with the given token.

func (*Bot) CycleGamers added in v0.5.0

func (b *Bot) CycleGamers()

CycleGamers continually updates the Bot's status using a random Gamer, on an interval.

func (*Bot) Plug added in v0.5.0

func (b *Bot) Plug(p Plug) error

Plug applies the given Plug to the Bot.

func (*Bot) Run added in v0.4.1

func (b *Bot) Run() error

Run performs the Bot's startup functions, and waits for an error.

type Gamer added in v0.5.0

type Gamer interface {
	Activity() discord.Activity
}

Gamer generates an Activity.

type GamerFunc added in v0.5.0

type GamerFunc func() discord.Activity

GamerFunc is a func that is a Gamer.

func (GamerFunc) Activity added in v0.5.0

func (f GamerFunc) Activity() discord.Activity

Activity simply calls the GamerFunc and returns the returned Activity.

type GamerStatic added in v0.5.0

type GamerStatic discord.Activity

GamerStatic is an Activity that is a Gamer.

func (GamerStatic) Activity added in v0.5.0

func (s GamerStatic) Activity() discord.Activity

Activity simply returns the GamerStatic as an Activity.

type GamerTimer added in v0.5.0

type GamerTimer time.Time

GamerTimer is a Time that is a Gamer.

func (GamerTimer) Activity added in v0.5.0

func (t GamerTimer) Activity() discord.Activity

Activity returns an Activity that describes the duration since the GamerTimer.

type Plug added in v0.5.0

type Plug interface {
	fmt.Stringer

	Plug(*Bot) error
}

Plug describes a plugin for a Bot.

Directories

Path Synopsis
bot module
cmd
snart
Package main is an example command for Snart.
Package main is an example command for Snart.
lib module
route module

Jump to

Keyboard shortcuts

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