Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
Log *log.Logger
)
Functions ¶
func AlertDiscord ¶
# 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 Load ¶
Loads a file from json
* This is a simple helper function to manage data persistance and keep it in * one place. * * Parameters * - fileName (string) : where the data is stored. Note that this should * be in the form of $MODULENAME/*.json so modules that * use the same name config.json don't interfere. * - v (interface{}) : the thing you're loading. as a pointer * * Returns: * - error : error has already been logged, but useful for AlertDiscord()
func Save ¶
Saves a file to json
* This is a simple helper function to manage data persistance and keep it in * one place. * * Parameters * - fileName (string) : where the data is to be stored. Note that this should * be in the form of $MODULENAME/*.json so modules that * use the same name config.json don't interfere. * - v (interface{}) : the thing you're saving. * * Returns: * - error : error has already been logged, but useful for AlertDiscord()
Types ¶
This section is empty.