Documentation
¶
Index ¶
- Constants
- func GetJSON(request string, i interface{}) error
- func Hash(salt, provided string) string
- func MarshalJSON(v interface{}) ([]byte, error)
- func RandomString(length int) string
- func URLToken() string
- func WriteTo(w io.Writer, v interface{}) error
- type Card
- type Deck
- type FrenchCard
- type FrenchDeck
- type Game
- type Plugin
Constants ¶
View Source
const TOKEN_LENGTH = 64
Variables ¶
This section is empty.
Functions ¶
func Hash ¶
Hash takes a salt and provided string and returns their corresponding combined sha256 string
func MarshalJSON ¶
func RandomString ¶
RandomString returns a random string with the specified length
Types ¶
type FrenchCard ¶
type FrenchCard struct {
// contains filtered or unexported fields
}
FrenchCard is a struct for cards
func NewCard ¶
func NewCard(v, s string) *FrenchCard
func (*FrenchCard) Suit ¶
func (c *FrenchCard) Suit() string
func (*FrenchCard) Value ¶
func (c *FrenchCard) Value() string
type FrenchDeck ¶
type FrenchDeck struct {
// contains filtered or unexported fields
}
func NewDeck ¶
func NewDeck() *FrenchDeck
func NewHand ¶
func NewHand() *FrenchDeck
func (*FrenchDeck) Draw ¶
func (self *FrenchDeck) Draw() Card
func (*FrenchDeck) Insert ¶
func (self *FrenchDeck) Insert(card Card)
func (*FrenchDeck) Next ¶
func (self *FrenchDeck) Next() Card
func (*FrenchDeck) Peek ¶
func (self *FrenchDeck) Peek() Card
func (*FrenchDeck) Shuffle ¶
func (self *FrenchDeck) Shuffle()
Deck generates, shuffles, and deals a deck of 52 cards
func (*FrenchDeck) Size ¶
func (self *FrenchDeck) Size() int
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"
Click to show internal directories.
Click to hide internal directories.