bot

package
v0.0.0-...-5cc7e29 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//Marshal will marshal the object into an io reader
	//uses the json marshaller
	Marshal = func(v interface{}) (io.Reader, error) {
		b, err := json.MarshalIndent(v, "", "\t")
		if err != nil {
			return nil, err
		}
		return bytes.NewReader(b), nil
	}
	//UnMarshal will unmarshal r into v
	UnMarshal = func(r io.Reader, v interface{}) error {
		return json.NewDecoder(r).Decode(v)
	}
)
View Source
var (

	//BotID the bot's ID
	BotID string
)

Functions

func BanUsr

func BanUsr(s *discordgo.Session, m *discordgo.MessageCreate, args []string)

BanUsr bans a user

func Load

func Load(path string, v interface{}) error

Load will load data from a file at path into v

func Save

func Save(path string, v interface{}) error

Save will save a representation of v to a file at path

func Start

func Start() (*discordgo.Session, error)

Start starts the bot session

Types

This section is empty.

Jump to

Keyboard shortcuts

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