core

package
v0.0.0-...-f388cdf Latest Latest
Warning

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

Go to latest
Published: May 27, 2017 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

View Source
const (
	TERM = -1
)

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(key string, callback CommandCallback, tag string, alttags []string)

AddCommand adds a command to Commands.

func GetCommandsLength

func GetCommandsLength() int

func LogFatal

func LogFatal(text string, owner string, errorcode int)

LogFatal logs fatal error level Info and terminates the program.

func SanitizeArgs

func SanitizeArgs(slice []string) []string

SanitizeArgs Sanitizes the arguments of a slice, by combining indexes which are in quotes.

func SliceToHumanListing

func SliceToHumanListing(slices []string) string

SliceToHumanListing converts a slice into a human listing of objects, eg. "Cat, dog and bird"

func SliceToString

func SliceToString(slices []string) string

SliceToString turns a slice of strings into a single string with space denotation.

func StringToInt64

func StringToInt64(inp string) (int64, error)

func StringToSlice

func StringToSlice(text string) (slices []string)

StringToSlice turns a string into slices based of space character denotation..

Types

type Command

type Command struct {
	Callback      CommandCallback
	CommandTag    string
	AlternateTags []string
}

Command is a command.

func GetCommand

func GetCommand(key string) (Command, error)

GetCommand gets an command via its name.

func GetCommandByTag

func GetCommandByTag(tag string) (Command, error)

GetCommandByTag gets an command by its tag.

type CommandArgs

type CommandArgs struct {
	Session *discordgo.Session
	Event   *discordgo.MessageCreate
	UsedTag string
}

CommandArgs is arguments for the command provided by discordgo

func (CommandArgs) GetChannelMention

func (c CommandArgs) GetChannelMention(ID string) string

func (CommandArgs) GetGuild

func (c CommandArgs) GetGuild() *discordgo.Guild

func (CommandArgs) GetMe

func (c CommandArgs) GetMe() *discordgo.User

func (CommandArgs) GetUserMention

func (c CommandArgs) GetUserMention(ID string) string

func (CommandArgs) SendEmbed

func (c CommandArgs) SendEmbed(embed *discordgo.MessageEmbed) *discordgo.Message

func (CommandArgs) SendFile

func (c CommandArgs) SendFile(name, file string) error

func (CommandArgs) SendMessage

func (c CommandArgs) SendMessage(text string) *discordgo.Message

func (CommandArgs) SendMessageFormatted

func (c CommandArgs) SendMessageFormatted(text string)

func (CommandArgs) SendTyping

func (c CommandArgs) SendTyping()

func (CommandArgs) SetGame

func (c CommandArgs) SetGame(game string)

type CommandCallback

type CommandCallback func(dargs CommandArgs, args []string) (success bool)

CommandCallback is a function or something

type DataRecieve

type DataRecieve struct {
	EventType int // from const
	A         interface{}
}

type LogText

type LogText struct {
	Text      string
	Verbosity string
}

LogText contains the different types of text in a log.

func LogError

func LogError(text string, owner string) LogText

LogError logs error level Info.

func LogInfo

func LogInfo(text string, owner string) LogText

LogInfo logs information level Info.

func LogInfoG

func LogInfoG(text string, owner string) LogText

LogInfoG logs information level Info, with green text c:.

func LogWarning

func LogWarning(text string, owner string) LogText

LogWarning logs warning level Info.

type Vendor

type Vendor struct {
	T map[uint]*ticket
	sync.Mutex
	// contains filtered or unexported fields

} // ID -> ticket associated

func (*Vendor) Handle

func (v *Vendor) Handle(s *discordgo.Session, a interface{})

func (*Vendor) Request

func (v *Vendor) Request(t *ticket)

func (*Vendor) TERMINATE

func (v *Vendor) TERMINATE()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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