Documentation
¶
Index ¶
- func AddGuildMembership(userID, guildID string) bool
- func AddRecentCoopID(userID string, coopID string)
- func AddTimer(id, userID, channelID, msgID string, reminder time.Time, message string, ...)
- func AddWatch(userID, watchType, targetID string)
- func DeleteAllLeaderboardExclusionsForUserInGuild(guildID, userID string) error
- func DeleteAllLeaderboardOptInsForUserInGuild(guildID, userID string) error
- func DeleteAllLeaderboardStatsForPlayer(player string) error
- func DeleteAllLeaderboardStatsForPlayerInGuild(player, guildID string) error
- func DeleteFarmer(userID string)
- func DeleteInactiveTimers()
- func DeleteLeaderboardExclusion(guildID, userID, lbType string) error
- func DeleteLeaderboardOptIn(guildID, userID, lbType string) error
- func DeleteLeaderboardStatsForPlayer(player, lbType string) error
- func DeleteTimer(id string)
- func DeleteUserWatches(userID string)
- func DeleteWatch(userID, watchType, targetID string)
- func FarmerExists(userID string) bool
- func FlushPendingSaves()
- func GetAltControllerByMiscString(key, value string) []string
- func GetDiscordUserIDFromEggIncName(eggIncName string) (string, error)
- func GetDiscordUserIDFromEiIgn(eiIgn string) (string, error)
- func GetDiscordUserIDFromEiIgnExact(eiIgn string) (string, error)
- func GetEggIncName(userID string) string
- func GetEiIgnsByGuild(guildID string) []string
- func GetEiIgnsByMiscString(key, value string) []string
- func GetGuildMembers(guildID string) []string
- func GetLastSeen(userID string) time.Time
- func GetLatestLeaderboardSnapDate(lbType string) (string, error)
- func GetLaunchHistory(userID string) bool
- func GetLeaderboardOptInUsers() ([]string, error)
- func GetLeaderboardSnapDates(lbType string) ([]string, error)
- func GetLinks(userID string) []string
- func GetMiscSettingFlag(userID string, key string) bool
- func GetMiscSettingString(userID string, key string) string
- func GetMissionShipPrimary(userID string) int
- func GetMissionShipSecondary(userID string) int
- func GetPing(userID string) bool
- func GetRecentCoopIDs(userID string) []string
- func GetSlashPrivacyCommand(cmd string) *discordgo.ApplicationCommand
- func GetTokens(userID string) int
- func GetUserGuilds(userID string) []string
- func HandlePrivacyCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleSetEggIncName(s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func InsertSuspectMission(arg InsertSuspectMissionParams) error
- func IsUltra(userID string) bool
- func PruneOlderLeaderboardStatsForPlayer(lbType, player, keepSnapDate string) error
- func RemoveCustomBanner(userID string, guildID string) error
- func RemoveGuildMembership(userID, guildID string)
- func SetCustomBanner(userID string, guildID string, imageData []byte) error
- func SetEggIncName(userID string, eggIncName string)
- func SetLastSeen(userID string)
- func SetLaunchHistory(userID string, setting bool)
- func SetLink(userID string, description string, guildID string, channelID string, ...)
- func SetMiscSettingFlag(userID string, key string, value bool)
- func SetMiscSettingString(userID string, key string, value string)
- func SetMissionShipPrimary(userID string, setting int)
- func SetMissionShipSecondary(userID string, setting int)
- func SetPing(userID string, ping bool)
- func SetTokens(userID string, tokens int)
- func SetUltra(userID string)
- func SlashSetEggIncNameCommand(cmd string) *discordgo.ApplicationCommand
- func SyncCustomBanner(userID string, guildID string, destPath string) bool
- func UpdateTimerMsg(id, channelID, msgID string)
- func UpdateTimerState(id string, active bool)
- func UpsertLeaderboardExclusion(guildID, userID, lbType string) error
- func UpsertLeaderboardOptIn(guildID, userID, lbType string) error
- func UpsertLeaderboardStat(lbType, player, gameName, snapDate string, value float64, ...) error
- type AddGuildMembershipParams
- type CustomBanner
- type DBTX
- type DeleteAllLeaderboardExclusionsForUserInGuildParams
- type DeleteAllLeaderboardOptInsForUserInGuildParams
- type DeleteCustomBannerParams
- type DeleteLeaderboardExclusionParams
- type DeleteLeaderboardOptInParams
- type DeleteLeaderboardStatsForPlayerParams
- type DeleteWatchParams
- type Farmer
- type FarmerGuildMembership
- type FarmerState
- type GetCustomBannerParams
- type GetCustomBannerRow
- type GetEiIgnsByMiscStringParams
- type GetIdsByMiscStringParams
- type GetLeaderboardExclusionsForUserRow
- type GetLeaderboardForSnapDateParams
- type GetLeaderboardForSnapDateRow
- type GetLeaderboardOptInsForGuildRow
- type GetLeaderboardOptInsForUserRow
- type GetLeaderboardStatForPlayerParams
- type GetLeaderboardStatForPlayerRow
- type GetStatsForPlayerInGuildParams
- type InsertLegacyFarmerstateParams
- type InsertSuspectMissionParams
- type InsertTimerParams
- type InsertWatchParams
- type LeaderboardExclusion
- type LeaderboardOptin
- type LeaderboardStat
- type Link
- type PruneOlderLeaderboardStatsForPlayerParams
- type Queries
- func (q *Queries) AddGuildMembership(ctx context.Context, arg AddGuildMembershipParams) (int64, error)
- func (q *Queries) ClearExtraLegacyRecords(ctx context.Context) error
- func (q *Queries) DeleteAllLeaderboardExclusionsForUserInGuild(ctx context.Context, arg DeleteAllLeaderboardExclusionsForUserInGuildParams) error
- func (q *Queries) DeleteAllLeaderboardOptInsForUserInGuild(ctx context.Context, arg DeleteAllLeaderboardOptInsForUserInGuildParams) error
- func (q *Queries) DeleteAllLeaderboardStatsForPlayerInGuild(ctx context.Context) error
- func (q *Queries) DeleteCustomBanner(ctx context.Context, arg DeleteCustomBannerParams) error
- func (q *Queries) DeleteFarmerLegacyRecords(ctx context.Context, id string) error
- func (q *Queries) DeleteFarmerRecord(ctx context.Context, id string) error
- func (q *Queries) DeleteInactiveTimers(ctx context.Context) error
- func (q *Queries) DeleteLeaderboardExclusion(ctx context.Context, arg DeleteLeaderboardExclusionParams) error
- func (q *Queries) DeleteLeaderboardOptIn(ctx context.Context, arg DeleteLeaderboardOptInParams) error
- func (q *Queries) DeleteLeaderboardStatsForPlayer(ctx context.Context, arg DeleteLeaderboardStatsForPlayerParams) error
- func (q *Queries) DeleteLegacyFarmerstate(ctx context.Context, id string) error
- func (q *Queries) DeleteTimer(ctx context.Context, id string) error
- func (q *Queries) DeleteUserCustomBanners(ctx context.Context, userID string) error
- func (q *Queries) DeleteUserGuildMemberships(ctx context.Context, userID string) error
- func (q *Queries) DeleteUserLeaderboardExclusions(ctx context.Context, userID string) error
- func (q *Queries) DeleteUserLeaderboardOptIns(ctx context.Context, userID string) error
- func (q *Queries) DeleteUserLeaderboardStats(ctx context.Context, player string) error
- func (q *Queries) DeleteUserSuspectMissions(ctx context.Context, userID string) error
- func (q *Queries) DeleteUserTimers(ctx context.Context, userID string) error
- func (q *Queries) DeleteUserWatches(ctx context.Context, userID string) error
- func (q *Queries) DeleteWatch(ctx context.Context, arg DeleteWatchParams) error
- func (q *Queries) GetAllLegacyFarmerstate(ctx context.Context) ([]FarmerState, error)
- func (q *Queries) GetAllWatches(ctx context.Context) ([]Watch, error)
- func (q *Queries) GetCustomBanner(ctx context.Context, arg GetCustomBannerParams) (GetCustomBannerRow, error)
- func (q *Queries) GetCustomBannersForUser(ctx context.Context, userID string) ([]CustomBanner, error)
- func (q *Queries) GetEiIgnsByGuild(ctx context.Context, guildID string) ([]interface{}, error)
- func (q *Queries) GetEiIgnsByMiscString(ctx context.Context, arg GetEiIgnsByMiscStringParams) ([]interface{}, error)
- func (q *Queries) GetGuildMembers(ctx context.Context, guildID string) ([]string, error)
- func (q *Queries) GetIdsByMiscString(ctx context.Context, arg GetIdsByMiscStringParams) ([]string, error)
- func (q *Queries) GetLatestLeaderboardSnapDate(ctx context.Context, lbType string) (string, error)
- func (q *Queries) GetLeaderboardExclusionsForUser(ctx context.Context, userID string) ([]GetLeaderboardExclusionsForUserRow, error)
- func (q *Queries) GetLeaderboardForSnapDate(ctx context.Context, arg GetLeaderboardForSnapDateParams) ([]GetLeaderboardForSnapDateRow, error)
- func (q *Queries) GetLeaderboardOptInUsers(ctx context.Context) ([]string, error)
- func (q *Queries) GetLeaderboardOptInsForGuild(ctx context.Context, guildID string) ([]GetLeaderboardOptInsForGuildRow, error)
- func (q *Queries) GetLeaderboardOptInsForUser(ctx context.Context, userID string) ([]GetLeaderboardOptInsForUserRow, error)
- func (q *Queries) GetLeaderboardSnapDates(ctx context.Context, lbType string) ([]string, error)
- func (q *Queries) GetLeaderboardStatForPlayer(ctx context.Context, arg GetLeaderboardStatForPlayerParams) (GetLeaderboardStatForPlayerRow, error)
- func (q *Queries) GetLegacyFarmerstate(ctx context.Context, id string) (FarmerState, error)
- func (q *Queries) GetStatsForPlayer(ctx context.Context, player string) ([]LeaderboardStat, error)
- func (q *Queries) GetStatsForPlayerInGuild(ctx context.Context, arg GetStatsForPlayerInGuildParams) ([]LeaderboardStat, error)
- func (q *Queries) GetSuspectMissions(ctx context.Context, userID string) ([]SuspectMission, error)
- func (q *Queries) GetTimers(ctx context.Context) ([]Timer, error)
- func (q *Queries) GetTimersForUser(ctx context.Context, userID string) ([]Timer, error)
- func (q *Queries) GetUserGuilds(ctx context.Context, userID string) ([]string, error)
- func (q *Queries) GetUserIdFromEiIgn(ctx context.Context, value sql.NullString) (string, error)
- func (q *Queries) GetWatchesForUser(ctx context.Context, userID string) ([]Watch, error)
- func (q *Queries) InsertLegacyFarmerstate(ctx context.Context, arg InsertLegacyFarmerstateParams) (FarmerState, error)
- func (q *Queries) InsertSuspectMission(ctx context.Context, arg InsertSuspectMissionParams) error
- func (q *Queries) InsertTimer(ctx context.Context, arg InsertTimerParams) error
- func (q *Queries) InsertWatch(ctx context.Context, arg InsertWatchParams) error
- func (q *Queries) PruneOlderLeaderboardStatsForPlayer(ctx context.Context, arg PruneOlderLeaderboardStatsForPlayerParams) error
- func (q *Queries) RemoveGuildMembership(ctx context.Context, arg RemoveGuildMembershipParams) error
- func (q *Queries) UpdateLegacyFarmerstate(ctx context.Context, arg UpdateLegacyFarmerstateParams) (int64, error)
- func (q *Queries) UpdateTimerMsg(ctx context.Context, arg UpdateTimerMsgParams) error
- func (q *Queries) UpdateTimerState(ctx context.Context, arg UpdateTimerStateParams) error
- func (q *Queries) UpsertCustomBanner(ctx context.Context, arg UpsertCustomBannerParams) error
- func (q *Queries) UpsertLeaderboardExclusion(ctx context.Context, arg UpsertLeaderboardExclusionParams) error
- func (q *Queries) UpsertLeaderboardOptIn(ctx context.Context, arg UpsertLeaderboardOptInParams) error
- func (q *Queries) UpsertLeaderboardStat(ctx context.Context, arg UpsertLeaderboardStatParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type RemoveGuildMembershipParams
- type SuspectMission
- type Timer
- type UpdateLegacyFarmerstateParams
- type UpdateTimerMsgParams
- type UpdateTimerStateParams
- type UpsertCustomBannerParams
- type UpsertLeaderboardExclusionParams
- type UpsertLeaderboardOptInParams
- type UpsertLeaderboardStatParams
- type UserPrivacyData
- type Watch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGuildMembership ¶
AddGuildMembership adds a user to a guild. Returns true if added, false if already a member.
func AddRecentCoopID ¶
AddRecentCoopID adds a coop ID to the recent list (max 5)
func AddTimer ¶
func AddTimer(id, userID, channelID, msgID string, reminder time.Time, message string, duration int64, origChannelID, origMsgID string, active bool)
AddTimer inserts a new timer into the database.
func AddWatch ¶
func AddWatch(userID, watchType, targetID string)
AddWatch inserts a new watch into the database.
func DeleteAllLeaderboardExclusionsForUserInGuild ¶
DeleteAllLeaderboardExclusionsForUserInGuild removes all exclusions for a user in a specific guild.
func DeleteAllLeaderboardOptInsForUserInGuild ¶
DeleteAllLeaderboardOptInsForUserInGuild removes all opt-ins for a user in a specific guild.
func DeleteAllLeaderboardStatsForPlayer ¶
DeleteAllLeaderboardStatsForPlayer removes every leaderboard stat for a player globally.
func DeleteAllLeaderboardStatsForPlayerInGuild ¶
DeleteAllLeaderboardStatsForPlayerInGuild is a no-op since leaderboard_stats is now global.
func DeleteFarmer ¶
func DeleteFarmer(userID string)
DeleteFarmer deletes a Farmer from the map and SQLite database tables
func DeleteInactiveTimers ¶
func DeleteInactiveTimers()
DeleteInactiveTimers removes all inactive timers from the database.
func DeleteLeaderboardExclusion ¶
DeleteLeaderboardExclusion removes a specific leaderboard exclusion record.
func DeleteLeaderboardOptIn ¶
DeleteLeaderboardOptIn removes a specific leaderboard opt-in record.
func DeleteLeaderboardStatsForPlayer ¶
DeleteLeaderboardStatsForPlayer removes snapshots for a specific player and type.
func DeleteTimer ¶
func DeleteTimer(id string)
DeleteTimer removes a timer from the database by its ID.
func DeleteUserWatches ¶
func DeleteUserWatches(userID string)
DeleteUserWatches deletes all watches for a given user.
func DeleteWatch ¶
func DeleteWatch(userID, watchType, targetID string)
DeleteWatch deletes a specific watch.
func FarmerExists ¶
FarmerExists returns true if a record for the given userID exists in farmer_state.
func FlushPendingSaves ¶
func FlushPendingSaves()
FlushPendingSaves forces an immediate write of all pending database updates.
func GetAltControllerByMiscString ¶
GetAltControllerByMiscString returns all IDs for farmers where MiscSettingsString[key] == value.
func GetDiscordUserIDFromEggIncName ¶
GetDiscordUserIDFromEggIncName retrieves the Discord user ID based on the provided eggincname. It also checks if the account is an alternate and returns the parent's Discord ID if so.
func GetDiscordUserIDFromEiIgn ¶
GetDiscordUserIDFromEiIgn retrieves the Discord user ID based on the provided ei_ign. It also checks if the account is an alternate and returns the parent's Discord ID if so.
func GetDiscordUserIDFromEiIgnExact ¶
GetDiscordUserIDFromEiIgnExact retrieves the Discord user ID based on the provided ei_ign without collapsing alternate accounts back to their controller.
func GetEggIncName ¶
GetEggIncName returns a Farmer Egg Inc name
func GetEiIgnsByGuild ¶
GetEiIgnsByGuild returns all ei_ign values for farmers who are members of the given guild.
func GetEiIgnsByMiscString ¶
GetEiIgnsByMiscString returns all ei_ign values for farmers where MiscSettingsString[key] == value.
func GetGuildMembers ¶
GetGuildMembers returns all user IDs that are members of the given guild.
func GetLastSeen ¶
GetLastSeen returns the last time a farmer was added to a contract
func GetLatestLeaderboardSnapDate ¶
GetLatestLeaderboardSnapDate returns the most recent snap_date for a lb_type.
func GetLaunchHistory ¶
GetLaunchHistory returns a Farmer Launch History
func GetLeaderboardOptInUsers ¶
GetLeaderboardOptInUsers returns all Discord user IDs who have at least one opt-in in any guild.
func GetLeaderboardSnapDates ¶
GetLeaderboardSnapDates returns all distinct snap_dates for a lb_type, newest first.
func GetMiscSettingFlag ¶
GetMiscSettingFlag returns a Farmer sticky setting
func GetMiscSettingString ¶
GetMiscSettingString returns a Farmer sticky setting
func GetMissionShipPrimary ¶
GetMissionShipPrimary returns a Farmer Mission Ship Primary
func GetMissionShipSecondary ¶
GetMissionShipSecondary returns a Farmer Mission Ship Secondary
func GetRecentCoopIDs ¶
GetRecentCoopIDs returns the list of recently used coop IDs
func GetSlashPrivacyCommand ¶
func GetSlashPrivacyCommand(cmd string) *discordgo.ApplicationCommand
GetSlashPrivacyCommand creates a new slash command for setting Egg, Inc name
func GetUserGuilds ¶
GetUserGuilds returns all guild IDs the user belongs to.
func HandlePrivacyCommand ¶
func HandlePrivacyCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandlePrivacyCommand will handle the /privacy command
func HandleSetEggIncName ¶
func HandleSetEggIncName(s *discordgo.Session, i *discordgo.InteractionCreate, isCoordinator func(*discordgo.Session, string) bool)
HandleSetEggIncName handles the /seteggincname command
func InsertSuspectMission ¶
func InsertSuspectMission(arg InsertSuspectMissionParams) error
InsertSuspectMission records a suspect mission anomaly to the database.
func PruneOlderLeaderboardStatsForPlayer ¶
PruneOlderLeaderboardStatsForPlayer removes older leaderboard stats for a specific player and type.
func RemoveCustomBanner ¶
RemoveCustomBanner deletes a user's custom banner from the database.
func RemoveGuildMembership ¶
func RemoveGuildMembership(userID, guildID string)
RemoveGuildMembership removes a user from a guild.
func SetCustomBanner ¶
SetCustomBanner saves a user's custom banner PNG bytes into the database.
func SetEggIncName ¶
SetEggIncName sets a Farmer Egg Inc name
func SetLastSeen ¶
func SetLastSeen(userID string)
SetLastSeen updates the timestamp of the last time a farmer was added to a contract
func SetLaunchHistory ¶
SetLaunchHistory sets a Farmer Launch History
func SetMiscSettingFlag ¶
SetMiscSettingFlag sets a key-value sticky setting
func SetMiscSettingString ¶
SetMiscSettingString sets a key-value sticky setting
func SetMissionShipPrimary ¶
SetMissionShipPrimary sets a Farmer Mission Ship Primary
func SetMissionShipSecondary ¶
SetMissionShipSecondary sets a Farmer Mission Ship Secondary
func SetUltra ¶
func SetUltra(userID string)
SetUltra sets a player to have joined an ultra contract
func SlashSetEggIncNameCommand ¶
func SlashSetEggIncNameCommand(cmd string) *discordgo.ApplicationCommand
SlashSetEggIncNameCommand creates a new slash command for setting Egg, Inc name
func SyncCustomBanner ¶
SyncCustomBanner checks if a custom banner exists in the database and is newer than the file on disk. If it is, it writes the image data from the database to the specified path.
func UpdateTimerMsg ¶
func UpdateTimerMsg(id, channelID, msgID string)
UpdateTimerMsg updates the channel and message ID of a timer in the database.
func UpdateTimerState ¶
UpdateTimerState updates the active state of a timer in the database.
func UpsertLeaderboardExclusion ¶
UpsertLeaderboardExclusion adds a leaderboard exclusion record for a user in a guild.
func UpsertLeaderboardOptIn ¶
UpsertLeaderboardOptIn adds a leaderboard opt-in record for a user in a guild.
func UpsertLeaderboardStat ¶
func UpsertLeaderboardStat(lbType, player, gameName, snapDate string, value float64, details sql.NullString) error
UpsertLeaderboardStat saves one leaderboard snapshot row (upsert on primary key).
Types ¶
type CustomBanner ¶
type DeleteWatchParams ¶
type Farmer ¶
type Farmer struct {
UserID string // Discord User ID
EggIncName string // User's Egg Inc name
Ping bool // True/False
Tokens int // Number of tokens this user wants
LaunchChain bool // Launch History chain option
MissionShipPrimary int // Launch Helper Ship Selection - Primary
MissionShipSecondary int // Launch Helper Ship Selection - Secondary
UltraContract time.Time // Date last Ultra contract was detected
MiscSettingsFlag map[string]bool
MiscSettingsString map[string]string
Links []Link // Array of Links
LastUpdated time.Time
LastSeen time.Time // Last time farmer was added to a contract
DataPrivacy bool // User data privacy setting
}
Farmer struct to store user data
type FarmerGuildMembership ¶
type FarmerState ¶
type FarmerState struct {
ID string
Key string
Value sql.NullString
}
type GetCustomBannerParams ¶
type GetCustomBannerRow ¶
type GetEiIgnsByMiscStringParams ¶
type GetEiIgnsByMiscStringParams struct {
Column1 sql.NullString
Value sql.NullString
}
type GetIdsByMiscStringParams ¶
type GetIdsByMiscStringParams struct {
Column1 sql.NullString
Value sql.NullString
}
type GetLeaderboardExclusionsForUserRow ¶
func GetLeaderboardExclusionsForUser ¶
func GetLeaderboardExclusionsForUser(userID string) ([]GetLeaderboardExclusionsForUserRow, error)
GetLeaderboardExclusionsForUser returns all (guild_id, lb_type) exclusion pairs for a given user.
type GetLeaderboardForSnapDateRow ¶
type GetLeaderboardForSnapDateRow struct {
Player string
GameName string
Value float64
Details sql.NullString
}
func GetLeaderboardForSnapDate ¶
func GetLeaderboardForSnapDate(lbType, guildID, snapDate string) ([]GetLeaderboardForSnapDateRow, error)
GetLeaderboardForSnapDate returns all rows for a lb_type, guild_id and snap_date, ordered by value DESC.
type GetLeaderboardOptInsForGuildRow ¶
func GetLeaderboardOptInsForGuild ¶
func GetLeaderboardOptInsForGuild(guildID string) ([]GetLeaderboardOptInsForGuildRow, error)
GetLeaderboardOptInsForGuild returns all (user_id, lb_type) pairs for a given guild.
type GetLeaderboardOptInsForUserRow ¶
func GetLeaderboardOptInsForUser ¶
func GetLeaderboardOptInsForUser(userID string) ([]GetLeaderboardOptInsForUserRow, error)
GetLeaderboardOptInsForUser returns all (guild_id, lb_type) pairs for a given user.
type GetLeaderboardStatForPlayerRow ¶
type GetLeaderboardStatForPlayerRow struct {
Player string
GameName string
SnapDate string
Value float64
Details sql.NullString
}
func GetLeaderboardStatForPlayer ¶
func GetLeaderboardStatForPlayer(lbType, player string) (GetLeaderboardStatForPlayerRow, error)
GetLeaderboardStatForPlayer returns the most recent stat for a player + lb_type.
type InsertLegacyFarmerstateParams ¶
type InsertLegacyFarmerstateParams struct {
ID string
Value sql.NullString
}
type InsertTimerParams ¶
type InsertWatchParams ¶
type LeaderboardExclusion ¶
type LeaderboardOptin ¶
type LeaderboardStat ¶
type LeaderboardStat struct {
LbType string
Player string
GameName string
SnapDate string
Value float64
Details sql.NullString
}
func GetStatsForPlayer ¶
func GetStatsForPlayer(player string) ([]LeaderboardStat, error)
GetStatsForPlayer returns all leaderboard stats for a specific player across all types.
func GetStatsForPlayerInGuild ¶
func GetStatsForPlayerInGuild(player, guildID string) ([]LeaderboardStat, error)
GetStatsForPlayerInGuild returns all leaderboard stats for a player in a specific guild.
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddGuildMembership ¶
func (*Queries) ClearExtraLegacyRecords ¶
func (*Queries) DeleteAllLeaderboardExclusionsForUserInGuild ¶
func (q *Queries) DeleteAllLeaderboardExclusionsForUserInGuild(ctx context.Context, arg DeleteAllLeaderboardExclusionsForUserInGuildParams) error
func (*Queries) DeleteAllLeaderboardOptInsForUserInGuild ¶
func (q *Queries) DeleteAllLeaderboardOptInsForUserInGuild(ctx context.Context, arg DeleteAllLeaderboardOptInsForUserInGuildParams) error
func (*Queries) DeleteAllLeaderboardStatsForPlayerInGuild ¶
No-op since leaderboard_stats is now global.
func (*Queries) DeleteCustomBanner ¶
func (q *Queries) DeleteCustomBanner(ctx context.Context, arg DeleteCustomBannerParams) error
func (*Queries) DeleteFarmerLegacyRecords ¶
func (*Queries) DeleteFarmerRecord ¶
func (*Queries) DeleteInactiveTimers ¶
func (*Queries) DeleteLeaderboardExclusion ¶
func (q *Queries) DeleteLeaderboardExclusion(ctx context.Context, arg DeleteLeaderboardExclusionParams) error
func (*Queries) DeleteLeaderboardOptIn ¶
func (q *Queries) DeleteLeaderboardOptIn(ctx context.Context, arg DeleteLeaderboardOptInParams) error
func (*Queries) DeleteLeaderboardStatsForPlayer ¶
func (q *Queries) DeleteLeaderboardStatsForPlayer(ctx context.Context, arg DeleteLeaderboardStatsForPlayerParams) error
func (*Queries) DeleteLegacyFarmerstate ¶
func (*Queries) DeleteUserCustomBanners ¶
func (*Queries) DeleteUserGuildMemberships ¶
func (*Queries) DeleteUserLeaderboardExclusions ¶
func (*Queries) DeleteUserLeaderboardOptIns ¶
func (*Queries) DeleteUserLeaderboardStats ¶
func (*Queries) DeleteUserSuspectMissions ¶
func (*Queries) DeleteUserTimers ¶
func (*Queries) DeleteUserWatches ¶
func (*Queries) DeleteWatch ¶
func (q *Queries) DeleteWatch(ctx context.Context, arg DeleteWatchParams) error
func (*Queries) GetAllLegacyFarmerstate ¶
func (q *Queries) GetAllLegacyFarmerstate(ctx context.Context) ([]FarmerState, error)
func (*Queries) GetAllWatches ¶
func (*Queries) GetCustomBanner ¶
func (q *Queries) GetCustomBanner(ctx context.Context, arg GetCustomBannerParams) (GetCustomBannerRow, error)
func (*Queries) GetCustomBannersForUser ¶
func (*Queries) GetEiIgnsByGuild ¶
func (*Queries) GetEiIgnsByMiscString ¶
func (q *Queries) GetEiIgnsByMiscString(ctx context.Context, arg GetEiIgnsByMiscStringParams) ([]interface{}, error)
func (*Queries) GetGuildMembers ¶
func (*Queries) GetIdsByMiscString ¶
func (*Queries) GetLatestLeaderboardSnapDate ¶
Returns the most recent snap_date recorded for a given lb_type.
func (*Queries) GetLeaderboardExclusionsForUser ¶
func (q *Queries) GetLeaderboardExclusionsForUser(ctx context.Context, userID string) ([]GetLeaderboardExclusionsForUserRow, error)
Returns all (guild_id, lb_type) exclusion pairs for a given user.
func (*Queries) GetLeaderboardForSnapDate ¶
func (q *Queries) GetLeaderboardForSnapDate(ctx context.Context, arg GetLeaderboardForSnapDateParams) ([]GetLeaderboardForSnapDateRow, error)
Returns all rows for a given lb_type, guild_id, and snap_date, ordered by value descending.
func (*Queries) GetLeaderboardOptInUsers ¶
Returns all Discord user IDs who have at least one opt-in in any guild.
func (*Queries) GetLeaderboardOptInsForGuild ¶
func (q *Queries) GetLeaderboardOptInsForGuild(ctx context.Context, guildID string) ([]GetLeaderboardOptInsForGuildRow, error)
Returns all (user_id, lb_type) pairs for a given guild.
func (*Queries) GetLeaderboardOptInsForUser ¶
func (q *Queries) GetLeaderboardOptInsForUser(ctx context.Context, userID string) ([]GetLeaderboardOptInsForUserRow, error)
Returns all (guild_id, lb_type) pairs for a given user.
func (*Queries) GetLeaderboardSnapDates ¶
Returns all distinct snap_dates for a given lb_type, newest first.
func (*Queries) GetLeaderboardStatForPlayer ¶
func (q *Queries) GetLeaderboardStatForPlayer(ctx context.Context, arg GetLeaderboardStatForPlayerParams) (GetLeaderboardStatForPlayerRow, error)
Returns the most recent stat row for a player + lb_type.
func (*Queries) GetLegacyFarmerstate ¶
func (*Queries) GetStatsForPlayer ¶
Returns all leaderboard stats for a specific player across all types, newest first.
func (*Queries) GetStatsForPlayerInGuild ¶
func (q *Queries) GetStatsForPlayerInGuild(ctx context.Context, arg GetStatsForPlayerInGuildParams) ([]LeaderboardStat, error)
Returns all leaderboard stats for a specific player in a specific guild.
func (*Queries) GetSuspectMissions ¶
func (*Queries) GetTimersForUser ¶
func (*Queries) GetUserGuilds ¶
func (*Queries) GetUserIdFromEiIgn ¶
func (*Queries) GetWatchesForUser ¶
func (*Queries) InsertLegacyFarmerstate ¶
func (q *Queries) InsertLegacyFarmerstate(ctx context.Context, arg InsertLegacyFarmerstateParams) (FarmerState, error)
func (*Queries) InsertSuspectMission ¶
func (q *Queries) InsertSuspectMission(ctx context.Context, arg InsertSuspectMissionParams) error
func (*Queries) InsertTimer ¶
func (q *Queries) InsertTimer(ctx context.Context, arg InsertTimerParams) error
func (*Queries) InsertWatch ¶
func (q *Queries) InsertWatch(ctx context.Context, arg InsertWatchParams) error
func (*Queries) PruneOlderLeaderboardStatsForPlayer ¶
func (q *Queries) PruneOlderLeaderboardStatsForPlayer(ctx context.Context, arg PruneOlderLeaderboardStatsForPlayerParams) error
Deletes older leaderboard stats for a player if RetainRecentOnly is true.
func (*Queries) RemoveGuildMembership ¶
func (q *Queries) RemoveGuildMembership(ctx context.Context, arg RemoveGuildMembershipParams) error
func (*Queries) UpdateLegacyFarmerstate ¶
func (*Queries) UpdateTimerMsg ¶
func (q *Queries) UpdateTimerMsg(ctx context.Context, arg UpdateTimerMsgParams) error
func (*Queries) UpdateTimerState ¶
func (q *Queries) UpdateTimerState(ctx context.Context, arg UpdateTimerStateParams) error
func (*Queries) UpsertCustomBanner ¶
func (q *Queries) UpsertCustomBanner(ctx context.Context, arg UpsertCustomBannerParams) error
func (*Queries) UpsertLeaderboardExclusion ¶
func (q *Queries) UpsertLeaderboardExclusion(ctx context.Context, arg UpsertLeaderboardExclusionParams) error
func (*Queries) UpsertLeaderboardOptIn ¶
func (q *Queries) UpsertLeaderboardOptIn(ctx context.Context, arg UpsertLeaderboardOptInParams) error
func (*Queries) UpsertLeaderboardStat ¶
func (q *Queries) UpsertLeaderboardStat(ctx context.Context, arg UpsertLeaderboardStatParams) error
Inserts or replaces a leaderboard snapshot for (lb_type, player, snap_date).
type SuspectMission ¶
type Timer ¶
type UpdateLegacyFarmerstateParams ¶
type UpdateLegacyFarmerstateParams struct {
Value sql.NullString
ID string
}
type UpdateTimerMsgParams ¶
type UpdateTimerStateParams ¶
type UserPrivacyData ¶
type UserPrivacyData struct {
FarmerState *Farmer `json:"farmer_state,omitempty"`
GuildMemberships []string `json:"guild_memberships,omitempty"`
CustomBanners []CustomBanner `json:"custom_banners,omitempty"`
Timers []Timer `json:"timers,omitempty"`
SuspectMissions []SuspectMission `json:"suspect_missions,omitempty"`
LeaderboardStats []LeaderboardStat `json:"leaderboard_stats,omitempty"`
LeaderboardOptins []GetLeaderboardOptInsForUserRow `json:"leaderboard_optins,omitempty"`
LeaderboardExclusions []GetLeaderboardExclusionsForUserRow `json:"leaderboard_exclusions,omitempty"`
Watches []Watch `json:"watches,omitempty"`
}
UserPrivacyData contains all information we store about a user
func GetFullUserData ¶
func GetFullUserData(userID string) *UserPrivacyData
type Watch ¶
func GetAllWatches ¶
func GetAllWatches() []Watch
GetAllWatches returns all watches in the database.
func GetWatchesForUser ¶
GetWatchesForUser returns all watches for a given user.