Documentation
¶
Index ¶
- Constants
- Variables
- func AddBoostTokens(client dc.Client, e dc.InteractionEvent, setCountWant int, countWantAdjust int) (int, int, error)
- func AddBoostTokensInteraction(client dc.Client, e *dc.ComponentEvent, setCountWant int, countWantAdjust int)
- func AddBoostersToThread(client dc.Client, contract *Contract)
- func AddContractMember(client dc.Client, guildID string, channelID string, operator string, ...) error
- func AddThreadMemberDelayed(client dc.Client, contractHash string, channelID, userID string, ...)
- func AdminContractReport(client dc.Client, e *dc.ComponentEvent, contract *Contract, ...)
- func ArchiveContracts(client dc.Client)
- func AutoUpdateThreadName(client dc.Client, contract *Contract)
- func Boosting(client dc.Client, guildID string, channelID string) error
- func BuildBoostOrderPreviewMessage(contract *Contract) (dc.Message, error)
- func BuildCustomOrderMessage(contract *Contract, session *customOrderSession, status string) dc.Message
- func BuildDefineCustomOrderMessage(contract *Contract, tmpl CustomBoostOrderTemplate, sessionUUID string, ...) dc.Message
- func CalculateBoostTime(te int, tokens int, tokenRate float64, sixTokBoostTime float64, ...) float64
- func CalculateIHRRateFromBackup(backup *ei.Backup, userID string) (float64, string)
- func CalculateIHRRateFromDB(userID string) (float64, string)
- func ChangeBoostOrder(client dc.Client, guildID string, channelID string, userID string, ...) (string, error)
- func ChangeContractIDs(client dc.Client, guildID string, channelID string, userID string, ...) (int, error)
- func ChangeCurrentBooster(client dc.Client, guildID string, channelID string, userID string, ...) error
- func CheckAndNotifyAdminExitRestart(client dc.Client)
- func CheckAndPublishAMQPBoosterChange(contract *Contract, userID string, nick string, event string)
- func CheckAndPublishAMQPContractUpdate(contract *Contract)
- func CheckCoopStatusPermission(e *dc.CommandEvent, coopStatusFixEnabled bool) bool
- func CheckLeaderboardPermission(e dc.InteractionEvent) bool
- func ContractReport(e dc.InteractionEvent, options dc.OptionValues, eiID string, okayToSave bool) error
- func CreatePredictedContract() []ei.EggIncContract
- func DeleteContract(client dc.Client, guildID string, channelID string) (string, error)
- func DeleteGlobalCustomOrder(name string) bool
- func DeleteMissingContract(contractID string) error
- func DeleteUserCustomOrder(userID string, name string) bool
- func DownloadCoopStatusStones(channelID string, contractID string, coopID string, details bool, ...) (string, string, []dc.EmbedField)
- func DrawBoostList(contract *Contract) []dc.LayoutComponent
- func DrawBoostListCustom(contract *Contract, compact bool) []dc.LayoutComponent
- func DrawBoostListUncompacted(contract *Contract) []dc.LayoutComponent
- func DrawPureBoostList(contract *Contract) []dc.LayoutComponent
- func EncodeSandboxData(cxpToggle bool, targetEgg float64, tokenTimer string, ...) (string, error)
- func FindEggEmoji(eggOrig string) string
- func FinishContract(client dc.Client, contract *Contract)
- func FmtActiveModifier(c *ei.EggIncContract) (string, int)
- func FmtNumberSingleUnit(v float64, srSandboxOrdering bool) (string, int)
- func GenerateContractSandboxData(contract *Contract, players []SandboxPlayer) (string, error)
- func GenerateContractSandboxDataWithOptions(contract *Contract, players []SandboxPlayer, options *ContractSandboxOptions) (string, error)
- func GenerateContractSandboxURL(contract *Contract, players []SandboxPlayer) (string, error)
- func GenerateContractSandboxURLWithOptions(contract *Contract, players []SandboxPlayer, options *ContractSandboxOptions) (string, error)
- func GetAttributions() *dc.Embed
- func GetAvailabilityComponents(client dc.Client, contract *Contract, userID string) []dc.LayoutComponent
- func GetBoostMultiplierForTokens(tokens float64) float64
- func GetContractArchivesForNames(names []string, cxpVersion string, forceRefresh bool, okayToSave bool) (archives [][]*ei.LocalContract, fetched []bool, missing []string, err error)
- func GetContractBoostOrderLines(contract *Contract) []string
- func GetContractCustomOrderName(contract *Contract) string
- func GetContractDescription(channelID string) string
- func GetContractEstimateString(contractID string, includeLeggySet bool, showGG bool, teOverride ...float64) string
- func GetCustomBoostOrderDoc() []byte
- func GetEggStandardTime(t time.Time) time.Time
- func GetHelp(client dc.Client, guildID string, channelID string, userID string) *dc.Embed
- func GetPlayerBoostConfig(te float64, artifactMult ...float64) (tokens float64, multiplier float64)
- func GetPredCommand(cmd string) *dc.Command
- func GetPredictedContractTimes(contractID string) (time.Time, time.Time, time.Time)
- func GetPredictedTimes() (map[string]time.Time, map[string]time.Time)
- func GetPredictionBrackets() (wed, friPE, friUltra []ei.EggIncContract)
- func GetPredictionsCommand(cmd string) *dc.Command
- func GetRoleNamesForContract(contractID string) ([]string, error)
- func GetSignupComponents(contract *Contract) (string, []dc.LayoutComponent)
- func GetSlashAdminContractsListCommand(cmd string) *dc.Command
- func GetSlashAvailabilityCommand(cmd string) *dc.Command
- func GetSlashBoostCommand(cmd string) *dc.Command
- func GetSlashBoostOrderCommand(cmd string) *dc.Command
- func GetSlashBoostOrderHelpersCommand(cmd string) *dc.Command
- func GetSlashBumpCRCommand(cmd string) *dc.Command
- func GetSlashBumpCommand(cmd string) *dc.Command
- func GetSlashCalcContractTval(cmd string) *dc.Command
- func GetSlashChangeCommand(cmd string) *dc.Command
- func GetSlashChangeOneBoosterCommand(cmd string) *dc.Command
- func GetSlashChangePlannedStartCommand(cmd string) *dc.Command
- func GetSlashChangeSpeedRunSinkCommand(cmd string) *dc.Command
- func GetSlashContractCommand(cmd string) *dc.Command
- func GetSlashContractReportCommand(cmd string) *dc.Command
- func GetSlashContractSettingsCommand(cmd string) *dc.Command
- func GetSlashCoopETACommand(cmd string) *dc.Command
- func GetSlashCoopTval(cmd string) *dc.Command
- func GetSlashCsEstimates(cmd string) *dc.Command
- func GetSlashCustomBoostOrderCommand(cmd string) *dc.Command
- func GetSlashDefineCustomOrderCommand(cmd string) *dc.Command
- func GetSlashEstimateTime(cmd string) *dc.Command
- func GetSlashHelpCommand(cmd string) *dc.Command
- func GetSlashJoinContractCommand(cmd string) *dc.Command
- func GetSlashLeaderboard(cmd string) *dc.Command
- func GetSlashLinkAlternateCommand(cmd string) *dc.Command
- func GetSlashLobbyCommand(cmd string) *dc.Command
- func GetSlashPruneCommand(cmd string) *dc.Command
- func GetSlashRegisterAltCommand(cmd string) *dc.Command
- func GetSlashRegisterCommand(cmd string) *dc.Command
- func GetSlashRenameThread(cmd string) *dc.Command
- func GetSlashRerunEvalCommand(cmd string) *dc.Command
- func GetSlashScoreExplorerCommand(cmd string) *dc.Command
- func GetSlashSkipCommand(cmd string) *dc.Command
- func GetSlashSpeedrunCommand(cmd string) *dc.Command
- func GetSlashStones(cmd string) *dc.Command
- func GetSlashTeamworkEval(cmd string) *dc.Command
- func GetSlashToggleContractPingsCommand(cmd string) *dc.Command
- func GetSlashTokenEditCommand(cmd string) *dc.Command
- func GetSlashUnboostCommand(cmd string) *dc.Command
- func GetSlashUpdateCommand(cmd string) *dc.Command
- func GetSlashUploadBannerCommand(cmd string) *dc.Command
- func GetSlashVolunteerSink(cmd string) *dc.Command
- func GetSlashVoluntellSink(cmd string) *dc.Command
- func GetTargetBuffTimeValue(cxpVersion int, durationSec float64) float64
- func GetTargetTval(cxpVersion int, contractMinutes float64, minutesPerToken float64) float64
- func GetThematicComplaintsForContract(contractID string) ([]string, error)
- func GetWish(guildID string, channelID string) string
- func HandleActiveContractsPage(client dc.Client, e *dc.ComponentEvent)
- func HandleAdminContractList(client dc.Client, e *dc.CommandEvent)
- func HandleAdminContractListComponent(client dc.Client, e *dc.ComponentEvent)
- func HandleAdminCurrentContracts(client dc.Client, e *dc.CommandEvent)
- func HandleAdminExitButton(client dc.Client, e *dc.ComponentEvent)
- func HandleAdminExitCommand(client dc.Client, e *dc.CommandEvent)
- func HandleAdminGetContractData(e *dc.CommandEvent)
- func HandleAdminGuildStateAutoComplete(client dc.Client, e *dc.AutocompleteEvent)
- func HandleAdminGuildStateCommand(client dc.Client, e *dc.CommandEvent)
- func HandleAdminListRoles(client dc.Client, e *dc.CommandEvent)
- func HandleAdminMembers(client dc.Client, e *dc.CommandEvent)
- func HandleAdminStatusMessageAutoComplete(e *dc.AutocompleteEvent)
- func HandleAdminStatusMessageCommand(client dc.Client, e *dc.CommandEvent)
- func HandleAdminTasksAutocomplete(e *dc.AutocompleteEvent)
- func HandleAdminTasksCommand(client dc.Client, e *dc.CommandEvent)
- func HandleAllContractsAutoComplete(e *dc.AutocompleteEvent)
- func HandleAltsAutoComplete(e *dc.AutocompleteEvent)
- func HandleArtifactAltAutoComplete(e *dc.AutocompleteEvent)
- func HandleArtifactCommand(client dc.Client, e *dc.CommandEvent)
- func HandleArtifactReactions(client dc.Client, e *dc.ComponentEvent)
- func HandleAvailabilityCommand(client dc.Client, e *dc.CommandEvent)
- func HandleBoostCommand(client dc.Client, e *dc.CommandEvent)
- func HandleBoostOrderCommand(client dc.Client, e *dc.CommandEvent)
- func HandleBoostOrderHelpersCommand(client dc.Client, e *dc.CommandEvent)
- func HandleBoostOrderReactions(client dc.Client, e *dc.ComponentEvent)
- func HandleBumpCRCommand(client dc.Client, e *dc.CommandEvent)
- func HandleBumpCommand(client dc.Client, e *dc.CommandEvent)
- func HandleChangeCommand(client dc.Client, e *dc.CommandEvent)
- func HandleChangeOneBoosterCommand(client dc.Client, e *dc.CommandEvent)
- func HandleChangePlannedStartCommand(client dc.Client, e *dc.CommandEvent)
- func HandleChangeSpeedrunSinkCommand(client dc.Client, e *dc.CommandEvent)
- func HandleChartReactions(e *dc.ComponentEvent)
- func HandleContractAutoComplete(e *dc.AutocompleteEvent)
- func HandleContractCalcContractTvalCommand(e *dc.CommandEvent)
- func HandleContractCommand(client dc.Client, e *dc.CommandEvent)
- func HandleContractDelete(client dc.Client, e *dc.ComponentEvent)
- func HandleContractReactions(client dc.Client, e *dc.ComponentEvent)
- func HandleContractReport(e *dc.CommandEvent)
- func HandleContractSettingsCommand(client dc.Client, e *dc.CommandEvent)
- func HandleContractSettingsReactions(client dc.Client, e *dc.ComponentEvent)
- func HandleCoopAutoComplete(e *dc.AutocompleteEvent)
- func HandleCoopETACommand(e *dc.CommandEvent)
- func HandleCoopStatusPermissionButton(e *dc.ComponentEvent)
- func HandleCoopTvalCommand(client dc.Client, e *dc.CommandEvent)
- func HandleCsEstimateButtons(e *dc.ComponentEvent)
- func HandleCsEstimatesCommand(e *dc.CommandEvent)
- func HandleCustomBoostOrderAutoComplete(e *dc.AutocompleteEvent)
- func HandleCustomBoostOrderCommand(client dc.Client, e *dc.CommandEvent)
- func HandleCustomOrderModalSubmit(client dc.Client, e *dc.ModalEvent)
- func HandleCustomOrderReactions(client dc.Client, e *dc.ComponentEvent)
- func HandleDefineCustomOrderAutoComplete(e *dc.AutocompleteEvent)
- func HandleDefineCustomOrderCommand(client dc.Client, e *dc.CommandEvent)
- func HandleDefineCustomOrderModalSubmit(_ dc.Client, e *dc.ModalEvent)
- func HandleDefineCustomOrderReactions(client dc.Client, e *dc.ComponentEvent)
- func HandleEggIDModalSubmit(e *dc.ModalEvent)
- func HandleEstimateTimeCommand(e *dc.CommandEvent)
- func HandleHelpCommand(client dc.Client, e *dc.CommandEvent)
- func HandleJoinCommand(client dc.Client, e *dc.CommandEvent)
- func HandleLeaderboard(e *dc.CommandEvent)
- func HandleLeaderboardAutoComplete(e *dc.AutocompleteEvent)
- func HandleLeaderboardPage(e *dc.ComponentEvent)
- func HandleLeaderboardPermissionButton(e *dc.ComponentEvent)
- func HandleLinkAlternateAutoComplete(e *dc.AutocompleteEvent)
- func HandleLinkAlternateCommand(client dc.Client, e *dc.CommandEvent)
- func HandleLobbyButtons(client dc.Client, e *dc.ComponentEvent)
- func HandleLobbyCommand(e *dc.CommandEvent)
- func HandleMenuReactions(client dc.Client, e *dc.ComponentEvent)
- func HandlePredCommand(client dc.Client, e *dc.CommandEvent)
- func HandlePredPage(client dc.Client, e *dc.ComponentEvent)
- func HandlePredictionsCommand(client dc.Client, e *dc.CommandEvent)
- func HandlePredictionsPage(e *dc.ComponentEvent)
- func HandlePruneCommand(client dc.Client, e *dc.CommandEvent)
- func HandlePublishCustomOrderModalSubmit(_ dc.Client, e *dc.ModalEvent)
- func HandleRegister(e *dc.CommandEvent)
- func HandleRegisterAlt(e *dc.CommandEvent)
- func HandleRegisterAltAutocomplete(e *dc.AutocompleteEvent)
- func HandleRenameThreadCommand(client dc.Client, e *dc.CommandEvent)
- func HandleReplayEval(e *dc.CommandEvent)
- func HandleRerunEvalAutoComplete(e *dc.AutocompleteEvent)
- func HandleRerunEvalSeasonAutoComplete(e *dc.AutocompleteEvent)
- func HandleRestartContract(client dc.Client, e *dc.ComponentEvent)
- func HandleSaveCustomOrderModalSubmit(_ dc.Client, e *dc.ModalEvent)
- func HandleScoreExplorerCommand(e *dc.CommandEvent)
- func HandleScoreExplorerPage(e *dc.ComponentEvent)
- func HandleSignupBell(client dc.Client, e *dc.ComponentEvent)
- func HandleSignupFarmer(client dc.Client, e *dc.ComponentEvent)
- func HandleSignupLeave(client dc.Client, e *dc.ComponentEvent)
- func HandleSignupStart(client dc.Client, e *dc.ComponentEvent)
- func HandleSkipCommand(client dc.Client, e *dc.CommandEvent)
- func HandleSlashVolunteerSinkCommand(client dc.Client, e *dc.CommandEvent)
- func HandleSlashVoluntellSinkCommand(client dc.Client, e *dc.CommandEvent)
- func HandleSpeedrunCommand(client dc.Client, e *dc.CommandEvent)
- func HandleStonesCommand(client dc.Client, e *dc.CommandEvent)
- func HandleStonesPage(client dc.Client, e *dc.ComponentEvent)
- func HandleTeamworkEvalCommand(e *dc.CommandEvent)
- func HandleTeamworkPage(e *dc.ComponentEvent)
- func HandleThresholdModalSubmit(client dc.Client, e *dc.ModalEvent)
- func HandleToggleContractPingsCommand(client dc.Client, e *dc.CommandEvent)
- func HandleTokenEditAutoComplete(e *dc.AutocompleteEvent)
- func HandleTokenEditCommand(client dc.Client, e *dc.CommandEvent) string
- func HandleTokenEditInteraction(client dc.Client, e *dc.CommandEvent)
- func HandleUnboostCommand(client dc.Client, e *dc.CommandEvent)
- func HandleUpdateCommand(client dc.Client, e *dc.CommandEvent)
- func HandleUploadBannerCommand(client dc.Client, e *dc.CommandEvent)
- func IsRoleCreatedByBot(roleName string) bool
- func IsUserCreatorOfAnyContract(client dc.Client, userID string) bool
- func JoinContract(client dc.Client, guildID string, channelID string, userID string, bell bool) error
- func LoadContractData(filename string)
- func LoadEggscapeCoopIDs(filename string)
- func LoadMissingContracts() (map[string]int64, error)
- func LoadRoleNames() (map[string][]string, error)
- func LoadThematicComplaints() (map[string][]string, error)
- func MoveBooster(client dc.Client, guildID string, channelID string, userID string, ...) error
- func NormalizeTimeslotValues(selected []string, previous []string) []string
- func PopulateContractFromProto(contractProtoBuf *ei.Contract) ei.EggIncContract
- func PopulateThematicComplaintsForContractID(contractID string, complaints []string)
- func PrevContractScoresFromArchives(archives [][]*ei.LocalContract, fetched []bool, ...) (prev []float64, foundPrev []bool)
- func PublishAMQPBoostStatus(guildID string, url string, contractID string, coopID string, ...)
- func PublishAMQPBoosterChange(guildID string, url string, status AMQPBoosterChangeMessage)
- func PublishAMQPContractStart(guildID string, url string, status AMQPContractStartMessage)
- func PublishAMQPContractUpdate(guildID string, url string, status AMQPContractUpdateMessage)
- func PublishAMQPNonToken(guildID string, url string, contractID string, coopID string, ...)
- func PublishAMQPTokenLog(guildID string, url string, contractID string, coopID string, ...)
- func PublishGlobalCustomOrder(tmpl CustomBoostOrderTemplate)
- func ReactionAdd(client dc.Client, e *dc.ReactionEvent) string
- func ReactionRemove(_ dc.Client, _ *dc.ReactionEvent)
- func RedrawBoostList(client dc.Client, guildID string, channelID string) error
- func RefreshGuildContractsForBannerUpdate(client dc.Client, guildID string)
- func Register(e *dc.ModalEvent, encryptedID string, okayToSave bool)
- func RegisterAlt(e *dc.ModalEvent, targetAlt string, encryptedID string)
- func RegisterEggIDModalAction(action string, ...)
- func RemoveAddedReaction(client dc.Client, e *dc.ReactionEvent)
- func RemoveFarmerByMention(client dc.Client, guildID string, channelID string, operator string, ...) error
- func RenderCustomOrderTableImage(contract *Contract, lines []string) ([]byte, error)
- func RenderScoreTableANSI(rows []srRow, srmode bool, includeDiff bool) string
- func RenderScoreTableImage(rows []srRow, srmode bool, includeDiff bool) ([]byte, error)
- func RenderTableImage(cols []TableImageColumn, rows []TableImageRow) ([]byte, error)
- func ReplaceThematicComplaintsForContractID(contractID string, complaints []string)
- func RequestEggIncIDModal(e *dc.CommandEvent, action string, options dc.OptionValues)
- func RerunEval(e dc.InteractionEvent, options dc.OptionValues, eiID string, okayToSave bool)
- func SaveAllData()
- func SaveMissingContract(contractID string, timestamp int64) error
- func SaveRoleNames(data map[string][]string)
- func SaveThematicComplaints(data map[string][]string) error
- func SaveUserCustomOrder(userID string, tmpl CustomBoostOrderTemplate)
- func SendCustomBoostOrderModal(e *dc.ComponentEvent, contractHash string)
- func SendDefineCustomOrderModalFromCommand(e *dc.CommandEvent, contract *Contract, initial *CustomBoostOrderTemplate)
- func SendDefineCustomOrderModalFromComponent(e *dc.ComponentEvent, tmpl CustomBoostOrderTemplate, sessionUUID string)
- func SendPublishCustomOrderModal(e *dc.ComponentEvent, tmpl CustomBoostOrderTemplate, sessionUUID string)
- func SendSandboxDM(client dc.Client, contract *Contract, userID string) error
- func SendSaveCustomOrderModal(e *dc.ComponentEvent, tmpl CustomBoostOrderTemplate, sessionUUID string)
- func SendThresholdModal(e *dc.ComponentEvent, contractHash string)
- func SetCustomBoostOrderDoc(data []byte)
- func SetListMessageID(contract *Contract, channelID string, messageID string)
- func SetPeriodicalsRefresher(refresher PeriodicalsRefresherFunc)
- func SetReactionID(contract *Contract, channelID string, reactionID string)
- func SetStatusMessagesRefresher(refresher StatusMessagesRefresherFunc)
- func SetThematicComplaintsGenerator(gen ThematicComplaintsGeneratorFunc)
- func SetTokenComplaintsRefresher(refresher TokenComplaintsRefresherFunc)
- func SetWish(guildID string, channelID string, wish string) error
- func ShowCoopStatusPermissionDialog(e *dc.CommandEvent)
- func ShowLeaderboardPermissionDialog(e dc.InteractionEvent)
- func SkipBooster(client dc.Client, guildID string, channelID string, userID string) error
- func SlashAdminCurrentContracts(cmd string) *dc.Command
- func SlashAdminExitCommand(cmd string) *dc.Command
- func SlashAdminGetContractData(cmd string) *dc.Command
- func SlashAdminGuildStateCommand(cmd string) *dc.Command
- func SlashAdminListRoles(cmd string) *dc.Command
- func SlashAdminMembers(cmd string) *dc.Command
- func SlashAdminStatusMessageCommand(cmd string) *dc.Command
- func SlashAdminTasksCommand(cmd string) *dc.Command
- func SlashArtifactsCommand(cmd string) *dc.Command
- func StartContractBoosting(client dc.Client, guildID string, channelID string, userID string) error
- func SuggestCustomOrderName(lines []string) string
- func Unboost(client dc.Client, guildID string, channelID string, mention string) error
- func UpdateAllContractsEggInfo()
- func UpdateBannerURL(contract *Contract)
- func UpdateContractTime(contractID string, coopID string, startTime, endTime time.Time, ...)
- func UpdatePredictedSignupContracts(client dc.Client, liveContracts []ei.EggIncContract) int
- func UpdateThreadName(client dc.Client, contract *Contract)
- func UserBoost(client dc.Client, guildID string, channelID string, userID string) error
- func UserInContract(c *Contract, u string) bool
- type AMQPBoostStatusMessage
- type AMQPBoosterChangeMessage
- type AMQPClient
- type AMQPContractStartMessage
- type AMQPContractUpdateMessage
- type AMQPNonTokenMessage
- type AMQPTokenMessage
- type AdminExitNotice
- type ArtifactSet
- type BankerInfo
- type Bookmark
- type BoostResult
- type Booster
- type CompMap
- type Contract
- func CreateContract(client dc.Client, contractID string, coopID string, playStyle int, ...) (*Contract, error)
- func FindContract(channelID string) *Contract
- func FindContractByHash(hash string) *Contract
- func FindContractByIDs(channelID string, contractID string, coopID string) *Contract
- func FindContractByMessageID(channelID string, messageID string) *Contract
- type ContractAvailability
- type ContractComplaint
- type ContractDatum
- type ContractDurationEstimate
- type ContractRole
- type ContractSandboxOptions
- type ContractScore
- type CustomBoostOrderTemplate
- type CustomCriterionType
- type CustomOrderSession
- type DBTX
- type DefineOrderSession
- type DeliveryTimeValue
- type DynamicTokenData
- type ExternalContractBookmark
- type GetActiveContractsRow
- type GuildRole
- type InsertContractComplaintParams
- type InsertContractParams
- type InsertContractRoleParams
- type InsertMissingContractParams
- type LocationData
- type MissingContract
- type ParsedFarmer
- type PeriodicalsRefresherFunc
- type PlayerScoreParameters
- type PredictionInfo
- type Queries
- func (q *Queries) CountContractsByChannel(ctx context.Context, channelid string) (int64, error)
- func (q *Queries) DeleteAllContractComplaints(ctx context.Context) error
- func (q *Queries) DeleteAllContractRoles(ctx context.Context) error
- func (q *Queries) DeleteContractByChannel(ctx context.Context, channelid string) error
- func (q *Queries) DeleteContractComplaints(ctx context.Context, contractid string) error
- func (q *Queries) DeleteContractRoles(ctx context.Context, contractid string) error
- func (q *Queries) DeleteMissingContract(ctx context.Context, contractid string) error
- func (q *Queries) GetActiveContracts(ctx context.Context) ([]GetActiveContractsRow, error)
- func (q *Queries) GetContractByChannelID(ctx context.Context, channelid string) (ContractDatum, error)
- func (q *Queries) GetContractComplaints(ctx context.Context) ([]ContractComplaint, error)
- func (q *Queries) GetContractRoles(ctx context.Context) ([]ContractRole, error)
- func (q *Queries) GetMissingContracts(ctx context.Context) ([]MissingContract, error)
- func (q *Queries) InsertContract(ctx context.Context, arg InsertContractParams) error
- func (q *Queries) InsertContractComplaint(ctx context.Context, arg InsertContractComplaintParams) error
- func (q *Queries) InsertContractRole(ctx context.Context, arg InsertContractRoleParams) error
- func (q *Queries) InsertMissingContract(ctx context.Context, arg InsertMissingContractParams) error
- func (q *Queries) UpdateContract(ctx context.Context, arg UpdateContractParams) (int64, error)
- func (q *Queries) UpdateContractCoopID(ctx context.Context, arg UpdateContractCoopIDParams) error
- func (q *Queries) UpdateContractState(ctx context.Context, arg UpdateContractStateParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type SandboxPlayer
- type ScoreCalcParams
- type StatusMessagesRefresherFunc
- type TableImageCell
- type TableImageColumn
- type TableImageRow
- type TeamworkOutputData
- type ThematicComplaintsGeneratorFunc
- type TokenComplaintsRefresherFunc
- type TokenUnit
- type UpdateContractCoopIDParams
- type UpdateContractParams
- type UpdateContractStateParams
Constants ¶
const ( RolePriorityMain = 1 RolePriorityHelper = 2 )
const ( // CoopStatusPermissionKey is the key used to store the timestamp of when the user allowed CoopStatus permissions CoopStatusPermissionKey = "allow_coop_status" // CoopStatusPermissionSpanKey is the key used to store the selected permission duration (24h or 7d) CoopStatusPermissionSpanKey = "allow_coop_status_span" // CoopStatusPermission24h is the duration for 24 hours permission CoopStatusPermission24h = 24 * time.Hour // CoopStatusPermission7d is the duration for 7 days permission CoopStatusPermission7d = 7 * 24 * time.Hour )
const ( // LeaderboardPermissionKey is the key used to store the timestamp of when the user allowed leaderboard API permissions LeaderboardPermissionKey = "allow_leaderboard_api" // LeaderboardPermissionSpanKey holds the selected permission duration ("24h" or "forever") LeaderboardPermissionSpanKey = "allow_leaderboard_api_span" // LeaderboardPermission24h is the duration for 24 hours permission LeaderboardPermission24h = 24 * time.Hour )
const ( ContractOrderSignup = 0 // Signup order ContractOrderReverse = 1 // Reverse order ContractOrderRandom = 2 // Randomized when the contract starts. After 20 minutes the order changes to Sign-up. ContractOrderTimeBased = 4 // Time based order ContractOrderELR = 5 // ELR based order ContractOrderTVal = 6 // Token Value based order ContractOrderTokenAsk = 7 // Token Ask order, less tokens boosts earlier ContractOrderTE = 8 // Truth Egg based order ContractOrderTEFuzzy = 9 // Truth Egg + randomization ContractManualOrder = 10 // Manual order set by contract creator ContractOrderIHR = 11 // IHR based order ContractOrderIHRFuzzy = 12 // Fuzzy IHR based order ContractOrderCustom = 13 // Custom boost order using comparison language ContractStateSignup = 0 // Contract is in signup phase ContractStateFastrun = 1 // Contract in Boosting as fastrun ContractStateWaiting = 2 // Waiting for other(s) to join ContractStateCompleted = 3 // Contract is completed ContractStateArchive = 4 // Contract is ready to archive //ContractStateDeprecated = 5 // Deprecated ContractStateBanker = 6 // Contract is Boosting with Banker BoostStateUnboosted = 0 // Unboosted BoostStateTokenTime = 1 // TokenTime or turn to receive tokens BoostStateBoosted = 2 // Boosted BoostOrderTimeThreshold = 20 // minutes to switch from random or fair to signup // These are used for the /speedrun command SpeedrunStyleBanker = 0 SpeedrunStyleFastrun = 1 SinkBoostFollowOrder = -1 // Follow the order SinkBoostFirst = 0 // First position SinkBoostLast = 1 // Last position // These are an int64 flaglist to construct the style of the contract ContractFlagNone = 0x0000 ContractFlagCrt = 0x0001 ContractFlagSelfRuns = 0x0002 ContractFlag6Tokens = 0x0100 ContractFlag8Tokens = 0x0200 ContractFlagDynamicTokens = 0x0400 ContractFlag4Tokens = 0x0800 ContractFlagThresholdTokens = 0x1000 ContractFlagFastrun = 0x4000 ContractFlagBanker = 0x8000 ContractFlagAMQP = 0x20000 ContractStyleFastrun = ContractFlagFastrun ContractStyleFastrunBanker = ContractFlagBanker ContractPlaystyleUnset = 0 // Unset ContractPlaystyleChill = 1 // Chill ContractPlaystyleACOCooperative = 2 // ACO Cooperative ContractPlaystyleFastrun = 3 // Fastrun ContractPlaystyleLeaderboard = 4 // Leaderboard ContractPlaystyleGGRerun = 5 // GG Rerun )
Constnts for the contract
const ThreadRenameCooldown = 3 * time.Minute
ThreadRenameCooldown is the cooldown between Discord thread/channel renames (Discord limits PATCH /channels to 2 per 10m).
Variables ¶
var ( // Contracts is a map of contracts and is saved to disk Contracts map[string]*Contract // ContractsMutex is used to synchronize access to the Contracts map ContractsMutex sync.RWMutex )
var ( ErrNoChannelContract = errors.New("no contract found for channel") ErrEvaluationNotFound = errors.New("evaluation not found for contract") ErrCoopIDMissing = errors.New("coop id missing") ErrUnsupportedCXPVersion = errors.New("unsupported cxp version") ErrCoopStatusFetch = errors.New("coop status fetch failed") ErrCoopStatusResponse = errors.New("coop status error") ErrCoopNoGrade = errors.New("coop grade missing") ErrCoopNotFinished = errors.New("coop not finished") ErrContribProcess = errors.New("contributors processing failed") ErrInvalidContractID = errors.New("invalid contract id") ErrCoopGradeInvalid = errors.New("invalid coop grade index") ErrReportSendFailed = errors.New("report send failed") ErrContractDurationMismatch = errors.New("contract duration mismatch") )
ErrNoChannelContract is returned when no contract can be found for the specified channel. ErrEvaluationNotFound is returned when an expected evaluation for a contract cannot be found. ErrCoopIDMissing indicates that a required coop identifier was not provided. ErrUnsupportedCXPVersion indicates that the provided CXP protocol or API version is not supported. ErrCoopStatusFetch is returned when fetching the coop status from an external source fails. ErrCoopStatusResponse indicates that the coop status endpoint returned an error or invalid response. ErrCoopNoGrade is returned when no grade is available for the coop. ErrCoopNotFinished indicates that the coop has not yet reached a finished state. ErrContribProcess is returned when processing contributor information fails. ErrInvalidContractID indicates that the provided contract identifier is invalid or malformed. ErrCoopGradeInvalid is returned when the coop grade index is out of range or otherwise invalid. ErrReportSendFailed indicates that sending or publishing the report failed. ErrContractDurationMismatch is returned when the actual contract duration does not match the expected duration.
var ( DefaultLeggyTE = 100.0 DefaultLeggyDeflectorBonus = 0.20 DefaultLeggyMetronome = 1.35 DefaultLeggyCompass = 1.50 DefaultLeggyGusset = 1.25 DefaultLeggyDeliverySlots = 10.0 DefaultLeggyIHR = 7440.0 DefaultLeggyChalice = 1.40 DefaultLeggyMonocle = 1.30 DefaultLeggyIHRSlots = 8.0 DefaultLeggyChickenRunPercent = 70.0 )
var KevinLoc = func() *time.Location { loc, err := time.LoadLocation("America/Los_Angeles") if err != nil { return time.UTC } return loc }()
KevinLoc is the time.Location for America/Los_Angeles, falls back to UTC on error
Functions ¶
func AddBoostTokens ¶
func AddBoostTokens(client dc.Client, e dc.InteractionEvent, setCountWant int, countWantAdjust int) (int, int, error)
AddBoostTokens will add tokens to the current booster and adjust the count of the booster
func AddBoostTokensInteraction ¶
func AddBoostTokensInteraction(client dc.Client, e *dc.ComponentEvent, setCountWant int, countWantAdjust int)
AddBoostTokensInteraction handles the interactions responses for AddBoostTokens
func AddBoostersToThread ¶
AddBoostersToThread adds all contract boosters and creators to the contract thread(s) when the contract is not in signup mode.
func AddContractMember ¶
func AddContractMember(client dc.Client, guildID string, channelID string, operator string, mention string, guest string, order int, alreadyBoosted bool) error
AddContractMember adds a member to a contract
func AddThreadMemberDelayed ¶
func AddThreadMemberDelayed(client dc.Client, contractHash string, channelID, userID string, delay time.Duration)
AddThreadMemberDelayed waits for manualAddThreadMemberDelay (or the specified delay) and checks if the farmer has already joined the thread. If not, it adds them.
func AdminContractReport ¶
func AdminContractReport(client dc.Client, e *dc.ComponentEvent, contract *Contract, targetChannelID string)
AdminContractReport sends a contract summary plus a JSON attachment containing
func ArchiveContracts ¶
ArchiveContracts will set a contract state to Archive if it is older than 5 days
func AutoUpdateThreadName ¶
AutoUpdateThreadName will automatically update a thread's name to the current contract state. Prediction signups (except predicted past contracts) do not auto-rename the thread.
func BuildBoostOrderPreviewMessage ¶
BuildBoostOrderPreviewMessage creates the boost order image preview message with Keep and Dismiss buttons.
func BuildCustomOrderMessage ¶
func BuildCustomOrderMessage(contract *Contract, session *customOrderSession, status string) dc.Message
BuildCustomOrderMessage formats the preview catalyst message with table image and action buttons.
func BuildDefineCustomOrderMessage ¶
func BuildDefineCustomOrderMessage(contract *Contract, tmpl CustomBoostOrderTemplate, sessionUUID string, status string, isSaved ...bool) dc.Message
BuildDefineCustomOrderMessage creates the ⚙️ report message with table image and action buttons.
func CalculateBoostTime ¶
func CalculateBoostTime(te int, tokens int, tokenRate float64, sixTokBoostTime float64, artifactMult ...float64) float64
CalculateBoostTime calculates the total time in minutes for a specific token strategy. Parameters:
te: Tachyon Deflector / Enrichment level (e.g., 0, 1, 2...) tokens: Number of tokens used (0 to 8) tokenRate: Token generation rate (minutes per token, e.g., 13.0) sixTokBoostTime: The nominal 6-token boost time parameter from the sheet (e.g., 20.0) artifactMult: Optional artifact multiplier (chalice, monocle, life stones, etc.)
func CalculateIHRRateFromDB ¶
func ChangeBoostOrder ¶
func ChangeBoostOrder(client dc.Client, guildID string, channelID string, userID string, boostOrder string, redraw bool) (string, error)
ChangeBoostOrder will change the order of the boosters in the contract
func ChangeContractIDs ¶
func ChangeContractIDs(client dc.Client, guildID string, channelID string, userID string, contractID string, coopID string, coordinatorID string) (int, error)
ChangeContractIDs will change the contractID and/or coopID
func ChangeCurrentBooster ¶
func ChangeCurrentBooster(client dc.Client, guildID string, channelID string, userID string, newBooster string, redraw bool) error
ChangeCurrentBooster will change the current booster to the specified userID
func CheckAndNotifyAdminExitRestart ¶
CheckAndNotifyAdminExitRestart checks if the bot was restarted via /admin-exit and updates the original ephemeral message to notify that the bot is back online.
func CheckAndPublishAMQPBoosterChange ¶
CheckAndPublishAMQPBoosterChange publishes a booster join or remove event if contract has AMQP enabled.
func CheckAndPublishAMQPContractUpdate ¶
func CheckAndPublishAMQPContractUpdate(contract *Contract)
CheckAndPublishAMQPContractUpdate publishes an update event if contract has AMQP enabled.
func CheckCoopStatusPermission ¶
func CheckCoopStatusPermission(e *dc.CommandEvent, coopStatusFixEnabled bool) bool
CheckCoopStatusPermission checks if a user needs permission for CoopStatus API calls Returns true if permission is valid or not needed, false if permission dialog is needed If permission is not valid, it shows the permission dialog and returns false
func CheckLeaderboardPermission ¶
func CheckLeaderboardPermission(e dc.InteractionEvent) bool
CheckLeaderboardPermission checks if a user has granted permission for leaderboard API calls. Returns true if permission is valid, false if the permission dialog was shown.
func ContractReport ¶
func ContractReport( e dc.InteractionEvent, options dc.OptionValues, eiID string, okayToSave bool, ) error
ContractReport generates a contract report for player's contract with the given contract ID
Parameters:
- s: active Discord session
- i: the triggering interaction
- options: the slash command options (e.g., "contract-id").
- userID: Discord user ID of the caller
- okayToSave: whether API fetches may be cached/persisted.
Returns:
- error: nil on success.
func CreatePredictedContract ¶
func CreatePredictedContract() []ei.EggIncContract
CreatePredictedContract creates one placeholder contract each for Monday, Wednesday, Friday, and Friday Ultra based on the next predicted release dates.
func DeleteContract ¶
DeleteContract will delete the contract
func DeleteGlobalCustomOrder ¶
DeleteGlobalCustomOrder deletes a globally published custom boost order template by name. Returns true if found and removed.
func DeleteMissingContract ¶
DeleteMissingContract removes a missing contract from the database.
func DeleteUserCustomOrder ¶
DeleteUserCustomOrder deletes a custom boost order template for a user by name. Returns true if found and removed.
func DownloadCoopStatusStones ¶
func DownloadCoopStatusStones(channelID string, contractID string, coopID string, details bool, soloName string, useBuffHistory bool, eeidOverride string) (string, string, []dc.EmbedField)
DownloadCoopStatusStones will download the coop status for a given contract and coop ID
func DrawBoostList ¶
func DrawBoostList(contract *Contract) []dc.LayoutComponent
DrawBoostList will draw the boost list for the contract
func DrawBoostListCustom ¶
func DrawBoostListCustom(contract *Contract, compact bool) []dc.LayoutComponent
DrawBoostListCustom will draw the boost list for the contract, optionally compacting early and late boosters
func DrawBoostListUncompacted ¶
func DrawBoostListUncompacted(contract *Contract) []dc.LayoutComponent
DrawBoostListUncompacted will draw the full boost list message without early and late compaction
func DrawPureBoostList ¶
func DrawPureBoostList(contract *Contract) []dc.LayoutComponent
DrawPureBoostList will draw only the pure boost list without headers, banners, compaction, or guidance
func EncodeSandboxData ¶
func EncodeSandboxData(cxpToggle bool, targetEgg float64, tokenTimer string, contractLengthInSeconds int, numPlayers int, c *ei.EggIncContract, players []SandboxPlayer) (string, error)
EncodeSandboxData generates and encodes configuration data for the SR Sandbox v_5 format.
Parameters:
- CxpToggle (bool): enables or disables CXP calculations.
- TargetEgg (string): target egg count.
- TokenTimer (string): token timer interval in minutes.
- contractLengthInSeconds (int): total contract duration in seconds.
- numPlayers (int): coop size
- c (*ei.EggIncContract): pointer to the contract data.
- players ([]SandboxPlayer): array of player configurations to include.
Returns:
- (string): version-tagged encoded SR Sandbox data.
- (error): returned if encoding fails.
func FindEggEmoji ¶
FindEggEmoji will find the token emoji for the given guild
func FinishContract ¶
FinishContract is called only when the contract is complete
func FmtActiveModifier ¶
func FmtActiveModifier(c *ei.EggIncContract) (string, int)
FmtActiveModifier checks the contract modifiers in order and returns the first active one.
Parameters:
- c (*ei.EggIncContract): pointer to the contract data
Returns:
- string: formatted active modifier value (e.g., "1.05").
- int: index of the active modifier (0: HabCap, 1: IHR, 2: SR, 3: ELR).
func FmtNumberSingleUnit ¶
FmtNumberSingleUnit converts a float64 to a string with the correct unit scale. Parameters:
- v (float64): numeric value
- srSandboxOrdering (bool): optional flag to use SR sandbox ordering.
Returns:
- string: formatted number as a string
- int: unit index Normal: 0=Quintillion, 1=quadrillion, 2=Trillion SR Sandbox: 0=quadrillion, 1=Quintillion, 2=Trillion -1=none
func GenerateContractSandboxData ¶
func GenerateContractSandboxData(contract *Contract, players []SandboxPlayer) (string, error)
GenerateContractSandboxData builds an SR Sandbox query string from a Contract and player data. It does not require coop status data.
func GenerateContractSandboxDataWithOptions ¶
func GenerateContractSandboxDataWithOptions(contract *Contract, players []SandboxPlayer, options *ContractSandboxOptions) (string, error)
GenerateContractSandboxDataWithOptions builds an SR Sandbox query string from a Contract and player data, allowing callers to override derived values (for example, grade-specific coop status data).
func GenerateContractSandboxURL ¶
func GenerateContractSandboxURL(contract *Contract, players []SandboxPlayer) (string, error)
GenerateContractSandboxURL builds the full SR Sandbox URL from a Contract and player data.
func GenerateContractSandboxURLWithOptions ¶
func GenerateContractSandboxURLWithOptions(contract *Contract, players []SandboxPlayer, options *ContractSandboxOptions) (string, error)
GenerateContractSandboxURLWithOptions builds the full SR Sandbox URL from a Contract and player data, allowing callers to override derived values (for example, grade-specific coop status data).
func GetAttributions ¶
GetAttributions will return an embed listing attributions and acknowledgements.
func GetAvailabilityComponents ¶
func GetAvailabilityComponents(client dc.Client, contract *Contract, userID string) []dc.LayoutComponent
GetAvailabilityComponents returns the components for the availability command
func GetBoostMultiplierForTokens ¶
GetBoostMultiplierForTokens returns the boost multiplier for a specific number of tokens.
func GetContractArchivesForNames ¶
func GetContractArchivesForNames(names []string, cxpVersion string, forceRefresh bool, okayToSave bool, ) (archives [][]*ei.LocalContract, fetched []bool, missing []string, err error)
GetContractArchivesForNames fetches contract archives for a list of player names concurrently, returning index-aligned slices for (archives, fetched, missing).
func GetContractBoostOrderLines ¶
GetContractBoostOrderLines returns the condition lines representing a contract's current boost order.
func GetContractCustomOrderName ¶
GetContractCustomOrderName returns the human-readable name of a contract's custom boost order.
func GetContractDescription ¶
GetContractDescription gets the description for a contract identified by the channel ID.
func GetContractEstimateString ¶
func GetContractEstimateString(contractID string, includeLeggySet bool, showGG bool, teOverride ...float64) string
GetContractEstimateString returns a string with the estimated completion time of a contract
func GetCustomBoostOrderDoc ¶
func GetCustomBoostOrderDoc() []byte
GetCustomBoostOrderDoc retrieves the markdown documentation bytes for CustomBoostOrder.md.
func GetEggStandardTime ¶
GetEggStandardTime returns 9:00 AM Pacific Time (PT) for the given date, accounting for daylight savings.
func GetPlayerBoostConfig ¶
GetPlayerBoostConfig returns the optimal number of tokens used for boost and the boost multiplier based on the player's Tachyon Deflector / Enrichment (TE) level and optional artifact multiplier.
func GetPredCommand ¶
GetPredCommand returns the /pred command definition.
func GetPredictedContractTimes ¶
GetPredictedContractTimes returns the prediction times for a given contract. It returns (wednesdayTime, nonUltraTime, ultraTime).
func GetPredictedTimes ¶
GetPredictedTimes calculates and returns prediction times for all contracts and custom eggs.
func GetPredictionBrackets ¶
func GetPredictionBrackets() (wed, friPE, friUltra []ei.EggIncContract)
GetPredictionBrackets returns the sorted brackets for all Leggacy contracts.
func GetPredictionsCommand ¶
GetPredictionsCommand returns the command for the /predictions command
func GetRoleNamesForContract ¶
GetRoleNamesForContract returns role names for one contract without loading the full role map.
func GetSignupComponents ¶
func GetSignupComponents(contract *Contract) (string, []dc.LayoutComponent)
GetSignupComponents returns the signup components for a contract
func GetSlashAdminContractsListCommand ¶
GetSlashAdminContractsListCommand returns the command definition for admin contract list
func GetSlashAvailabilityCommand ¶
GetSlashAvailabilityCommand returns the slash command for setting availability
func GetSlashBoostCommand ¶
GetSlashBoostCommand returns the command definition for boosting
func GetSlashBoostOrderCommand ¶
GetSlashBoostOrderCommand returns the definition of the /boost-order command.
func GetSlashBoostOrderHelpersCommand ¶
GetSlashBoostOrderHelpersCommand returns the definition of the /boost-order-helpers command.
func GetSlashBumpCRCommand ¶
GetSlashBumpCRCommand returns the command definition for bumping CR messages
func GetSlashBumpCommand ¶
GetSlashBumpCommand returns the command definition for bumping a contract
func GetSlashCalcContractTval ¶
GetSlashCalcContractTval calculates the callers token value of a running contract
func GetSlashChangeCommand ¶
GetSlashChangeCommand returns the /update slash command with main subcommand groups for farmer and contract
func GetSlashChangeOneBoosterCommand ¶
GetSlashChangeOneBoosterCommand adjust aspects of a running contract
func GetSlashChangePlannedStartCommand ¶
GetSlashChangePlannedStartCommand adjust aspects of a running contract
func GetSlashChangeSpeedRunSinkCommand ¶
GetSlashChangeSpeedRunSinkCommand returns the slash command for changing speedrun sinks
func GetSlashContractCommand ¶
GetSlashContractCommand returns the slash command for creating a contract
func GetSlashContractReportCommand ¶
GetSlashContractReportCommand returns the command for the /contract-report command
func GetSlashContractSettingsCommand ¶
GetSlashContractSettingsCommand returns the command definition for contract settings
func GetSlashCoopETACommand ¶
GetSlashCoopETACommand returns the command definition for the coopeta command
func GetSlashCoopTval ¶
GetSlashCoopTval calculates the coop token value of a running contract
func GetSlashCsEstimates ¶
GetSlashCsEstimates returns the slash command for estimating scores
func GetSlashCustomBoostOrderCommand ¶
GetSlashCustomBoostOrderCommand defines the /custom-boost-order slash command with craft, delete, and help subcommands.
func GetSlashDefineCustomOrderCommand ¶
GetSlashDefineCustomOrderCommand is a backwards-compatible alias for GetSlashCustomBoostOrderCommand.
func GetSlashEstimateTime ¶
GetSlashEstimateTime is the definition of the slash command
func GetSlashHelpCommand ¶
GetSlashHelpCommand returns the command for the /help command
func GetSlashJoinContractCommand ¶
GetSlashJoinContractCommand returns the command definition for joining a contract
func GetSlashLeaderboard ¶
GetSlashLeaderboard returns the /leaderboard command
func GetSlashLinkAlternateCommand ¶
GetSlashLinkAlternateCommand allows a player to associate an alt.
func GetSlashLobbyCommand ¶
GetSlashLobbyCommand returns the slash command for showing the current coop lobby.
func GetSlashPruneCommand ¶
GetSlashPruneCommand returns the command definition for pruning a booster
func GetSlashRegisterAltCommand ¶
GetSlashRegisterAltCommand returns the /register-alt command
func GetSlashRegisterCommand ¶
GetSlashRegisterCommand returns the /register command
func GetSlashRenameThread ¶
GetSlashRenameThread is the definition of the slash command
func GetSlashRerunEvalCommand ¶
GetSlashRerunEvalCommand returns the command for the /launch-helper command
func GetSlashScoreExplorerCommand ¶
GetSlashScoreExplorerCommand returns the slash command for token tracking
func GetSlashSkipCommand ¶
GetSlashSkipCommand returns the command definition for skipping a booster
func GetSlashSpeedrunCommand ¶
GetSlashSpeedrunCommand returns the slash command for speedrun
func GetSlashStones ¶
GetSlashStones will return the discord command for calculating ideal stone set
func GetSlashTeamworkEval ¶
GetSlashTeamworkEval will return the discord command for calculating token values of a running contract
func GetSlashToggleContractPingsCommand ¶
GetSlashToggleContractPingsCommand returns the command definition for toggling pings
func GetSlashTokenEditCommand ¶
GetSlashTokenEditCommand returns the slash command for token tracking removal
func GetSlashUnboostCommand ¶
GetSlashUnboostCommand returns the command definition for unboosting
func GetSlashUpdateCommand ¶
GetSlashUpdateCommand returns the /update slash command with main subcommand groups for farmer and contract
func GetSlashUploadBannerCommand ¶
GetSlashUploadBannerCommand returns the command definition for uploading a custom banner
func GetSlashVolunteerSink ¶
GetSlashVolunteerSink is used to volunteer as token sink for a contract
func GetSlashVoluntellSink ¶
GetSlashVoluntellSink is used to volunteer as token sink for a contract
func GetTargetBuffTimeValue ¶
GetTargetBuffTimeValue returns the target buff time value for a contract. Rules:
- If cxpVersion == ei.SeasonalScoringNerfed: target = durationSec * 1.875.
- Else: target = durationSec * 2.0.
func GetTargetTval ¶
GetTargetTval will return the target tval for the contract based on the contract duration and minutes per token
func GetThematicComplaintsForContract ¶
GetThematicComplaintsForContract returns complaints for one contract without loading the full complaint map.
func HandleActiveContractsPage ¶
func HandleActiveContractsPage(client dc.Client, e *dc.ComponentEvent)
HandleActiveContractsPage handles button interactions for the active-contracts message.
func HandleAdminContractList ¶
func HandleAdminContractList(client dc.Client, e *dc.CommandEvent)
HandleAdminContractList opens the admin contract list panel.
It still takes a raw session because ArchiveContracts is not on the facade yet.
func HandleAdminContractListComponent ¶
func HandleAdminContractListComponent(client dc.Client, e *dc.ComponentEvent)
HandleAdminContractListComponent drives the admin contract list panel.
It still takes a raw session because finishContractByHash and ArchiveContracts are not on the facade yet.
func HandleAdminCurrentContracts ¶
func HandleAdminCurrentContracts(client dc.Client, e *dc.CommandEvent)
HandleAdminCurrentContracts handles the admin current-contracts command.
func HandleAdminExitButton ¶
func HandleAdminExitButton(client dc.Client, e *dc.ComponentEvent)
HandleAdminExitButton handles the admin-exit button clicks (confirm, cancel, and page navigation).
func HandleAdminExitCommand ¶
func HandleAdminExitCommand(client dc.Client, e *dc.CommandEvent)
HandleAdminExitCommand handles the admin-exit command to gracefully shutdown the bot.
func HandleAdminGetContractData ¶
func HandleAdminGetContractData(e *dc.CommandEvent)
HandleAdminGetContractData gets JSON data about a contract given the contract and coop id.
func HandleAdminGuildStateAutoComplete ¶
func HandleAdminGuildStateAutoComplete(client dc.Client, e *dc.AutocompleteEvent)
HandleAdminGuildStateAutoComplete serves guild-id suggestions from persisted guildstate keys.
func HandleAdminGuildStateCommand ¶
func HandleAdminGuildStateCommand(client dc.Client, e *dc.CommandEvent)
HandleAdminGuildStateCommand routes to guildstate handlers with explicit guild override.
func HandleAdminListRoles ¶
func HandleAdminListRoles(client dc.Client, e *dc.CommandEvent)
HandleAdminListRoles is the handler for the list roles command.
func HandleAdminMembers ¶
func HandleAdminMembers(client dc.Client, e *dc.CommandEvent)
HandleAdminMembers handles the set, remove, and list subcommands for admin-members.
func HandleAdminStatusMessageAutoComplete ¶
func HandleAdminStatusMessageAutoComplete(e *dc.AutocompleteEvent)
HandleAdminStatusMessageAutoComplete provides status message suggestions.
func HandleAdminStatusMessageCommand ¶
func HandleAdminStatusMessageCommand(client dc.Client, e *dc.CommandEvent)
HandleAdminStatusMessageCommand sets a one-time status message override.
func HandleAdminTasksAutocomplete ¶
func HandleAdminTasksAutocomplete(e *dc.AutocompleteEvent)
HandleAdminTasksAutocomplete provides autocomplete suggestions for administrative tasks and parameters.
func HandleAdminTasksCommand ¶
func HandleAdminTasksCommand(client dc.Client, e *dc.CommandEvent)
HandleAdminTasksCommand executes the chosen administrative task.
func HandleAllContractsAutoComplete ¶
func HandleAllContractsAutoComplete(e *dc.AutocompleteEvent)
HandleAllContractsAutoComplete will handle the contract auto complete of contract-id's default to new contracts but allow searching all contracts
func HandleAltsAutoComplete ¶
func HandleAltsAutoComplete(e *dc.AutocompleteEvent)
HandleAltsAutoComplete will populate with linked alternate names
func HandleArtifactAltAutoComplete ¶
func HandleArtifactAltAutoComplete(e *dc.AutocompleteEvent)
HandleArtifactAltAutoComplete suggests the alternates linked to the caller.
func HandleArtifactCommand ¶
func HandleArtifactCommand(client dc.Client, e *dc.CommandEvent)
HandleArtifactCommand shows the artifact picker for the caller or one of their alternates. It also clears any manual IHR override and updates running contracts.
func HandleArtifactReactions ¶
func HandleArtifactReactions(client dc.Client, e *dc.ComponentEvent)
HandleArtifactReactions handles all the button reactions for a contract settings.
It still takes a raw session because updateFarmerInContracts and refreshBoostListMessage are not on the facade yet.
func HandleAvailabilityCommand ¶
func HandleAvailabilityCommand(client dc.Client, e *dc.CommandEvent)
HandleAvailabilityCommand handles the /availability command through the dc facade.
It still takes a raw session because creatorOfContract is not on the facade yet.
func HandleBoostCommand ¶
func HandleBoostCommand(client dc.Client, e *dc.CommandEvent)
HandleBoostCommand will handle the /boost command
func HandleBoostOrderCommand ¶
func HandleBoostOrderCommand(client dc.Client, e *dc.CommandEvent)
HandleBoostOrderCommand handles the /boost-order command, starting an interactive session to reorder the boost order for a contract.
func HandleBoostOrderHelpersCommand ¶
func HandleBoostOrderHelpersCommand(client dc.Client, e *dc.CommandEvent)
HandleBoostOrderHelpersCommand handles the /boost-order-helpers command.
func HandleBoostOrderReactions ¶
func HandleBoostOrderReactions(client dc.Client, e *dc.ComponentEvent)
HandleBoostOrderReactions handles button interactions for the boost order catalyst, allowing the user to build a new boost order and save it.
func HandleBumpCRCommand ¶
func HandleBumpCRCommand(client dc.Client, e *dc.CommandEvent)
HandleBumpCRCommand will handle the /bump-cr command
func HandleBumpCommand ¶
func HandleBumpCommand(client dc.Client, e *dc.CommandEvent)
HandleBumpCommand will handle the /bump command
func HandleChangeCommand ¶
func HandleChangeCommand(client dc.Client, e *dc.CommandEvent)
HandleChangeCommand handles the /update slash command through the dc facade.
It still takes a raw session because the contract mutators and the boost list redraw are not on the facade yet.
func HandleChangeOneBoosterCommand ¶
func HandleChangeOneBoosterCommand(client dc.Client, e *dc.CommandEvent)
HandleChangeOneBoosterCommand handles the /change-one-booster command through the dc facade.
It still takes a raw session because the boost order mutators are not on the facade yet.
func HandleChangePlannedStartCommand ¶
func HandleChangePlannedStartCommand(client dc.Client, e *dc.CommandEvent)
HandleChangePlannedStartCommand handles the /change-planned-start command through the dc facade.
It still takes a raw session because creatorOfContract and the boost list redraw are not on the facade yet.
func HandleChangeSpeedrunSinkCommand ¶
func HandleChangeSpeedrunSinkCommand(client dc.Client, e *dc.CommandEvent)
HandleChangeSpeedrunSinkCommand handles the change speedrun sink command
func HandleChartReactions ¶
func HandleChartReactions(e *dc.ComponentEvent)
HandleChartReactions handles button and select menu interactions for the chart view.
func HandleContractAutoComplete ¶
func HandleContractAutoComplete(e *dc.AutocompleteEvent)
HandleContractAutoComplete will handle the contract auto complete of contract-id's
func HandleContractCalcContractTvalCommand ¶
func HandleContractCalcContractTvalCommand(e *dc.CommandEvent)
HandleContractCalcContractTvalCommand will handle the /contract-token-tval command
func HandleContractCommand ¶
func HandleContractCommand(client dc.Client, e *dc.CommandEvent)
HandleContractCommand will handle the /contract command
func HandleContractDelete ¶
func HandleContractDelete(client dc.Client, e *dc.ComponentEvent)
HandleContractDelete facilitates the deletion of a channel contract
func HandleContractReactions ¶
func HandleContractReactions(client dc.Client, e *dc.ComponentEvent)
HandleContractReactions handles all the button reactions for a contract.
It still takes a raw session because the boost order helpers and the boost list redraw are not on the facade yet.
func HandleContractReport ¶
func HandleContractReport(e *dc.CommandEvent)
HandleContractReport handles the /contract-report command.
func HandleContractSettingsCommand ¶
func HandleContractSettingsCommand(client dc.Client, e *dc.CommandEvent)
HandleContractSettingsCommand will handle the /contract-settings command
func HandleContractSettingsReactions ¶
func HandleContractSettingsReactions(client dc.Client, e *dc.ComponentEvent)
HandleContractSettingsReactions handles all the button reactions for a contract settings
func HandleCoopAutoComplete ¶
func HandleCoopAutoComplete(e *dc.AutocompleteEvent)
HandleCoopAutoComplete will handle the contract auto complete of contract-id's
func HandleCoopETACommand ¶
func HandleCoopETACommand(e *dc.CommandEvent)
HandleCoopETACommand will handle the /coopeta command
func HandleCoopStatusPermissionButton ¶
func HandleCoopStatusPermissionButton(e *dc.ComponentEvent)
HandleCoopStatusPermissionButton handles button interactions for the permission dialog through the dc facade.
func HandleCoopTvalCommand ¶
func HandleCoopTvalCommand(client dc.Client, e *dc.CommandEvent)
HandleCoopTvalCommand will handle the /contract-token-tval command. It is also called from /bump, which has already answered its own interaction, so every response here is skipped when the command name is "bump".
func HandleCsEstimateButtons ¶
func HandleCsEstimateButtons(e *dc.ComponentEvent)
HandleCsEstimateButtons handles button interactions for /cs-estimate.
func HandleCsEstimatesCommand ¶
func HandleCsEstimatesCommand(e *dc.CommandEvent)
HandleCsEstimatesCommand handles the estimate scores command.
func HandleCustomBoostOrderAutoComplete ¶
func HandleCustomBoostOrderAutoComplete(e *dc.AutocompleteEvent)
HandleCustomBoostOrderAutoComplete provides autocomplete options for /custom-boost-order.
func HandleCustomBoostOrderCommand ¶
func HandleCustomBoostOrderCommand(client dc.Client, e *dc.CommandEvent)
HandleCustomBoostOrderCommand handles invocation of /custom-boost-order.
func HandleCustomOrderModalSubmit ¶
func HandleCustomOrderModalSubmit(client dc.Client, e *dc.ModalEvent)
HandleCustomOrderModalSubmit processes the submitted custom boost order modal dialog.
func HandleCustomOrderReactions ¶
func HandleCustomOrderReactions(client dc.Client, e *dc.ComponentEvent)
HandleCustomOrderReactions processes button clicks on the Custom Boost Order preview catalyst.
func HandleDefineCustomOrderAutoComplete ¶
func HandleDefineCustomOrderAutoComplete(e *dc.AutocompleteEvent)
HandleDefineCustomOrderAutoComplete provides backwards-compatible autocomplete.
func HandleDefineCustomOrderCommand ¶
func HandleDefineCustomOrderCommand(client dc.Client, e *dc.CommandEvent)
HandleDefineCustomOrderCommand provides backwards-compatible invocation.
func HandleDefineCustomOrderModalSubmit ¶
func HandleDefineCustomOrderModalSubmit(_ dc.Client, e *dc.ModalEvent)
HandleDefineCustomOrderModalSubmit processes the submitted 4-line criteria modal.
func HandleDefineCustomOrderReactions ¶
func HandleDefineCustomOrderReactions(client dc.Client, e *dc.ComponentEvent)
HandleDefineCustomOrderReactions handles MODIFY, SAVE, PUBLISH, SELECT, DELETE button clicks.
func HandleEggIDModalSubmit ¶
func HandleEggIDModalSubmit(e *dc.ModalEvent)
HandleEggIDModalSubmit stores the submitted Egg Inc ID and resumes whichever command asked for it.
It still takes a raw session because the commands it resumes are not on the facade yet.
func HandleEstimateTimeCommand ¶
func HandleEstimateTimeCommand(e *dc.CommandEvent)
HandleEstimateTimeCommand will handle the estimate-contract-time command
func HandleHelpCommand ¶
func HandleHelpCommand(client dc.Client, e *dc.CommandEvent)
HandleHelpCommand will handle the help command
func HandleJoinCommand ¶
func HandleJoinCommand(client dc.Client, e *dc.CommandEvent)
HandleJoinCommand will handle the /join command
func HandleLeaderboard ¶
func HandleLeaderboard(e *dc.CommandEvent)
HandleLeaderboard posts the leaderboard for the requested season.
func HandleLeaderboardAutoComplete ¶
func HandleLeaderboardAutoComplete(e *dc.AutocompleteEvent)
HandleLeaderboardAutoComplete suggests seasons for the /leaderboard season option.
func HandleLeaderboardPage ¶
func HandleLeaderboardPage(e *dc.ComponentEvent)
HandleLeaderboardPage drives the season selector, Refresh and Close controls.
func HandleLeaderboardPermissionButton ¶
func HandleLeaderboardPermissionButton(e *dc.ComponentEvent)
HandleLeaderboardPermissionButton records the answer to the permission dialog and closes it.
func HandleLinkAlternateAutoComplete ¶
func HandleLinkAlternateAutoComplete(e *dc.AutocompleteEvent)
HandleLinkAlternateAutoComplete will handle the /link-alternate autocomplete through the dc facade.
func HandleLinkAlternateCommand ¶
func HandleLinkAlternateCommand(client dc.Client, e *dc.CommandEvent)
HandleLinkAlternateCommand handles the /link-alternate command through the dc facade.
It still takes a raw session because the boost list redraw is not on the facade yet.
func HandleLobbyButtons ¶
func HandleLobbyButtons(client dc.Client, e *dc.ComponentEvent)
HandleLobbyButtons handles refresh, ping, and close button interactions for /lobby.
func HandleLobbyCommand ¶
func HandleLobbyCommand(e *dc.CommandEvent)
HandleLobbyCommand handles the /lobby slash command.
func HandleMenuReactions ¶
func HandleMenuReactions(client dc.Client, e *dc.ComponentEvent)
HandleMenuReactions handles the menu reactions for the contract.
It still takes a raw session because the boost list redraw, the token helpers and the sandbox DM are not on the facade yet.
func HandlePredCommand ¶
func HandlePredCommand(client dc.Client, e *dc.CommandEvent)
HandlePredCommand dispatches /pred subcommands.
func HandlePredPage ¶
func HandlePredPage(client dc.Client, e *dc.ComponentEvent)
HandlePredPage handles select menu and button interactions for /pred.
func HandlePredictionsCommand ¶
func HandlePredictionsCommand(client dc.Client, e *dc.CommandEvent)
HandlePredictionsCommand will handle the /predictions command
func HandlePredictionsPage ¶
func HandlePredictionsPage(e *dc.ComponentEvent)
HandlePredictionsPage handles interaction for prediction pages
func HandlePruneCommand ¶
func HandlePruneCommand(client dc.Client, e *dc.CommandEvent)
HandlePruneCommand will handle the /prune command
func HandlePublishCustomOrderModalSubmit ¶
func HandlePublishCustomOrderModalSubmit(_ dc.Client, e *dc.ModalEvent)
HandlePublishCustomOrderModalSubmit processes publishing the named custom order preset globally.
func HandleRegister ¶
func HandleRegister(e *dc.CommandEvent)
HandleRegister asks for the caller's Egg Inc ID.
func HandleRegisterAlt ¶
func HandleRegisterAlt(e *dc.CommandEvent)
HandleRegisterAlt asks for the alternate's Egg Inc ID.
func HandleRegisterAltAutocomplete ¶
func HandleRegisterAltAutocomplete(e *dc.AutocompleteEvent)
HandleRegisterAltAutocomplete suggests the alternates the caller controls.
func HandleRenameThreadCommand ¶
func HandleRenameThreadCommand(client dc.Client, e *dc.CommandEvent)
HandleRenameThreadCommand will handle the thread rename command
func HandleReplayEval ¶
func HandleReplayEval(e *dc.CommandEvent)
HandleReplayEval handles the /replay-eval command.
func HandleRerunEvalAutoComplete ¶
func HandleRerunEvalAutoComplete(e *dc.AutocompleteEvent)
HandleRerunEvalAutoComplete dispatches autocomplete for /rerun-eval subcommands. The "active" subcommand gets contract-id autocomplete; the "season" subcommand gets season autocomplete powered by leaderboardSeasons().
func HandleRerunEvalSeasonAutoComplete ¶
func HandleRerunEvalSeasonAutoComplete(e *dc.AutocompleteEvent)
HandleRerunEvalSeasonAutoComplete suggests seasons for the /rerun-eval season option.
func HandleRestartContract ¶
func HandleRestartContract(client dc.Client, e *dc.ComponentEvent)
HandleRestartContract recycles the current contract and recreates it with the same participants, planned start time, and run style.
func HandleSaveCustomOrderModalSubmit ¶
func HandleSaveCustomOrderModalSubmit(_ dc.Client, e *dc.ModalEvent)
HandleSaveCustomOrderModalSubmit processes saving the named custom order preset.
func HandleScoreExplorerCommand ¶
func HandleScoreExplorerCommand(e *dc.CommandEvent)
HandleScoreExplorerCommand handles the score explorer command through the dc facade.
func HandleScoreExplorerPage ¶
func HandleScoreExplorerPage(e *dc.ComponentEvent)
HandleScoreExplorerPage steps a page of the score explorer through the dc facade.
func HandleSignupBell ¶
func HandleSignupBell(client dc.Client, e *dc.ComponentEvent)
HandleSignupBell handles the interaction for joining a contract with a bell
func HandleSignupFarmer ¶
func HandleSignupFarmer(client dc.Client, e *dc.ComponentEvent)
HandleSignupFarmer handles the interaction for joining a contract as a farmer
func HandleSignupLeave ¶
func HandleSignupLeave(client dc.Client, e *dc.ComponentEvent)
HandleSignupLeave handles the interaction for leaving a contract.
It still takes a raw session because RemoveFarmerByMention is not on the facade yet.
func HandleSignupStart ¶
func HandleSignupStart(client dc.Client, e *dc.ComponentEvent)
HandleSignupStart handles the interaction for starting the signup process.
It still takes a raw session because StartContractBoosting and the signup message rebuild are not on the facade yet.
func HandleSkipCommand ¶
func HandleSkipCommand(client dc.Client, e *dc.CommandEvent)
HandleSkipCommand will handle the /skip command
func HandleSlashVolunteerSinkCommand ¶
func HandleSlashVolunteerSinkCommand(client dc.Client, e *dc.CommandEvent)
HandleSlashVolunteerSinkCommand is used to volunteer as token sink for a contract.
It still takes a raw session because RedrawBoostList is not on the facade yet.
func HandleSlashVoluntellSinkCommand ¶
func HandleSlashVoluntellSinkCommand(client dc.Client, e *dc.CommandEvent)
HandleSlashVoluntellSinkCommand is used to volunteer as token sink for a contract.
It still takes a raw session because RedrawBoostList is not on the facade yet.
func HandleSpeedrunCommand ¶
func HandleSpeedrunCommand(client dc.Client, e *dc.CommandEvent)
HandleSpeedrunCommand handles the speedrun command
func HandleStonesCommand ¶
func HandleStonesCommand(client dc.Client, e *dc.CommandEvent)
HandleStonesCommand handles the /stones command through the dc facade.
It still takes a raw session because the boost list redraw is not on the facade yet.
func HandleStonesPage ¶
func HandleStonesPage(client dc.Client, e *dc.ComponentEvent)
HandleStonesPage steps a page of cached stones data through the dc facade.
It still takes a raw session because sendStonesPage can trigger a boost list redraw, which is not on the facade yet.
func HandleTeamworkEvalCommand ¶
func HandleTeamworkEvalCommand(e *dc.CommandEvent)
HandleTeamworkEvalCommand will handle the /teamwork command through the dc facade.
func HandleTeamworkPage ¶
func HandleTeamworkPage(e *dc.ComponentEvent)
HandleTeamworkPage steps a page of cached teamwork data through the dc facade.
func HandleThresholdModalSubmit ¶
func HandleThresholdModalSubmit(client dc.Client, e *dc.ModalEvent)
HandleThresholdModalSubmit processes the submitted threshold tokens modal dialog
func HandleToggleContractPingsCommand ¶
func HandleToggleContractPingsCommand(client dc.Client, e *dc.CommandEvent)
HandleToggleContractPingsCommand will handle the /toggle-contract-pings command
func HandleTokenEditAutoComplete ¶
func HandleTokenEditAutoComplete(e *dc.AutocompleteEvent)
HandleTokenEditAutoComplete will handle the /token-edit autocomplete
func HandleTokenEditCommand ¶
func HandleTokenEditCommand(client dc.Client, e *dc.CommandEvent) string
HandleTokenEditCommand will handle the /token-edit command
func HandleTokenEditInteraction ¶
func HandleTokenEditInteraction(client dc.Client, e *dc.CommandEvent)
HandleTokenEditInteraction handles the /token-edit command interaction
func HandleUnboostCommand ¶
func HandleUnboostCommand(client dc.Client, e *dc.CommandEvent)
HandleUnboostCommand will handle the /unboost command
func HandleUpdateCommand ¶
func HandleUpdateCommand(client dc.Client, e *dc.CommandEvent)
HandleUpdateCommand handles the /update slash command through the dc facade.
It still takes a raw session because the boost list redraw is not on the facade yet.
func HandleUploadBannerCommand ¶
func HandleUploadBannerCommand(client dc.Client, e *dc.CommandEvent)
HandleUploadBannerCommand handles the /upload-banner command
func IsRoleCreatedByBot ¶
IsRoleCreatedByBot checks if a role name was created by the bot by verifying if it matches one of the role names from the bot's source lists (randomThingNames or contract team names)
func IsUserCreatorOfAnyContract ¶
IsUserCreatorOfAnyContract will return true if the user is the creator of any contract
func JoinContract ¶
func JoinContract(client dc.Client, guildID string, channelID string, userID string, bell bool) error
JoinContract will add a user to the contract
func LoadContractData ¶
func LoadContractData(filename string)
LoadContractData will load contract data from a file
func LoadEggscapeCoopIDs ¶
func LoadEggscapeCoopIDs(filename string)
LoadEggscapeCoopIDs loads the eggscape coop ID list from a JSON file.
func LoadMissingContracts ¶
LoadMissingContracts loads missing contracts and their initial missing timestamps from the database.
func LoadRoleNames ¶
LoadRoleNames loads all contract roles from the database
func LoadThematicComplaints ¶
LoadThematicComplaints loads all contract complaints from the database, using an in-memory cache to match previous behavior.
func MoveBooster ¶
func MoveBooster(client dc.Client, guildID string, channelID string, userID string, boosterName string, boosterPosition int, redraw bool) error
MoveBooster will move a booster to a new position in the contract
func NormalizeTimeslotValues ¶
NormalizeTimeslotValues handles selection of "ALL Times" vs individual timeslots.
func PopulateContractFromProto ¶
func PopulateContractFromProto(contractProtoBuf *ei.Contract) ei.EggIncContract
PopulateContractFromProto will populate a contract from a protobuf
func PopulateThematicComplaintsForContractID ¶
PopulateThematicComplaintsForContractID updates active contracts for a contract ID with complaints.
func PrevContractScoresFromArchives ¶
func PrevContractScoresFromArchives(archives [][]*ei.LocalContract, fetched []bool, contractID, currentCoopID string) (prev []float64, foundPrev []bool)
PrevContractScoresFromArchives returns previous contract scores for players whose archives were fetched.
func PublishAMQPBoostStatus ¶
func PublishAMQPBoostStatus(guildID string, url string, contractID string, coopID string, status AMQPBoostStatusMessage)
PublishAMQPBoostStatus publishes a boost status update to the guild's AMQP queue.
func PublishAMQPBoosterChange ¶
func PublishAMQPBoosterChange(guildID string, url string, status AMQPBoosterChangeMessage)
PublishAMQPBoosterChange publishes a booster join/remove event to the guild's AMQP queue.
func PublishAMQPContractStart ¶
func PublishAMQPContractStart(guildID string, url string, status AMQPContractStartMessage)
PublishAMQPContractStart publishes a contract start event to the guild's AMQP queue.
func PublishAMQPContractUpdate ¶
func PublishAMQPContractUpdate(guildID string, url string, status AMQPContractUpdateMessage)
PublishAMQPContractUpdate publishes a contract update/reset event to the guild's AMQP queue.
func PublishAMQPNonToken ¶
func PublishAMQPNonToken(guildID string, url string, contractID string, coopID string, status AMQPNonTokenMessage)
PublishAMQPNonToken publishes a non-token event to the guild's AMQP queue.
func PublishAMQPTokenLog ¶
func PublishAMQPTokenLog(guildID string, url string, contractID string, coopID string, logEntry AMQPTokenMessage)
PublishAMQPTokenLog publishes a token log to the guild's AMQP queue.
func PublishGlobalCustomOrder ¶
func PublishGlobalCustomOrder(tmpl CustomBoostOrderTemplate)
PublishGlobalCustomOrder saves or updates a custom boost order globally across all servers.
func ReactionAdd ¶
func ReactionAdd(client dc.Client, e *dc.ReactionEvent) string
ReactionAdd is called when a reaction is added to a message
func ReactionRemove ¶
func ReactionRemove(_ dc.Client, _ *dc.ReactionEvent)
ReactionRemove handles a user removing a reaction from a message
func RedrawBoostList ¶
RedrawBoostList will move the boost message to the bottom of the channel
func RefreshGuildContractsForBannerUpdate ¶
RefreshGuildContractsForBannerUpdate updates banner URLs and redraws boost lists for active contracts associated with the given guild.
func Register ¶
func Register(e *dc.ModalEvent, encryptedID string, okayToSave bool)
Register processes the register modal submission, saves the EI ID, and pulls a backup to update the player's IGN.
func RegisterAlt ¶
func RegisterAlt(e *dc.ModalEvent, targetAlt string, encryptedID string)
RegisterAlt processes the register-alt modal submission.
func RegisterEggIDModalAction ¶
func RegisterEggIDModalAction(action string, handler func(e *dc.ModalEvent, options dc.OptionValues, encryptedID string, okayToSave bool))
RegisterEggIDModalAction registers a handler for an external action key in the EggID modal.
func RemoveAddedReaction ¶
func RemoveAddedReaction(client dc.Client, e *dc.ReactionEvent)
RemoveAddedReaction removes an added reaction from a message so it can be reactivated
func RemoveFarmerByMention ¶
func RemoveFarmerByMention(client dc.Client, guildID string, channelID string, operator string, mention string) error
RemoveFarmerByMention will remove a booster from the contract by mention
func RenderCustomOrderTableImage ¶
RenderCustomOrderTableImage renders a PNG table image of the custom boost order.
func RenderScoreTableANSI ¶
RenderScoreTableANSI renders the score table in an ANSI code block, highlighting the max value in each column. If includeDiff is true, includes the Diff column.
func RenderScoreTableImage ¶
RenderScoreTableImage renders the score table as a PNG image using RenderTableImage.
func RenderTableImage ¶
func RenderTableImage(cols []TableImageColumn, rows []TableImageRow) ([]byte, error)
RenderTableImage renders a generic table of columns and rows as a PNG image.
func ReplaceThematicComplaintsForContractID ¶
ReplaceThematicComplaintsForContractID replaces thematic complaints on active contracts for a contract ID.
func RequestEggIncIDModal ¶
func RequestEggIncIDModal(e *dc.CommandEvent, action string, options dc.OptionValues)
RequestEggIncIDModal sends a modal to the user requesting their Egg Inc ID
func RerunEval ¶
func RerunEval(e dc.InteractionEvent, options dc.OptionValues, eiID string, okayToSave bool)
RerunEval evaluates the contract history and provides replay guidance
func SaveMissingContract ¶
SaveMissingContract inserts or updates a missing contract timestamp in the database.
func SaveRoleNames ¶
SaveRoleNames saves contract roles to the database. It deletes existing roles for the given contract IDs and inserts the new ones in a transaction.
func SaveThematicComplaints ¶
SaveThematicComplaints saves contract complaints to the database. It deletes existing complaints for the given contract IDs and inserts the new ones in a transaction.
func SaveUserCustomOrder ¶
func SaveUserCustomOrder(userID string, tmpl CustomBoostOrderTemplate)
SaveUserCustomOrder saves or updates a custom boost order template for a user.
func SendCustomBoostOrderModal ¶
func SendCustomBoostOrderModal(e *dc.ComponentEvent, contractHash string)
SendCustomBoostOrderModal displays a 4-row modal to configure custom boost order rules.
func SendDefineCustomOrderModalFromCommand ¶
func SendDefineCustomOrderModalFromCommand(e *dc.CommandEvent, contract *Contract, initial *CustomBoostOrderTemplate)
SendDefineCustomOrderModalFromCommand presents the 4-line criteria modal in response to a CommandEvent.
func SendDefineCustomOrderModalFromComponent ¶
func SendDefineCustomOrderModalFromComponent(e *dc.ComponentEvent, tmpl CustomBoostOrderTemplate, sessionUUID string)
SendDefineCustomOrderModalFromComponent presents the 4-line criteria modal in response to a ComponentEvent (e.g. MODIFY button).
func SendPublishCustomOrderModal ¶
func SendPublishCustomOrderModal(e *dc.ComponentEvent, tmpl CustomBoostOrderTemplate, sessionUUID string)
SendPublishCustomOrderModal presents a modal dialog to name and publish the custom order globally.
func SendSandboxDM ¶
SendSandboxDM builds and sends an SR Sandbox DM to a user.
func SendSaveCustomOrderModal ¶
func SendSaveCustomOrderModal(e *dc.ComponentEvent, tmpl CustomBoostOrderTemplate, sessionUUID string)
SendSaveCustomOrderModal presents a modal dialog to name and save the custom order to user presets.
func SendThresholdModal ¶
func SendThresholdModal(e *dc.ComponentEvent, contractHash string)
SendThresholdModal displays a modal to configure threshold tokens
func SetCustomBoostOrderDoc ¶
func SetCustomBoostOrderDoc(data []byte)
SetCustomBoostOrderDoc stores the documentation content bytes for CustomBoostOrder.md.
func SetListMessageID ¶
SetListMessageID will save the list messageID for the contract
func SetPeriodicalsRefresher ¶
func SetPeriodicalsRefresher(refresher PeriodicalsRefresherFunc)
SetPeriodicalsRefresher configures the function used to refresh periodicals from API.
func SetReactionID ¶
SetReactionID will save the reactionID for the contract
func SetStatusMessagesRefresher ¶
func SetStatusMessagesRefresher(refresher StatusMessagesRefresherFunc)
SetStatusMessagesRefresher configures the function used to refresh status messages.
func SetThematicComplaintsGenerator ¶
func SetThematicComplaintsGenerator(gen ThematicComplaintsGeneratorFunc)
SetThematicComplaintsGenerator configures the function used to generate complaints with LLM.
func SetTokenComplaintsRefresher ¶
func SetTokenComplaintsRefresher(refresher TokenComplaintsRefresherFunc)
SetTokenComplaintsRefresher configures the function used to refresh token complaints.
func ShowCoopStatusPermissionDialog ¶
func ShowCoopStatusPermissionDialog(e *dc.CommandEvent)
ShowCoopStatusPermissionDialog shows the ephemeral dialog with Allow and Close buttons
func ShowLeaderboardPermissionDialog ¶
func ShowLeaderboardPermissionDialog(e dc.InteractionEvent)
ShowLeaderboardPermissionDialog shows the ephemeral dialog with Allow and Close buttons.
func SkipBooster ¶
SkipBooster will skip the current booster and move to the next
func SlashAdminCurrentContracts ¶
SlashAdminCurrentContracts creates the admin current-contracts command for Discord.
func SlashAdminExitCommand ¶
SlashAdminExitCommand provides an admin-only command to gracefully exit the bot.
func SlashAdminGetContractData ¶
SlashAdminGetContractData is the slash to get contract JSON data
func SlashAdminGuildStateCommand ¶
SlashAdminGuildStateCommand provides a generic entrypoint for guildstate admin actions.
func SlashAdminListRoles ¶
SlashAdminListRoles is the slash to info about bot roles
func SlashAdminMembers ¶
SlashAdminMembers returns the admin-members slash command definition with set/remove subcommands.
func SlashAdminStatusMessageCommand ¶
SlashAdminStatusMessageCommand sets the next bot status message.
func SlashAdminTasksCommand ¶
SlashAdminTasksCommand returns the /admin-tasks command definition.
func SlashArtifactsCommand ¶
SlashArtifactsCommand creates a new slash command for setting Egg, Inc name
func StartContractBoosting ¶
StartContractBoosting will start the contract
func SuggestCustomOrderName ¶
SuggestCustomOrderName analyzes custom boost order rule lines and generates a concise, readable preset name.
func UpdateAllContractsEggInfo ¶
func UpdateAllContractsEggInfo()
UpdateAllContractsEggInfo updates the EggName and EggEmoji fields for all active contracts, and regenerates banners if necessary.
func UpdateBannerURL ¶
func UpdateBannerURL(contract *Contract)
UpdateBannerURL will construct and set the BannerURL for the contract
func UpdateContractTime ¶
func UpdateContractTime(contractID string, coopID string, startTime, endTime time.Time, contractDurationSeconds float64)
UpdateContractTime will update the contract start time and estimated duration
func UpdatePredictedSignupContracts ¶
func UpdatePredictedSignupContracts(client dc.Client, liveContracts []ei.EggIncContract) int
UpdatePredictedSignupContracts replaces signup contracts using predicted IDs with real IDs when a matching periodical contract for the same day/ultra slot arrives.
func UpdateThreadName ¶
UpdateThreadName will update a threads name to the current contract state
func UserInContract ¶
UserInContract will return true if the user is in the contract, also checks for any discrepancies between Boosters and Order and resolves them
Types ¶
type AMQPBoostStatusMessage ¶
type AMQPBoostStatusMessage struct {
Event string `json:"event"`
ContractID string `json:"contract_id"`
CoopID string `json:"coop_id"`
UserID string `json:"user_id"`
Nick string `json:"nick"`
BoostState string `json:"boost_state"` // "Unboosted", "TokenTime", "Boosted"
Time time.Time `json:"time"`
}
AMQPBoostStatusMessage represents a player's boost status change.
type AMQPBoosterChangeMessage ¶
type AMQPBoosterChangeMessage struct {
Event string `json:"event"` // "booster_join" or "booster_remove"
ContractID string `json:"contract_id"`
CoopID string `json:"coop_id"`
UserID string `json:"user_id"`
Nick string `json:"nick"`
Time time.Time `json:"time"`
}
AMQPBoosterChangeMessage represents a join or remove event for a booster in a contract.
type AMQPClient ¶
type AMQPClient struct {
// contains filtered or unexported fields
}
AMQPClient manages the AMQP connection and channel for a single guild.
func (*AMQPClient) Close ¶
func (c *AMQPClient) Close()
Close closes the AMQP connection and channel.
type AMQPContractStartMessage ¶
type AMQPContractStartMessage struct {
Event string `json:"event"`
ContractID string `json:"contract_id"`
CoopID string `json:"coop_id"`
ChannelID string `json:"channel_id"`
StartTime time.Time `json:"start_time"`
CoopSize int `json:"coop_size"`
DeliveryTarget float64 `json:"delivery_target"`
GenerousGifts string `json:"generous_gifts"`
GGMultiplier float64 `json:"gg_multiplier,omitempty"`
MinutesPerToken int `json:"minutes_per_token"`
}
AMQPContractStartMessage represents details of a contract when started.
type AMQPContractUpdateMessage ¶
type AMQPContractUpdateMessage struct {
Event string `json:"event"`
ContractID string `json:"contract_id"`
CoopID string `json:"coop_id"`
ChannelID string `json:"channel_id"`
StartTime time.Time `json:"start_time"`
CoopSize int `json:"coop_size"`
DeliveryTarget float64 `json:"delivery_target"`
GenerousGifts string `json:"generous_gifts"`
GGMultiplier float64 `json:"gg_multiplier,omitempty"`
MinutesPerToken int `json:"minutes_per_token"`
}
AMQPContractUpdateMessage represents details of a contract when updated/reset.
type AMQPNonTokenMessage ¶
type AMQPNonTokenMessage struct {
Event string `json:"event"`
ContractID string `json:"contract_id"`
CoopID string `json:"coop_id"`
UserID string `json:"user_id"`
Nick string `json:"nick"`
Time time.Time `json:"time"`
}
AMQPNonTokenMessage represents a non-token delivery report.
type AMQPTokenMessage ¶
type AMQPTokenMessage struct {
Event string `json:"event"`
ContractID string `json:"contract_id"`
CoopID string `json:"coop_id"`
Time time.Time `json:"time"`
Quantity int `json:"quantity"`
Value float64 `json:"value"`
FromUserID string `json:"from_user_id"`
FromNick string `json:"from_nick"`
ToUserID string `json:"to_user_id"`
ToNick string `json:"to_nick"`
Boost bool `json:"boost"`
}
AMQPTokenMessage represents the structure of the token unit log sent over AMQP.
type AdminExitNotice ¶
type AdminExitNotice struct {
ApplicationID string `json:"application_id"`
InteractionToken string `json:"interaction_token"`
MessageID string `json:"message_id"`
ChannelID string `json:"channel_id"`
GuildID string `json:"guild_id"`
UserID string `json:"user_id"`
ExitTime time.Time `json:"exit_time"`
InitialText string `json:"initial_text"`
}
AdminExitNotice tracks metadata for an admin-requested exit to update the ephemeral message on startup.
type ArtifactSet ¶
ArtifactSet holds the data for each set of artifacts
type BankerInfo ¶
type BankerInfo struct {
CurrentBanker string // Current Banker
BoostingSinkUserID string // Boosting Sink User ID
PostSinkUserID string // Sink End of Contract User ID
SinkBoostPosition int // Sink Boost Position
}
BankerInfo holds information about contract Banker
type Bookmark ¶
type Bookmark struct {
ChannelID string `json:"channel_id"`
GuildID string `json:"guild_id,omitempty"`
GuildName string `json:"guild_name,omitempty"`
ChannelName string `json:"channel_name,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
Bookmark represents a bookmark for a specific channel in the dashboard
type BoostResult ¶
BoostResult holds the strategy name, token count, boost multiplier, and calculated total time.
func FindFastestBoost ¶
func FindFastestBoost(te int, tokenRate float64, sixTokBoostTime float64, artifactMult ...float64) BoostResult
FindFastestBoost determines the optimal boost strategy and its duration for a given TE level and optional artifact multiplier.
type Booster ¶
type Booster struct {
UserID string // Egg Farmer
GlobalName string
UserName string
ChannelName string
GuildID string // Discord Guild where this User is From
GuildName string
Ping bool // True/False
Register time.Time //o Time Farmer registered to boost
Name string
Unique string
Nick string
Mention string // String which mentions user
Color int
Alts []string // Array of alternate ids for the user
AltController string // User ID of the controller of this alternate
IsAlt bool // True if designated as an alternate account in this contract
BoostState int // Indicates if current booster
TokensReceived int // indicate number of boost tokens
TokensWanted int // indicate number of boost tokens
TokenValue float64 // Current Token Value
TokenRequestFlag bool // Flag to indicate if the token request is active
StartTime time.Time // Time Farmer started boost turn
EndTime time.Time // Time Farmer ended boost turn
Duration time.Duration // Duration of boost
BoostingTokenTimestamp time.Time // When the boosting token was last received
VotingList []string // Record list of those that voted to boost
RunChickensTime time.Time // Time Farmer triggered chicken run reaction
LastCRAttempt time.Time // Time user last clicked the CR button (when not boosted)
RanChickensOn []string // Array of users that the farmer ran chickens on
BoostTriggerTime time.Time // Used for time remaining in boost
Hint []string // Used to track which hints have been given
ArtifactSet ArtifactSet // Set of artifacts for this booster
EstDurationOfBoost time.Duration // Estimated duration of the boost
EstEndOfBoost time.Time // Estimated end of the boost
EstRequestChickenRuns time.Time // Estimated time to request chicken runs
Ultra bool // Does this player have Ultra
TECount int // Truth Egg Count
IHRRate float64 // Internal Hatchery Rate for IHR Order
IHRCalcLog string // Plain text log of IHR calculation details
FuzzyOffset float64 // Fuzzy random offset applied during fuzzy TE or IHR ordering
Availability ContractAvailability // Availability for contracts
NonTokenReactionTimes []time.Time // Timestamps of no-token button interactions
NonTokenMsgID string // Last ephemeral message ID for user reaction summary log
DisableEphemeralLog bool // Toggle for user ephemeral reaction summary log
}
Booster holds the data for each booster within a Contract
func AddFarmerToContract ¶
func AddFarmerToContract(client dc.Client, contract *Contract, guildID string, channelID string, userID string, order int, progenitor bool, alreadyBoosted bool) (*Booster, error)
AddFarmerToContract adds a farmer to a contract
func (*Booster) DisplayName ¶
DisplayName returns the booster's display name, falling back through Nick, Name, UserName, GlobalName, and UserID.
type CompMap ¶
type CompMap struct {
Emoji string
ID string
Name string
Style dc.ButtonStyle
CustomID string
ComponentEmoji *dc.Emoji
}
CompMap is a cached set of components for this contract
type Contract ¶
type Contract struct {
ContractHash string // ContractID-CoopID
Location []*LocationData
CreatorID []string // Slice of creators
BannerURL string // URL for the contract banner
ContractID string // Contract ID
CoopID string // CoopID
PredictionSignup bool // True if this contract is/was a prediction
WasPredictedContract bool // True if this contract was created as a prediction contract
PredictionsList []string // List of predictions for this contract
PredictionInfo []PredictionInfo // Cached info for predictions
SeasonalScoring int // 1 = new scoring
Name string
Description string
Egg int32
EggName string
EggEmoji string
TokenStr string // Emoji for Token
ChickenRuns int // Number of Chicken Runs for this contract
ChickenRunCooldownMinutes int
MinutesPerToken int
EstimatedDuration time.Duration
CompletionDuration time.Duration
EstimatedEndTime time.Time
EstimatedDurationValid bool
ThreadName string
ThreadRenameTime time.Time
ThreadRenameFinalized bool
EstimateUpdateTime time.Time
LastLobbyPingTime time.Time
TimeBoosting time.Time // When the contract boost started
CoopSize int
Ultra bool
UltraCount int
Style int64 // Mask for the Contract Style
PlayStyle int // Playstyle of the contract
NewToPlayStyle bool // Someone in the contract is new to this playstyle
ThresholdTokensX int // X tokens for >= A TE
ThresholdTokensY int // Y tokens < A TE
ThresholdTokensA int // A TE threshold
LengthInSeconds int
BoostOrder int // How the contract is sorted
BoostVoting int
CurrentBoosterUserID string // Current booster UserID (source of truth)
BoostPosition int // Starting Slot
State int // Boost Completed
StartTime time.Time // When Contract is started
EndTime time.Time // When final booster ends
PlannedStartTime time.Time // Parameter start time
ActualStartTime time.Time // Actual start time for token tracking
ValidFrom time.Time // Base time used for offsets (9 AM PT of creation day)
RegisteredNum int
Boosters map[string]*Booster // Boosters Registered
CRMessageIDs map[string]string // CR reqest messageIDs
CRNoticeCount int // Number of times CR dialog has been displayed
WaitlistBoosters []string // Waitlist of UserID's
Order []string
OriginalOrder []string // Initial sorted order when contract boosting starts
BoostedOrder []string // Actual order of boosting
OrderRevision int // Incremented when Order is changed
Banker BankerInfo // Banker for the contract
TokenLog []ei.TokenUnitLog
LastPublishedTokenLogIndex int `json:"last_published_token_log_index"`
LastPublishedStates map[string]int `json:"last_published_states"`
TokensPerMinute float64
CalcOperations int
CalcOperationTime time.Time
CoopTokenValueMsgID string
LastWishPrompt string // saved prompt for this contract
LastInteractionTime time.Time // last time the contract was drawn
HelpGuidanceUntil time.Time // Show bottom guidance while now is before this timestamp
NewFeature int // Used to slide in new features
CustomOrderLines []string // Custom boost order rules (up to 4 rows)
CustomOrderName string // Custom boost order name
DynamicData *DynamicTokenData
LastSaveTime time.Time // The last time the contract was saved
ThematicComplaints []string `json:"thematic_complaints,omitempty"`
// contains filtered or unexported fields
}
Contract is the main struct for each contract
func CreateContract ¶
func CreateContract(client dc.Client, contractID string, coopID string, playStyle int, coopSize int, BoostOrder int, guildID string, channelID string, progenitors []string, userID string, plannedStartTime time.Time, validFrom time.Time) (*Contract, error)
CreateContract creates a new contract or joins an existing contract if run from a different location
func FindContract ¶
FindContract will find the contract by the guildID and channelID
func FindContractByHash ¶
FindContractByHash will find a contract by its hash
func FindContractByIDs ¶
FindContractByIDs will find the contract by the contractID and coopID, optionally filtering by channelID if it is a TBD coop
func FindContractByMessageID ¶
FindContractByMessageID will find the contract by the messageID
func (*Contract) IsOrWasPrediction ¶
IsOrWasPrediction returns true if the contract is currently a prediction contract or was created as a prediction contract.
func (*Contract) UnmarshalJSON ¶
UnmarshalJSON handles backward compatibility for CRMessageIDs which used to be stored as an array but is now a map[string]string
type ContractAvailability ¶
type ContractAvailability struct {
Contract []string // list of contractIDs they want to run
Timeslots []string // list of timeslots they are available for, in the format "Monday 9-11am PT"
}
ContractAvailability holds the data for a user's availability for a contract
type ContractComplaint ¶
type ContractDatum ¶
type ContractDatum struct {
Channelid string
Contractid string
Coopid string
Value sql.NullString
}
type ContractDurationEstimate ¶
type ContractDurationEstimate struct {
Upper time.Duration
Lower time.Duration
Max time.Duration
SIAB time.Duration
MaxGG time.Duration
SIABGG time.Duration
SIABCompass bool
SIABGGCompass bool
MaxCompass bool
MaxGGCompass bool
UpperCompass bool
LowerCompass bool
}
ContractDurationEstimate groups the various duration estimates produced by getContractDurationEstimate.
type ContractRole ¶
type ContractSandboxOptions ¶
type ContractSandboxOptions struct {
TargetEggOverride *float64
TokenTimerMinutesOverride *int
ContractLengthSecondsOverride *int
CxpToggleOverride *bool
}
ContractSandboxOptions allows callers to override derived values when generating sandbox data from a Contract.
type ContractScore ¶
type ContractScore struct {
// contains filtered or unexported fields
}
ContractScore holds all the relevant information for calculating and displaying contract scores for contracts
func DownloadCoopStatusTeamwork ¶
func DownloadCoopStatusTeamwork(channelID string, contractID string, coopID string, setContractEstimate bool, eeidOverride string) (string, map[string][]TeamworkOutputData, ContractScore)
DownloadCoopStatusTeamwork will download the coop status for a given contract and coop ID
type CustomBoostOrderTemplate ¶
type CustomBoostOrderTemplate struct {
Name string `json:"name"`
Lines []string `json:"lines"` // 3 tiebreaker levels
CreatorID string `json:"creator_id,omitempty"`
IsGlobal bool `json:"is_global,omitempty"`
}
CustomBoostOrderTemplate represents a named custom boost order definition.
func FindCustomOrderTemplate ¶
func FindCustomOrderTemplate(userID string, name string) *CustomBoostOrderTemplate
FindCustomOrderTemplate searches for a template by name across user and global orders.
func GetGlobalCustomOrders ¶
func GetGlobalCustomOrders() []CustomBoostOrderTemplate
GetGlobalCustomOrders returns all globally published custom boost order templates.
func GetUserCustomOrders ¶
func GetUserCustomOrders(userID string) []CustomBoostOrderTemplate
GetUserCustomOrders returns all custom boost order templates saved by a user.
type CustomCriterionType ¶
type CustomCriterionType int
CustomCriterionType enumerates the metric types in custom boost order rules.
const ( CritDeflEffort CustomCriterionType = iota CritCraftDefl CritIHR CritELR CritTE CritTokens CritTVal CritDefl CritDeflSlot CritDeliv CritSignup CritReverse CritRandom CritRole CritArtifactCount CritArtifactCraft CritArtifactHas CritArtifactScore CritCraftingXP CritBoostCount CritGE CritEB CritSE CritCTE CritPrestige CritDrone CritEliteDrone CritManual CritTime CritUnknown )
type CustomOrderSession ¶
type DefineOrderSession ¶
type DeliveryTimeValue ¶
type DeliveryTimeValue struct {
// contains filtered or unexported fields
}
DeliveryTimeValue is a struct to hold the values for a delivery time
type DynamicTokenData ¶
type DynamicTokenData struct {
TokenTimer int
TE int64
HabNumber int64
OfflineIHR int64
Name string
ELR float64
TokenBoost [13]float64
BoostTimeMinutes [13]float64
ChickenRunTimeMinutes [13]float64
IhrBase int64
FourHabsOffline int64
MaxHab float64
ChickenRunHab float64
IHRMultiplier float64
ColleggtibleIHR float64
}
DynamicTokenData is a struct that holds the data needed to calculate dynamic tokens
type ExternalContractBookmark ¶
type ExternalContractBookmark struct {
ContractID string `json:"contract_id"`
CoopID string `json:"coop_id"`
ChannelID string `json:"channel_id"`
GuildID string `json:"guild_id,omitempty"`
GuildName string `json:"guild_name,omitempty"`
ChannelName string `json:"channel_name,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
ExternalContractBookmark represents a bookmark for an external contract
type GetActiveContractsRow ¶
type GetActiveContractsRow struct {
Contracthash interface{}
Value sql.NullString
}
type GuildRole ¶
GuildRole identifies the Discord role used for contract pings.
Only the ID and Name of a role are ever needed, so this holds those directly rather than embedding a library type. LocationData is persisted as JSON inside the Contract blob, and keeping a local type here means the stored shape does not change when the Discord library is updated or replaced.
The `id` and `name` JSON tags match the ones the library uses, so contracts written before this type existed still unmarshal without a data migration.
type InsertContractParams ¶
type InsertContractParams struct {
Channelid string
Contractid string
Coopid string
Value sql.NullString
}
type LocationData ¶
type LocationData struct {
GuildID string
GuildName string
ChannelID string // Contract Discord ThreadID
ChannelMention string // Mention string for the thread
GuildContractRole GuildRole
RoleManagedByBot bool // True when the contract role name/role is created or managed by the bot
RoleMention string
ListMsgID string // Message ID for the Last Boost Order message
ReactionID string // Message ID for the reaction Order String
MessageIDs []string // Array of message IDs for any contract message
TokenXStr string // Emoji for Token
TokenXReactionStr string // Emoji for Token Reaction
}
LocationData holds server specific Data for a contract
type MissingContract ¶
type ParsedFarmer ¶
ParsedFarmer holds the categorized input for a farmer being added to a contract
func ParseFarmerInput ¶
func ParseFarmerInput(farmerInput string) []ParsedFarmer
ParseFarmerInput splits and categorizes a comma-separated string of farmers
type PeriodicalsRefresherFunc ¶
PeriodicalsRefresherFunc triggers an update of periodicals / contracts / events from Egg Inc API.
type PlayerScoreParameters ¶
type PlayerScoreParameters struct {
// contains filtered or unexported fields
}
PlayerScoreParameters holds player specific parameters for calculating scores
type PredictionInfo ¶
PredictionInfo holds cached data for predicted contracts
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CountContractsByChannel ¶
func (*Queries) DeleteAllContractComplaints ¶
func (*Queries) DeleteAllContractRoles ¶
func (*Queries) DeleteContractByChannel ¶
func (*Queries) DeleteContractComplaints ¶
func (*Queries) DeleteContractRoles ¶
func (*Queries) DeleteMissingContract ¶
func (*Queries) GetActiveContracts ¶
func (q *Queries) GetActiveContracts(ctx context.Context) ([]GetActiveContractsRow, error)
func (*Queries) GetContractByChannelID ¶
func (*Queries) GetContractComplaints ¶
func (q *Queries) GetContractComplaints(ctx context.Context) ([]ContractComplaint, error)
func (*Queries) GetContractRoles ¶
func (q *Queries) GetContractRoles(ctx context.Context) ([]ContractRole, error)
func (*Queries) GetMissingContracts ¶
func (q *Queries) GetMissingContracts(ctx context.Context) ([]MissingContract, error)
func (*Queries) InsertContract ¶
func (q *Queries) InsertContract(ctx context.Context, arg InsertContractParams) error
func (*Queries) InsertContractComplaint ¶
func (q *Queries) InsertContractComplaint(ctx context.Context, arg InsertContractComplaintParams) error
func (*Queries) InsertContractRole ¶
func (q *Queries) InsertContractRole(ctx context.Context, arg InsertContractRoleParams) error
func (*Queries) InsertMissingContract ¶
func (q *Queries) InsertMissingContract(ctx context.Context, arg InsertMissingContractParams) error
func (*Queries) UpdateContract ¶
func (*Queries) UpdateContractCoopID ¶
func (q *Queries) UpdateContractCoopID(ctx context.Context, arg UpdateContractCoopIDParams) error
func (*Queries) UpdateContractState ¶
func (q *Queries) UpdateContractState(ctx context.Context, arg UpdateContractStateParams) error
type SandboxPlayer ¶
type SandboxPlayer struct {
Name string // Player name
Tokens string // Player tokens used
TE string // Truth Egg (TE) count
Mirror bool // True if mirror (+1 token)
Colleggtible bool // True if player has all collectibles
Sink bool // True if sink (no tval)
Creator bool // True if creator (no join delay)
Item1 string // Item slot 1
Item2 string // Item slot 2
Item3 string // Item slot 3
Item4 string // Item slot 4
Item5 string // Item slot 5
Item6 string // Item slot 6
Item7 string // Item slot 7
Item8 string // Item slot 8
}
SandboxPlayer stores player-related data.
type ScoreCalcParams ¶
type ScoreCalcParams struct {
Grade ei.Contract_PlayerGrade `json:"grade"`
Deflector float64 `json:"deflector"`
DeflectorDownMinutes int `json:"deflector_down_minutes"`
Siab float64 `json:"siab"`
SiabMinutes int `json:"siab_minutes"`
Style int `json:"style"`
PlayStyleValues []float64 `json:"play_style_values"`
ChickenRuns int
SiabTimes []int `json:"siab_times"`
SiabIndex int `json:"siab_index"`
DeflIndex int `json:"defl_index"`
// contains filtered or unexported fields
}
ScoreCalcParams is the parameters for the score calculator
type StatusMessagesRefresherFunc ¶
StatusMessagesRefresherFunc triggers a download and reload of status messages.
type TableImageCell ¶
type TableImageColumn ¶
type TableImageColumn struct {
Label string
Align bottools.StringAlign
}
type TableImageRow ¶
type TableImageRow struct {
Cells []TableImageCell
}
type TeamworkOutputData ¶
TeamworkOutputData is a struct to hold the output data for teamwork fields
type ThematicComplaintsGeneratorFunc ¶
type ThematicComplaintsGeneratorFunc func(eggName string, contractName string, contractDescription string, quantity int) []string
ThematicComplaintsGeneratorFunc generates contract-themed complaints.
type TokenComplaintsRefresherFunc ¶
TokenComplaintsRefresherFunc triggers a download and reload of token complaints.
type TokenUnit ¶
type TokenUnit struct {
Time time.Time // Time token was received
Value float64 // Last calculated value of the token
UserID string // Who sent or received the token
Serial string // Serial number of the token
}
TokenUnit holds the data for each token
type UpdateContractParams ¶
type UpdateContractParams struct {
Value sql.NullString
Channelid string
Contractid string
Coopid string
}
Source Files
¶
- admin_contract_list.go
- admin_tasks.go
- amqp.go
- artifacts.go
- availability.go
- boost.go
- boost_admin.go
- boost_alternates.go
- boost_autocomplete.go
- boost_button_reactions.go
- boost_calctval.go
- boost_change.go
- boost_cooptval.go
- boost_datastore.go
- boost_draw.go
- boost_handlers.go
- boost_import.go
- boost_menu.go
- boost_order.go
- boost_order_custom.go
- boost_order_define.go
- boost_reactions.go
- boost_sink.go
- boost_slashcmd.go
- boost_speedrun.go
- boost_track.go
- boost_wish.go
- command_shape.go
- contract.go
- contract_active.go
- contract_report.go
- contract_sandbox.go
- contract_scores.go
- coop_status_permission.go
- db.go
- dynamictokens.go
- eggidmodal.go
- estimate_scores.go
- estimate_time.go
- help.go
- leaderboard.go
- leaderboard_permission.go
- lobby.go
- mention.go
- message_redraw.go
- models.go
- predictions.go
- predictions_embeded.go
- query.sql.go
- register.go
- rerun-active.go
- rerun-chart.go
- rerun.go
- roles.go
- score_explorer.go
- sr_sandbox.go
- state_banker.go
- stones.go
- stones_pages.go
- table_image.go
- teamwork.go
- teamwork_pages.go
- thread.go
- types.go
- update_change.go
- update_farmer.go