discord

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncorrectType = errors.New("config is not of type: 'discord'")

Functions

This section is empty.

Types

type BotParser

type BotParser struct {
}

func (*BotParser) Parse

func (c *BotParser) Parse(val map[string]interface{}) (seras.Bot, error)

type Config

type Config struct {
	Token string
	seras.BaseConnection
}

func ParseConfig

func ParseConfig(val map[string]interface{}) (Config, error)

ParseConfig TODO: I seriously need like an internal lib to map this automatically.

type Connection

type Connection struct {
	Config
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Connection, error)

func (*Connection) AddMods

func (con *Connection) AddMods(mods []seras.Module)

func (*Connection) Bold

func (con *Connection) Bold(str string) string

func (*Connection) Close

func (con *Connection) Close() error

func (*Connection) Connect

func (con *Connection) Connect() (seras.Stream, error)

func (*Connection) IsAdmin

func (con *Connection) IsAdmin(userId string) bool

func (*Connection) Italicize

func (con *Connection) Italicize(str string) string

func (*Connection) ModList added in v0.5.0

func (con *Connection) ModList() map[string]interface{}

func (*Connection) Modules added in v0.5.0

func (con *Connection) Modules() []seras.Module

func (*Connection) Reply

func (con *Connection) Reply(msg seras.Message, content string) error

func (*Connection) Send

func (con *Connection) Send(msg seras.Message) error

func (*Connection) TimeoutUser

func (con *Connection) TimeoutUser(channel string, user string, until time.Time) error

Jump to

Keyboard shortcuts

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