Documentation ¶
Index ¶
- Constants
- Variables
- func GetConnection() *persistence.Connection
- func MarshalJSON(v interface{}) ([]byte, error)
- func PrepareAndExecute(query string, args ...interface{}) error
- func Query(query string, args ...interface{}) (*sql.Rows, error)
- func QueryRow(query statement.Statement, data ...interface{}) error
- func RequestJSON(request string, i interface{}) error
- func WriteTo(w io.Writer, v interface{}) error
- type Card
- type Command
- type Configuration
- type Deck
- type Game
- type Responder
- type Role
- type Runner
- type SearchData
- type User
- type WeatherData
- type YoutubeData
Constants ¶
View Source
const ( ZWSP = "\u200B" Response = ZWSP + "<@%s>: %s" )
Variables ¶
View Source
var ( ErrNoConnection = fmt.Errorf("No connection has been built") Hearts = []string{"❤", "♡", "❥", "ღ", "💕", "💞", "💝", "💘", "💖", "💓", "💗", "❦", "❧", "💟", "💌", "❣", "💔", "💙", "💚", "💛", "💜", "<3"} HeartResponses = []string{ ":sparkling_heart::gift_heart::revolving_hearts::heart_decoration::love_letter:~k-kawaiiiiiiiiii!!!!!~!!!~~!!~:love_letter::heart_decoration::revolving_hearts::gift_heart::sparkling_heart:", "<3", ":heart:", "ily %n", "tee hee, senpai noticed me", "わたしは、あなたを愛しています", "사랑해", "杀了自己", ":heart:", "01101100011011110111011001100101", "`func heart(s *discordgo.Session, m *discordgo.MessageCreate) {\n\t" + "r := rand.New(rand.NewSource(time.Now().UnixNano()))\n\t" + "index := r.Int31n(int32(len(hearts)))\n\t" + "s.ChannelMessageSend(m.ChannelID, strings.ReplaceAll(heart[index], \"%n\", m.Author.Username, -1))\n" + "}`", } )
Functions ¶
func GetConnection ¶
func GetConnection() *persistence.Connection
func MarshalJSON ¶
func PrepareAndExecute ¶
func RequestJSON ¶
Types ¶
type Configuration ¶
type Configuration struct { Bot struct { Token string `json:"token"` Prefix string `json:"prefix"` Secret string `json:"secret"` } `json:"bot"` Google struct { Cx string `json:"cx"` Key string `json:"key"` } `json:"google"` Weather struct { Key string `json:"key"` } `json:"weather"` Eti struct { Username string `json:"username"` Password string `json:"password"` } `json:"eti"` Sql struct { File string `json:"file"` } `json:"sql"` }
var Config Configuration
type Game ¶
type Game interface { // Name returns the name of the module Name() string // Description returns the description of the module Description() string // Rules returns the specific rules of the module Rules() string // Start takes an "onFinish" function as well as the normal session and event params // It is called by the handler when the game starts Start(*discordgo.Session, *discordgo.MessageCreate, func()) bool // Finish should perform cleanup tasks and then call the "onFinish" function which was passed in at Start Finish(*discordgo.Session, *discordgo.MessageCreate) // Join is called when a player joins the game Join(*discordgo.Session, *discordgo.MessageCreate) }
Game is a simple interface which allows you to add "game modules"
type SearchData ¶
type WeatherData ¶
type YoutubeData ¶
Click to show internal directories.
Click to hide internal directories.