Documentation
¶
Index ¶
- Variables
- func ConnectToDB() (*sqlx.DB, error)
- func CreateChallengeTable(db *sqlx.DB) error
- func CreateScoreboardTable(db *sqlx.DB) error
- func CreateVotingRecord(db *sqlx.DB) error
- func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate)
- func MessageReactionCreate(s *discordgo.Session, r *discordgo.MessageReactionAdd)
- func MessageReactionDelete(s *discordgo.Session, r *discordgo.MessageReactionRemove)
- type ChallengeTableEntryStruct
- type ScoreboardTableEntryStruct
- type VotesStruct
- type VotingRecordEntryStruct
Constants ¶
This section is empty.
Variables ¶
View Source
var RegexUserPatternID = regexp.MustCompile(fmt.Sprintf(`<@.?[0-9]*?>`))
var RegexUserPatternID = regexp.MustCompile(fmt.Sprintf(`^(<@!(\d{%d,})>)$`, maxIDLength))
Functions ¶
func ConnectToDB ¶
ConnectToDB creates DB if it doesn't exist already
func CreateChallengeTable ¶
CreateChallengeTable this table stores values for challenge votes
func CreateScoreboardTable ¶
CreateScoreboardTable this table stores results of challenge votes
func CreateVotingRecord ¶
CreateVotingRecord this table stores users' votes on each challenge
func MessageCreate ¶
func MessageCreate(s *discordgo.Session, m *discordgo.MessageCreate)
MessageCreate trigger>response for messagecreate events
func MessageReactionCreate ¶
func MessageReactionCreate(s *discordgo.Session, r *discordgo.MessageReactionAdd)
MessageReactionCreate trigger>response for messagereactionadd events
func MessageReactionDelete ¶
func MessageReactionDelete(s *discordgo.Session, r *discordgo.MessageReactionRemove)
MessageReactionDelete trigger>response for messagereactionremove events
Types ¶
type ChallengeTableEntryStruct ¶
type ChallengeTableEntryStruct struct { MessageID string `db:"MessageID"` ChallengerID string `db:"ChallengerID"` ChallengerName string `db:"ChallengerName"` DefenderID string `db:"DefenderID"` DefenderName string `db:"DefenderName"` ChallengerVotes int `db:"ChallengerVotes"` DefenderVotes int `db:"DefenderVotes"` AbstainVotes int `db:"AbstainVotes"` StopVotes int `db:"StopVotes"` Outcome int `db:"Outcome"` }
ChallengeTableEntryStruct fields
type ScoreboardTableEntryStruct ¶
type ScoreboardTableEntryStruct struct { UserID string `db:"UserID"` Username string `db:"Username"` TotalChallengeWins int `db:"TotalChallengeWins"` TotalChallengeLosses int `db:"TotalChallengeLosses"` TotalChallengeTies int `db:"TotalChallengeTies"` TotalChallenges int `db:"TotalChallenges"` SuccessfulChallenges int `db:"SuccessfulChallenges"` FailedChallenges int `db:"FailedChallenges"` SuccessfulDefenses int `db:"SuccessfulDefenses"` FailedDefenses int `db:"FailedDefenses"` }
type VotesStruct ¶
Click to show internal directories.
Click to hide internal directories.