Documentation ¶
Index ¶
- type Player
- func (player *Player) Add()
- func (player *Player) Delete()
- func (player *Player) GetBlockCard() []ns.MixedElement
- func (player *Player) GetBlockCardWithText(before, after string) []ns.MixedElement
- func (player *Player) GetPosition() int
- func (player *Player) IDStr() string
- func (player *Player) IngestData()
- func (player *Player) ToStr() string
- func (player *Player) Update() (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Player ¶
type Player struct { gorm.Model TeamID string `gorm:"not null"` ChannelID string `gorm:"not null"` SlackID string `gorm:"not null"` Name string `gorm:"not null"` Image string Points float64 `gorm:"default:1000"` }
Player stores the player points and personal info.
func GetAllPlayers ¶
GetAllPlayers list all players
func GetOrCreatePlayer ¶
GetOrCreatePlayer will try to find the player, if can't, will return an brand new one
func GetPlayers ¶
GetPlayers list a number of players limited by the given threshold
func (*Player) GetBlockCard ¶
func (player *Player) GetBlockCard() []ns.MixedElement
GetBlockCard calls GetBlockCardWithText using a default text
func (*Player) GetBlockCardWithText ¶
func (player *Player) GetBlockCardWithText(before, after string) []ns.MixedElement
GetBlockCardWithText formats the Player Image and Name on a Slack Block Kit
func (*Player) GetPosition ¶
GetPosition returns the current position for the given player
func (*Player) IngestData ¶
func (player *Player) IngestData()
IngestData calls Slack API to get Users data
Click to show internal directories.
Click to hide internal directories.