dat

package
v5.0.1-alpha+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

README

Data directory.

This is one of the key elements to a working bot. As the bot has to handle a fair bit of data, we went all in and made a universal data directory. All information the bot will use should be put in here. The bot will also generate some of its own data from commands and so on, this will also go in here. However the files that an average person who just wants a plug-n-play robot should be concerned about are as follows. Please be aware that the names must be kept unless you have gone through and changed the hard-coded name values for some reason.

  • preferences.json : Contains all the hard coded static data about the bot such as authentication and universal moderation configuration.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Log *log.Logger
)

Functions

func AlertDiscord

func AlertDiscord(s *dsg.Session, m *dsg.MessageCreate, err error)
# Alerts discord of errors.

* AlertDiscord is a function that... well alerts discord if there's a problem. * Useful for things like if your command fails and you have to return, the user * isn't kept in limbo waiting for something to happen. However this is not a * substitute for posting an error in the log and should be done *along with* * dat.Log.New(), this just helps prevent the users moaning about "broken bot" * and actually proves it to them. * * Parameters: * - s (type *discordgo.Session) : Needed for posting a message * - m (type *discordgo.Message) : Needed for posting a message. Pings .Author. * - err (type error) : The error being reported

func GetBotInfo

func GetBotInfo() (f.BotType, error)

func Load

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

func OSCheck

func OSCheck() string

To make this system universal, the bot needs to know wether it has to use a stupid backslash

func Save

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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