Documentation
¶
Index ¶
- Constants
- Variables
- func AddBoostTokens(s *discordgo.Session, i *discordgo.InteractionCreate, setCountWant int, ...) (int, int, error)
- func AddBoostTokensInteraction(s *discordgo.Session, i *discordgo.InteractionCreate, setCountWant int, ...)
- func AddContractMember(s *discordgo.Session, guildID string, channelID string, operator string, ...) error
- func AdvancedTransform(key string) *diskv.PathKey
- func ArchiveContracts(s *discordgo.Session)
- func Boosting(s *discordgo.Session, guildID string, channelID string) error
- func ChangeBoostOrder(s *discordgo.Session, guildID string, channelID string, userID string, ...) (string, error)
- func ChangeContractIDs(s *discordgo.Session, guildID string, channelID string, userID string, ...) error
- func ChangeCurrentBooster(s *discordgo.Session, guildID string, channelID string, userID string, ...) error
- func ContractReport(s *discordgo.Session, i *discordgo.InteractionCreate, ...) error
- func DeleteContract(s *discordgo.Session, guildID string, channelID string) (string, error)
- func DownloadCoopStatusStones(contractID string, coopID string, details bool, soloName string, ...) (string, string, []*discordgo.MessageEmbedField)
- func DownloadCoopStatusTeamwork(contractID string, coopID string) (string, map[string][]TeamworkOutputData, string)
- func DrawBoostList(s *discordgo.Session, contract *Contract) []discordgo.MessageComponent
- func EncodeData(cxpToggle bool, targetEgg float64, tokenTimer string, ...) (string, error)
- func FindEggEmoji(eggOrig string) string
- func FinishContract(s *discordgo.Session, contract *Contract)
- func FmtActiveModifier(c *ei.EggIncContract) (string, int)
- func FmtNumberSingleUnit(v float64, srSandboxOrdering bool) (string, int)
- func GetContractDescription(channelID string) string
- func GetHelp(s *discordgo.Session, guildID string, channelID string, userID string) *discordgo.MessageSend
- func GetPredictionsCommand(cmd string) *discordgo.ApplicationCommand
- func GetSignupComponents(contract *Contract) (string, []discordgo.MessageComponent)
- func GetSlasLinkAlternateCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashCalcContractTval(cmd string) *discordgo.ApplicationCommand
- func GetSlashChangeCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashChangeOneBoosterCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashChangePingRoleCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashChangePlannedStartCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashChangeSpeedRunSinkCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashContractCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashContractReportCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashCoopTval(cmd string) *discordgo.ApplicationCommand
- func GetSlashCsEstimates(cmd string) *discordgo.ApplicationCommand
- func GetSlashEstimateTime(cmd string) *discordgo.ApplicationCommand
- func GetSlashHelpCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashRegisterCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashRenameThread(cmd string) *discordgo.ApplicationCommand
- func GetSlashReplayEvalCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashScoreExplorerCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashSpeedrunCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashStones(cmd string) *discordgo.ApplicationCommand
- func GetSlashTeamworkEval(cmd string) *discordgo.ApplicationCommand
- func GetSlashTimer(cmd string) *discordgo.ApplicationCommand
- func GetSlashTokenEditCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashUpdateCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashVirtueCommand(cmd string) *discordgo.ApplicationCommand
- func GetSlashVolunteerSink(cmd string) *discordgo.ApplicationCommand
- func GetSlashVoluntellSink(cmd string) *discordgo.ApplicationCommand
- func GetTargetBuffTimeValue(cxpVersion int, durationSec float64) float64
- func GetTargetTval(cxpVersion int, contractMinutes float64, minutesPerToken float64) float64
- func GetWish(guildID string, channelID string) string
- func HandleAdminContractFinish(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleAdminContractList(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleAdminGetContractData(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleAdminListRoles(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleAllContractsAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleAltsAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleArtifactCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleArtifactReactions(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleBoostCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleBumpCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleChangeCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleChangeOneBoosterCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleChangePingRoleCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleChangePlannedStartCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleChangeSpeedrunSinkCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleContractAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleContractCalcContractTvalCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleContractCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleContractDelete(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleContractReactions(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleContractReport(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleContractSettingsCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleContractSettingsReactions(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleCoopAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleCoopETACommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleCoopTvalCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleCsEstimatesCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleEggIDModalSubmit(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleEstimateTimeCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleHelpCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleJoinCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleLinkAlternateAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleLinkAlternateCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleMenuReactions(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandlePredictionsCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandlePruneCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleRegister(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleRenameThreadCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleReplayEval(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleScoreExplorerCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleScoreExplorerPage(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleSignupsPage(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleSkipCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleSlashVolunteerSinkCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleSlashVoluntellSinkCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleSpeedrunCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleStonesCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleStonesPage(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleTeamworkEvalCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleTeamworkPage(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleTimerCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleToggleContractPingsCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleTokenCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleTokenEditCommand(s *discordgo.Session, i *discordgo.InteractionCreate) string
- func HandleTokenIDAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate) (string, []*discordgo.ApplicationCommandOptionChoice)
- func HandleTokenListAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate) (string, []*discordgo.ApplicationCommandOptionChoice)
- func HandleTokenReceiverAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate) (string, []*discordgo.ApplicationCommandOptionChoice)
- func HandleUnboostCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleUpdateCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
- func HandleVirtue(s *discordgo.Session, i *discordgo.InteractionCreate)
- func InverseTransform(pathKey *diskv.PathKey) (key string)
- func IsUserCreatorOfAnyContract(s *discordgo.Session, userID string) bool
- func JoinContract(s *discordgo.Session, guildID string, channelID string, userID string, ...) error
- func LaunchIndependentTimers(s *discordgo.Session)
- func LoadContractData(filename string)
- func MoveBooster(s *discordgo.Session, guildID string, channelID string, userID string, ...) error
- func PopulateContractFromProto(contractProtoBuf *ei.Contract) ei.EggIncContract
- func ProductionSchedule(targetEggAmount float64, initialElr float64, deltaElr float64, alpha float64, ...) (switchTime time.Time, switchTimestamp int64, finishTimeWithSwitch time.Time, ...)
- func ReactionAdd(s *discordgo.Session, r *discordgo.MessageReaction) string
- func ReactionRemove(s *discordgo.Session, r *discordgo.MessageReaction)
- func RedrawBoostList(s *discordgo.Session, guildID string, channelID string) error
- func RemoveAddedReaction(s *discordgo.Session, r *discordgo.MessageReaction)
- func RemoveFarmerByMention(s *discordgo.Session, guildID string, channelID string, operator string, ...) error
- func ReplayEval(s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- func RequestEggIncIDModal(s *discordgo.Session, i *discordgo.InteractionCreate, action string, ...)
- func SaveAllData()
- func SetListMessageID(contract *Contract, channelID string, messageID string)
- func SetReactionID(contract *Contract, channelID string, reactionID string)
- func SetWish(guildID string, channelID string, wish string) error
- func SkipBooster(s *discordgo.Session, guildID string, channelID string, userID string) error
- func SlashAdminGetContractData(cmd string) *discordgo.ApplicationCommand
- func SlashAdminListRoles(cmd string) *discordgo.ApplicationCommand
- func SlashArtifactsCommand(cmd string) *discordgo.ApplicationCommand
- func StartContractBoosting(s *discordgo.Session, guildID string, channelID string, userID string) error
- func Unboost(s *discordgo.Session, guildID string, channelID string, mention string) error
- func UpdateContractTime(contractID string, coopID string, startTime time.Time, ...)
- func UpdateThreadName(s *discordgo.Session, contract *Contract)
- func UserBoost(s *discordgo.Session, guildID string, channelID string, userID string) error
- func Virtue(s *discordgo.Session, i *discordgo.InteractionCreate, ...)
- type ArtifactSet
- type BankerInfo
- type Booster
- type BotTimer
- type CompMap
- type Contract
- func CreateContract(s *discordgo.Session, contractID string, coopID string, playStyle int, ...) (*Contract, error)
- func FindContract(channelID string) *Contract
- func FindContractByHash(hash string) *Contract
- func FindContractByIDs(contractID string, coopID string) *Contract
- func FindContractByMessageID(channelID string, messageID string) *Contract
- type ContractDatum
- type ContractDurationEstimate
- type DBTX
- type DeliveryTimeValue
- type DynamicTokenData
- type GetActiveContractsRow
- type InsertContractParams
- type LocationData
- type ProductionScheduleParams
- type Queries
- func (q *Queries) CountContractsByChannel(ctx context.Context, channelid string) (int64, error)
- func (q *Queries) DeleteContractByChannel(ctx context.Context, channelid 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) InsertContract(ctx context.Context, arg InsertContractParams) 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 ScoreCalcParams
- type TeamworkOutputData
- type TokenUnit
- type UpdateContractCoopIDParams
- type UpdateContractParams
- type UpdateContractStateParams
Constants ¶
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. ContractOrderFair = 3 // Fair based on position percentile of each farmers last 5 contracts. Those with no history use 50th percentile 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 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 ContractFlagFastrun = 0x4000 ContractFlagBanker = 0x8000 ContractStyleFastrun = ContractFlagFastrun ContractStyleFastrunBanker = ContractFlagBanker ContractPlaystyleUnset = 0 // Unset ContractPlaystyleChill = 1 // Chill ContractPlaystyleACOCooperative = 2 // ACO Cooperative ContractPlaystyleFastrun = 3 // Fastrun ContractPlaystyleLeaderboard = 4 // Leaderboard )
Constnts for the contract
Variables ¶
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 ( // Contracts is a map of contracts and is saved to disk Contracts map[string]*Contract )
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
var TruthEggBreakpoints = []float64{
5e7,
1e9,
1e10,
7e10,
5e11,
2e12,
7e12,
2e13,
6e13,
1.5e14,
5e14,
1.5e15,
4e15,
1e16,
2.5e16,
5e16,
}
TruthEggBreakpoints is a slice containing all known tiers to 16 TE
Functions ¶
func AddBoostTokens ¶
func AddBoostTokens(s *discordgo.Session, i *discordgo.InteractionCreate, 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(s *discordgo.Session, i *discordgo.InteractionCreate, setCountWant int, countWantAdjust int)
AddBoostTokensInteraction handles the interactions responses for AddBoostTokens
func AddContractMember ¶
func AddContractMember(s *discordgo.Session, guildID string, channelID string, operator string, mention string, guest string, order int) error
AddContractMember adds a member to a contract
func AdvancedTransform ¶
AdvancedTransform for storing KV pairs
func ArchiveContracts ¶
ArchiveContracts will set a contract state to Archive if it is older than 5 days
func ChangeBoostOrder ¶
func ChangeBoostOrder(s *discordgo.Session, 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(s *discordgo.Session, guildID string, channelID string, userID string, contractID string, coopID string, coordinatorID string) error
ChangeContractIDs will change the contractID and/or coopID
func ChangeCurrentBooster ¶
func ChangeCurrentBooster(s *discordgo.Session, guildID string, channelID string, userID string, newBooster string, redraw bool) error
ChangeCurrentBooster will change the current booster to the specified userID
func ContractReport ¶
func ContractReport( s *discordgo.Session, i *discordgo.InteractionCreate, optionMap map[string]*discordgo.ApplicationCommandInteractionDataOption, 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
- optionMap: slash-command options (e.g., "contract-id", "refresh").
- userID: Discord user ID of the caller
- okayToSave: whether API fetches may be cached/persisted.
Returns:
- error: nil on success.
func DeleteContract ¶
DeleteContract will delete the contract
func DownloadCoopStatusStones ¶
func DownloadCoopStatusStones(contractID string, coopID string, details bool, soloName string, useBuffHistory bool) (string, string, []*discordgo.MessageEmbedField)
DownloadCoopStatusStones will download the coop status for a given contract and coop ID
func DownloadCoopStatusTeamwork ¶
func DownloadCoopStatusTeamwork(contractID string, coopID string) (string, map[string][]TeamworkOutputData, string)
DownloadCoopStatusTeamwork will download the coop status for a given contract and coop ID
func DrawBoostList ¶
func DrawBoostList(s *discordgo.Session, contract *Contract) []discordgo.MessageComponent
DrawBoostList will draw the boost list for the contract
func EncodeData ¶
func EncodeData(cxpToggle bool, targetEgg float64, tokenTimer string, contractLengthInSeconds, numPlayers int, c *ei.EggIncContract) (string, error)
EncodeData generates and encodes configuration data for the SR Sandbox v-5.
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): number of players.
- c (*ei.EggIncContract): pointer to the contract data.
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 GetContractDescription ¶
GetContractDescription gets the description for a contract identified by the channel ID.
func GetHelp ¶
func GetHelp(s *discordgo.Session, guildID string, channelID string, userID string) *discordgo.MessageSend
GetHelp will return the help string for the contract
func GetPredictionsCommand ¶
func GetPredictionsCommand(cmd string) *discordgo.ApplicationCommand
GetPredictionsCommand returns the command for the /signups command
func GetSignupComponents ¶
func GetSignupComponents(contract *Contract) (string, []discordgo.MessageComponent)
GetSignupComponents returns the signup components for a contract
func GetSlasLinkAlternateCommand ¶
func GetSlasLinkAlternateCommand(cmd string) *discordgo.ApplicationCommand
GetSlasLinkAlternateCommand allows a player to associate an alt
func GetSlashCalcContractTval ¶
func GetSlashCalcContractTval(cmd string) *discordgo.ApplicationCommand
GetSlashCalcContractTval calculates the callers token value of a running contract
func GetSlashChangeCommand ¶
func GetSlashChangeCommand(cmd string) *discordgo.ApplicationCommand
GetSlashChangeCommand adjust aspects of a running contract
func GetSlashChangeOneBoosterCommand ¶
func GetSlashChangeOneBoosterCommand(cmd string) *discordgo.ApplicationCommand
GetSlashChangeOneBoosterCommand adjust aspects of a running contract
func GetSlashChangePingRoleCommand ¶
func GetSlashChangePingRoleCommand(cmd string) *discordgo.ApplicationCommand
GetSlashChangePingRoleCommand adjust aspects of a running contract
func GetSlashChangePlannedStartCommand ¶
func GetSlashChangePlannedStartCommand(cmd string) *discordgo.ApplicationCommand
GetSlashChangePlannedStartCommand adjust aspects of a running contract
func GetSlashChangeSpeedRunSinkCommand ¶
func GetSlashChangeSpeedRunSinkCommand(cmd string) *discordgo.ApplicationCommand
GetSlashChangeSpeedRunSinkCommand returns the slash command for changing speedrun sink assignments
func GetSlashContractCommand ¶
func GetSlashContractCommand(cmd string) *discordgo.ApplicationCommand
GetSlashContractCommand returns the slash command for creating a contract
func GetSlashContractReportCommand ¶
func GetSlashContractReportCommand(cmd string) *discordgo.ApplicationCommand
GetSlashContractReportCommand returns the command for the /contract-report command
func GetSlashCoopTval ¶
func GetSlashCoopTval(cmd string) *discordgo.ApplicationCommand
GetSlashCoopTval calculates the coop token value of a running contract
func GetSlashCsEstimates ¶
func GetSlashCsEstimates(cmd string) *discordgo.ApplicationCommand
GetSlashCsEstimates returns the slash command for estimating scores
func GetSlashEstimateTime ¶
func GetSlashEstimateTime(cmd string) *discordgo.ApplicationCommand
GetSlashEstimateTime is the definition of the slash command
func GetSlashHelpCommand ¶
func GetSlashHelpCommand(cmd string) *discordgo.ApplicationCommand
GetSlashHelpCommand returns the command for the /help command
func GetSlashRegisterCommand ¶
func GetSlashRegisterCommand(cmd string) *discordgo.ApplicationCommand
GetSlashRegisterCommand returns the /register command
func GetSlashRenameThread ¶
func GetSlashRenameThread(cmd string) *discordgo.ApplicationCommand
GetSlashRenameThread is the definition of the slash command
func GetSlashReplayEvalCommand ¶
func GetSlashReplayEvalCommand(cmd string) *discordgo.ApplicationCommand
GetSlashReplayEvalCommand returns the command for the /launch-helper command
func GetSlashScoreExplorerCommand ¶
func GetSlashScoreExplorerCommand(cmd string) *discordgo.ApplicationCommand
GetSlashScoreExplorerCommand returns the slash command for token tracking
func GetSlashSpeedrunCommand ¶
func GetSlashSpeedrunCommand(cmd string) *discordgo.ApplicationCommand
GetSlashSpeedrunCommand returns the slash command for speedrun
func GetSlashStones ¶
func GetSlashStones(cmd string) *discordgo.ApplicationCommand
GetSlashStones will return the discord command for calculating ideal stone set
func GetSlashTeamworkEval ¶
func GetSlashTeamworkEval(cmd string) *discordgo.ApplicationCommand
GetSlashTeamworkEval will return the discord command for calculating token values of a running contract
func GetSlashTimer ¶
func GetSlashTimer(cmd string) *discordgo.ApplicationCommand
GetSlashTimer will return the discord command for calculating ideal stone set
func GetSlashTokenEditCommand ¶
func GetSlashTokenEditCommand(cmd string) *discordgo.ApplicationCommand
GetSlashTokenEditCommand returns the slash command for token tracking removal
func GetSlashUpdateCommand ¶
func GetSlashUpdateCommand(cmd string) *discordgo.ApplicationCommand
GetSlashUpdateCommand returns the /update slash command with main subcommand groups for farmer and contract
func GetSlashVirtueCommand ¶
func GetSlashVirtueCommand(cmd string) *discordgo.ApplicationCommand
GetSlashVirtueCommand returns the command for the /launch-helper command
func GetSlashVolunteerSink ¶
func GetSlashVolunteerSink(cmd string) *discordgo.ApplicationCommand
GetSlashVolunteerSink is used to volunteer as token sink for a contract
func GetSlashVoluntellSink ¶
func GetSlashVoluntellSink(cmd string) *discordgo.ApplicationCommand
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 HandleAdminContractFinish ¶
func HandleAdminContractFinish(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleAdminContractFinish is called when the contract is complete
func HandleAdminContractList ¶
func HandleAdminContractList(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleAdminContractList will list all contracts
func HandleAdminGetContractData ¶
func HandleAdminGetContractData(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleAdminGetContractData get JSON data about a contract given the contract and coop id
func HandleAdminListRoles ¶
func HandleAdminListRoles(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleAdminListRoles is the handler for the list roles command
func HandleAllContractsAutoComplete ¶
func HandleAllContractsAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleAllContractsAutoComplete will handle the contract auto complete of contract-id's default to new contracts but allow searching all contracts
func HandleAltsAutoComplete ¶
func HandleAltsAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleAltsAutoComplete will populate with linked alternate names
func HandleArtifactCommand ¶
func HandleArtifactCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleArtifactCommand handles the /artifacts command
func HandleArtifactReactions ¶
func HandleArtifactReactions(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleArtifactReactions handles all the button reactions for a contract settings
func HandleBoostCommand ¶
func HandleBoostCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleBoostCommand will handle the /boost command
func HandleBumpCommand ¶
func HandleBumpCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleBumpCommand will handle the /bump command
func HandleChangeCommand ¶
func HandleChangeCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleChangeCommand will handle the /change command
func HandleChangeOneBoosterCommand ¶
func HandleChangeOneBoosterCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleChangeOneBoosterCommand will handle the /change-one-booster command
func HandleChangePingRoleCommand ¶
func HandleChangePingRoleCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleChangePingRoleCommand will handle the /change-ping-role command
func HandleChangePlannedStartCommand ¶
func HandleChangePlannedStartCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleChangePlannedStartCommand will handle the /change--planned-start command
func HandleChangeSpeedrunSinkCommand ¶
func HandleChangeSpeedrunSinkCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleChangeSpeedrunSinkCommand handles the change speedrun sink command
func HandleContractAutoComplete ¶
func HandleContractAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleContractAutoComplete will handle the contract auto complete of contract-id's
func HandleContractCalcContractTvalCommand ¶
func HandleContractCalcContractTvalCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleContractCalcContractTvalCommand will handle the /contract-token-tval command
func HandleContractCommand ¶
func HandleContractCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleContractCommand will handle the /contract command
func HandleContractDelete ¶
func HandleContractDelete(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleContractDelete facilitates the deletion of a channel contract
func HandleContractReactions ¶
func HandleContractReactions(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleContractReactions handles all the button reactions for a contract
func HandleContractReport ¶
func HandleContractReport(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleContractReport handles the /contract-report command
func HandleContractSettingsCommand ¶
func HandleContractSettingsCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleContractSettingsCommand will handle the /contract-settings command
func HandleContractSettingsReactions ¶
func HandleContractSettingsReactions(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleContractSettingsReactions handles all the button reactions for a contract settings
func HandleCoopAutoComplete ¶
func HandleCoopAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleCoopAutoComplete will handle the contract auto complete of contract-id's
func HandleCoopETACommand ¶
func HandleCoopETACommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleCoopETACommand will handle the /coopeta command
func HandleCoopTvalCommand ¶
func HandleCoopTvalCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleCoopTvalCommand will handle the /contract-token-tval command
func HandleCsEstimatesCommand ¶
func HandleCsEstimatesCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleCsEstimatesCommand handles the estimate scores command
func HandleEggIDModalSubmit ¶
func HandleEggIDModalSubmit(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleEggIDModalSubmit handles the modal submission for an egginc ID
func HandleEstimateTimeCommand ¶
func HandleEstimateTimeCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleEstimateTimeCommand will handle the estimate-contract-time command
func HandleHelpCommand ¶
func HandleHelpCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleHelpCommand will handle the help command
func HandleJoinCommand ¶
func HandleJoinCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleJoinCommand will handle the /join command
func HandleLinkAlternateAutoComplete ¶
func HandleLinkAlternateAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleLinkAlternateAutoComplete will handle the /link-alternate autocomplete
func HandleLinkAlternateCommand ¶
func HandleLinkAlternateCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleLinkAlternateCommand will handle the /link-alternate command
func HandleMenuReactions ¶
func HandleMenuReactions(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleMenuReactions handles the menu reactions for the contract
func HandlePredictionsCommand ¶
func HandlePredictionsCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandlePredictionsCommand will handle the /signups command
func HandlePruneCommand ¶
func HandlePruneCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandlePruneCommand will handle the /prune command
func HandleRegister ¶
func HandleRegister(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleRegister handles the /register command
func HandleRenameThreadCommand ¶
func HandleRenameThreadCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleRenameThreadCommand will handle the thread rename command
func HandleReplayEval ¶
func HandleReplayEval(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleReplayEval handles the /replay-eval command
func HandleScoreExplorerCommand ¶
func HandleScoreExplorerCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleScoreExplorerCommand will handle the /playground command
func HandleScoreExplorerPage ¶
func HandleScoreExplorerPage(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleScoreExplorerPage steps a page of cached teamwork data
func HandleSignupsPage ¶
func HandleSignupsPage(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleSignupsPage handles interaction for signup pages
func HandleSkipCommand ¶
func HandleSkipCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleSkipCommand will handle the /skip command
func HandleSlashVolunteerSinkCommand ¶
func HandleSlashVolunteerSinkCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleSlashVolunteerSinkCommand is used to volunteer as token sink for a contract
func HandleSlashVoluntellSinkCommand ¶
func HandleSlashVoluntellSinkCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleSlashVoluntellSinkCommand is used to volunteer as token sink for a contract
func HandleSpeedrunCommand ¶
func HandleSpeedrunCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleSpeedrunCommand handles the speedrun command
func HandleStonesCommand ¶
func HandleStonesCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleStonesCommand will handle the /stones command
func HandleStonesPage ¶
func HandleStonesPage(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleStonesPage steps a page of cached stones data
func HandleTeamworkEvalCommand ¶
func HandleTeamworkEvalCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleTeamworkEvalCommand will handle the /teamwork command
func HandleTeamworkPage ¶
func HandleTeamworkPage(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleTeamworkPage steps a page of cached teamwork data
func HandleTimerCommand ¶
func HandleTimerCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleTimerCommand will handle the /stones command
func HandleToggleContractPingsCommand ¶
func HandleToggleContractPingsCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleToggleContractPingsCommand will handle the /toggle-contract-pings command
func HandleTokenCommand ¶
func HandleTokenCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleTokenCommand takes the main command and adds the current contract to the message
func HandleTokenEditCommand ¶
func HandleTokenEditCommand(s *discordgo.Session, i *discordgo.InteractionCreate) string
HandleTokenEditCommand will handle the /token-edit command
func HandleTokenIDAutoComplete ¶
func HandleTokenIDAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate) (string, []*discordgo.ApplicationCommandOptionChoice)
HandleTokenIDAutoComplete will handle the /token-edit token-id autocomplete
func HandleTokenListAutoComplete ¶
func HandleTokenListAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate) (string, []*discordgo.ApplicationCommandOptionChoice)
HandleTokenListAutoComplete will handle the /token-remove autocomplete
func HandleTokenReceiverAutoComplete ¶
func HandleTokenReceiverAutoComplete(s *discordgo.Session, i *discordgo.InteractionCreate) (string, []*discordgo.ApplicationCommandOptionChoice)
HandleTokenReceiverAutoComplete will handle the /token-edit new-receiver autocomplete
func HandleUnboostCommand ¶
func HandleUnboostCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleUnboostCommand will handle the /unboost command
func HandleUpdateCommand ¶
func HandleUpdateCommand(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleUpdateCommand handles the /update slash command
func HandleVirtue ¶
func HandleVirtue(s *discordgo.Session, i *discordgo.InteractionCreate)
HandleVirtue handles the /virtue command
func InverseTransform ¶
InverseTransform for storing KV pairs
func IsUserCreatorOfAnyContract ¶
IsUserCreatorOfAnyContract will return true if the user is the creator of any contract
func JoinContract ¶
func JoinContract(s *discordgo.Session, guildID string, channelID string, userID string, bell bool) error
JoinContract will add a user to the contract
func LaunchIndependentTimers ¶
LaunchIndependentTimers will start all the timers that are active
func LoadContractData ¶
func LoadContractData(filename string)
LoadContractData will load contract data from a file
func MoveBooster ¶
func MoveBooster(s *discordgo.Session, 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 PopulateContractFromProto ¶
func PopulateContractFromProto(contractProtoBuf *ei.Contract) ei.EggIncContract
PopulateContractFromProto will populate a contract from a protobuf
func ProductionSchedule ¶
func ProductionSchedule( targetEggAmount float64, initialElr float64, deltaElr float64, alpha float64, elapsedTimeSec float64, eggsShipped float64, startLocal time.Time, tz string, ) ( switchTime time.Time, switchTimestamp int64, finishTimeWithSwitch time.Time, finishTimestampWithSwitch int64, finishTimeWithoutSwitch time.Time, finishTimestampWithoutSwitch int64, err error, )
ProductionSchedule calculates key timestamps for a production schedule based on egg production.
Created by: James WST DiscordID: @james.wst Parameters:
targetEggAmount: float64 - Target Egg Amount in quadrillion eggs. (q = 10^15) initialElr: float64 - The initial elr from all players in quadrillion eggs per hour. (q/h) deltaElr: float64 - The change in ELR per hour due to one person SiaB->Gusset switching (q/h) alpha: float64 - The fraction of the total contract duration at which the switch occurs. 0 < alpha < 1. elapsedTimeSec: float64 - The elapsed time in seconds since the start of the contract. (s) eggsShipped: float64 - The number of eggs already shipped in quadrillion eggs. (q) startLocal: time.Time - The start time of the contract in local time. tz: string - The timezone of the start time, e.g., "Europe/Berlin".
Returns:
switchTime, switchTimestamp: (time.Time, int64) - The time and Unix timestamp when the switch occurs. finishTimeWithSwitch, finishTimestampWithSwitch: (time.Time, int64) - The time and Unix timestamp when the contract finishes with the switch. finishTimeWithoutSwitch, finishTimestampWithoutSwitch: (time.Time, int64) - The time and Unix timestamp when the contract finishes without the switch. err: error - An error if any calculation or timezone loading fails.
func ReactionAdd ¶
func ReactionAdd(s *discordgo.Session, r *discordgo.MessageReaction) string
ReactionAdd is called when a reaction is added to a message
func ReactionRemove ¶
func ReactionRemove(s *discordgo.Session, r *discordgo.MessageReaction)
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 RemoveAddedReaction ¶
func RemoveAddedReaction(s *discordgo.Session, r *discordgo.MessageReaction)
RemoveAddedReaction removes an added reaction from a message so it can be reactivated
func RemoveFarmerByMention ¶
func RemoveFarmerByMention(s *discordgo.Session, guildID string, channelID string, operator string, mention string) error
RemoveFarmerByMention will remove a booster from the contract by mention
func ReplayEval ¶
func ReplayEval(s *discordgo.Session, i *discordgo.InteractionCreate, optionMap map[string]*discordgo.ApplicationCommandInteractionDataOption, eiID string, okayToSave bool)
ReplayEval evaluates the contract history and provides replay guidance
func RequestEggIncIDModal ¶
func RequestEggIncIDModal(s *discordgo.Session, i *discordgo.InteractionCreate, action string, optionMap map[string]*discordgo.ApplicationCommandInteractionDataOption)
RequestEggIncIDModal sends a modal to the user requesting their Egg Inc ID
func SetListMessageID ¶
SetListMessageID will save the list messageID for the contract
func SetReactionID ¶
SetReactionID will save the reactionID for the contract
func SkipBooster ¶
SkipBooster will skip the current booster and move to the next
func SlashAdminGetContractData ¶
func SlashAdminGetContractData(cmd string) *discordgo.ApplicationCommand
SlashAdminGetContractData is the slash to get contract JSON data
func SlashAdminListRoles ¶
func SlashAdminListRoles(cmd string) *discordgo.ApplicationCommand
SlashAdminListRoles is the slash to info about bot roles
func SlashArtifactsCommand ¶
func SlashArtifactsCommand(cmd string) *discordgo.ApplicationCommand
SlashArtifactsCommand creates a new slash command for setting Egg, Inc name
func StartContractBoosting ¶
func StartContractBoosting(s *discordgo.Session, guildID string, channelID string, userID string) error
StartContractBoosting will start the contract
func UpdateContractTime ¶
func UpdateContractTime(contractID string, coopID string, startTime time.Time, contractDurationSeconds float64)
UpdateContractTime will update the contract start time and estimated duration
func UpdateThreadName ¶
UpdateThreadName will update a threads name to the current contract state
Types ¶
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 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
AltsIcons []string // Array of alternate icons for the user
AltController string // User ID of the controller of this alternate
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
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
}
Booster holds the data for each booster within a Contract
type BotTimer ¶
type BotTimer struct {
ID string // Unique ID for this timer
Reminder time.Time
Message string
UserID string
ChannelID string
MsgID string
Active bool
// contains filtered or unexported fields
}
BotTimer holds the data for each timer
type CompMap ¶
type CompMap struct {
Emoji string
ID string
Name string
Style discordgo.ButtonStyle
CustomID string
ComponentEmoji *discordgo.ComponentEmoji
}
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
//SignupMsgID map[string]string // Message ID for the Signup Message
ContractID string // Contract ID
CoopID string // CoopID
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
EstimateUpdateTime 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
LengthInSeconds int
BoostOrder int // How the contract is sorted
BoostVoting int
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
RegisteredNum int
Boosters map[string]*Booster // Boosters Registered
CRMessageIDs map[string]string // CR reqest messageIDs
WaitlistBoosters []string // Waitlist of UserID's
AltIcons []string // Array of alternate icons for the Boosters
Order []string
BoostedOrder []string // Actual order of boosting
OrderRevision int // Incremented when Order is changed
Banker BankerInfo // Banker for the contract
TokenLog []ei.TokenUnitLog
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
SavedStats bool // Saved stats for this contract
NewFeature int // Used to slide in new features
DynamicData *DynamicTokenData
LastSaveTime time.Time // The last time the contract was saved
// contains filtered or unexported fields
}
Contract is the main struct for each contract
func CreateContract ¶
func CreateContract(s *discordgo.Session, contractID string, coopID string, playStyle int, coopSize int, BoostOrder int, guildID string, channelID string, progenitors []string, userID string, plannedStartTime 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
func FindContractByMessageID ¶
FindContractByMessageID will find the contract by the messageID
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
}
ContractDurationEstimate groups the various duration estimates produced by getContractDurationEstimate.
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 [5]int64
BoostTimeSeconds [5]time.Duration
ChickenRunTimeSeconds [5]time.Duration
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 GetActiveContractsRow ¶
type GetActiveContractsRow struct {
Contracthash interface{}
Value sql.NullString
}
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 Channel
ChannelMention string
GuildContractRole discordgo.Role
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 ProductionScheduleParams ¶
type ProductionScheduleParams struct {
// contains filtered or unexported fields
}
ProductionScheduleParams Used to determine the entire coop swap time
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CountContractsByChannel ¶
func (*Queries) DeleteContractByChannel ¶
func (*Queries) GetActiveContracts ¶
func (q *Queries) GetActiveContracts(ctx context.Context) ([]GetActiveContractsRow, error)
func (*Queries) GetContractByChannelID ¶
func (*Queries) InsertContract ¶
func (q *Queries) InsertContract(ctx context.Context, arg InsertContractParams) 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 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 TeamworkOutputData ¶
TeamworkOutputData is a struct to hold the output data for teamwork fields
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
¶
- artifacts.go
- boost.go
- boost_admin.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_reactions.go
- boost_sink.go
- boost_slashcmd.go
- boost_speedrun.go
- boost_track.go
- boost_wish.go
- contract.go
- contract_report.go
- contract_scores.go
- db.go
- dynamictokens.go
- eggidmodal.go
- estimate_scores.go
- estimate_time.go
- help.go
- message_redraw.go
- models.go
- query.sql.go
- register.go
- replay.go
- score_explorer.go
- siab.go
- signups.go
- sr_sandbox.go
- state_banker.go
- stones.go
- stones_pages.go
- teamwork.go
- teamwork_pages.go
- thread.go
- timer.go
- update.go
- virtue.go