Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/boost/boost_admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ func HandleAdminListRoles(s *discordgo.Session, i *discordgo.InteractionCreate)

guildRoles, err := s.GuildRoles(i.GuildID)
if err != nil {
builder.WriteString("Error retrieving guild roles: " + err.Error())
builder.WriteString("Error retrieving guild roles: ")
builder.WriteString(err.Error())
} else {

for _, c := range ei.EggIncContracts {
Expand Down Expand Up @@ -591,11 +592,13 @@ func HandleAdminGetContractData(s *discordgo.Session, i *discordgo.InteractionCr
jsonData, err := json.Marshal(contract)
if err != nil {
log.Println(err.Error())
builder.WriteString("Error formatting JSON data. " + err.Error())
builder.WriteString("Error formatting JSON data. ")
builder.WriteString(err.Error())
} else {
err = json.Indent(buf, jsonData, "", " ")
if err != nil {
builder.WriteString("Error formatting JSON data. " + err.Error())
builder.WriteString("Error formatting JSON data. ")
builder.WriteString(err.Error())
} else {
// Create io.Reader from JSON string
reader = bytes.NewReader(buf.Bytes())
Expand Down
20 changes: 16 additions & 4 deletions src/boost/boost_button_reactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,14 +852,26 @@ func buttonReactionHelp(s *discordgo.Session, i *discordgo.InteractionCreate, co
outputStr.WriteString("## Boost Bot Icon Meanings\n\n")
outputStr.WriteString("See 📌 message to join the contract.\nSet your number of boost tokens there or ")
outputStr.WriteString("add a 4️⃣ to 🔟 reaction to the boost list message.\n")
outputStr.WriteString("Active booster reaction of " + boostIcon + " to when spending tokens to boost. Multiple " + boostIcon + " votes by others in the contract will also indicate a boost.\n")
outputStr.WriteString("Use " + contract.TokenStr + " when sending tokens. ")
outputStr.WriteString("During GG use " + ei.GetBotEmojiMarkdown("std_gg") + "/" + ei.GetBotEmojiMarkdown("ultra_gg") + " to send 2 tokens.\n")
outputStr.WriteString("Active booster reaction of ")
outputStr.WriteString(boostIcon)
outputStr.WriteString(" to when spending tokens to boost. Multiple ")
outputStr.WriteString(boostIcon)
outputStr.WriteString(" votes by others in the contract will also indicate a boost.\n")
outputStr.WriteString("Use ")
outputStr.WriteString(contract.TokenStr)
outputStr.WriteString(" when sending tokens. ")
outputStr.WriteString("During GG use ")
outputStr.WriteString(ei.GetBotEmojiMarkdown("std_gg"))
outputStr.WriteString("/")
outputStr.WriteString(ei.GetBotEmojiMarkdown("ultra_gg"))
outputStr.WriteString(" to send 2 tokens.\n")
fmt.Fprintf(&outputStr, "Farmer status line, %s:Requested Run, %s:10B Est, %s: Full Hab Est.\n", ei.GetBotEmojiMarkdown("icon_chicken_run"), ei.GetBotEmojiMarkdown("trophy_diamond"), ei.GetBotEmojiMarkdown("hab_full"))
//outputStr.WriteString("Active Booster can react with ➕ or ➖ to adjust number of tokens needed.\n")
outputStr.WriteString("Active booster reaction of 🔃 to exchange position with the next booster.\n")
outputStr.WriteString("Reaction of ⤵️ to move yourself to last in the current boost order.\n")
outputStr.WriteString("Reaction of " + chickMention + " when you're ready for others to run chickens on your farm.\n")
outputStr.WriteString("Reaction of ")
outputStr.WriteString(chickMention)
outputStr.WriteString(" when you're ready for others to run chickens on your farm.\n")
outputStr.WriteString("Anyone can add a 🚽 reaction to express your urgency to boost next.\n")
outputStr.WriteString("Additional help through the **/help** command.\n")

Expand Down
42 changes: 31 additions & 11 deletions src/boost/boost_draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,12 @@ func DrawBoostList(s *discordgo.Session, contract *Contract) []discordgo.Message
builder.WriteString("\n### Backups\n")
for _, userID := range contract.WaitlistBoosters {
if bottools.IsValidDiscordID(userID) {
builder.WriteString("<@" + userID + "> ")
builder.WriteString("<@")
builder.WriteString(userID)
builder.WriteString("> ")
} else {
builder.WriteString(userID + " ")
builder.WriteString(userID)
builder.WriteString(" ")
}
}
components = append(components, &discordgo.TextDisplay{
Expand Down Expand Up @@ -663,11 +666,16 @@ func DrawBoostList(s *discordgo.Session, contract *Contract) []discordgo.Message
case ContractStateFastrun:
if showTimedGuidance {
guidanceStr.WriteString("\n")
guidanceStr.WriteString("> -# Active Booster: " + boostIcon + " when boosting. \n")
guidanceStr.WriteString("> -# Anyone: " + tokenStr + " when sending tokens")
guidanceStr.WriteString(". ❓ Help under Boost Menu.\n")
guidanceStr.WriteString("> -# Active Booster: ")
guidanceStr.WriteString(boostIcon)
guidanceStr.WriteString(" when boosting. \n")
guidanceStr.WriteString("> -# Anyone: ")
guidanceStr.WriteString(tokenStr)
guidanceStr.WriteString(" when sending tokens. ❓ Help under Boost Menu.\n")
if contract.CoopSize != len(contract.Order) {
guidanceStr.WriteString("-# > Use pinned message or add 🧑\u200d🌾 reaction to join this list and set boost " + tokenStr + " wanted.\n")
guidanceStr.WriteString("-# > Use pinned message or add 🧑‍🌾 reaction to join this list and set boost ")
guidanceStr.WriteString(tokenStr)
guidanceStr.WriteString(" wanted.\n")
}
totalContentLength := guidanceStr.Len()
for _, component := range components {
Expand All @@ -684,17 +692,23 @@ func DrawBoostList(s *discordgo.Session, contract *Contract) []discordgo.Message
if showTimedGuidance {
if contract.PlayStyle != ContractPlaystyleLeaderboard {
guidanceStr.WriteString("\n")
guidanceStr.WriteString("> " + tokenStr + " when sending tokens to the Banker")
guidanceStr.WriteString("> ")
guidanceStr.WriteString(tokenStr)
guidanceStr.WriteString(" when sending tokens to the Banker")
runReady, _, _ := ei.GetBotEmoji("runready")

guidanceStr.WriteString(".\n")
guidanceStr.WriteString("-# > " + runReady + " when you're ready for others to run chickens on your farm.\n")
guidanceStr.WriteString("-# > ")
guidanceStr.WriteString(runReady)
guidanceStr.WriteString(" when you're ready for others to run chickens on your farm.\n")
guidanceStr.WriteString("-# > 💰 is used by the Banker to send the requested number of tokens to the booster.\n")
guidanceStr.WriteString("-# > -When active Booster is sent tokens by the Banker they are marked as boosted.\n")
guidanceStr.WriteString("-# > -Adjust the number of boost tokens you want by adding a 6️⃣ to 🔟 reaction to the boost list message.\n")
}
if contract.CoopSize != len(contract.Order) {
guidanceStr.WriteString("-# > Use pinned message or add 🧑‍🌾 reaction to join this list and set boost " + tokenStr + " wanted.\n")
guidanceStr.WriteString("-# > Use pinned message or add 🧑‍🌾 reaction to join this list and set boost ")
guidanceStr.WriteString(tokenStr)
guidanceStr.WriteString(" wanted.\n")
}
// Sum the Content lengths of the components for this length test
// If the length of the builder is less than 1900 characters, add the guidanceStr
Expand All @@ -720,7 +734,9 @@ func DrawBoostList(s *discordgo.Session, contract *Contract) []discordgo.Message
Spacing: &spacing,
})
guidanceStr.WriteString("-# > Waiting for other(s) to join...\n")
guidanceStr.WriteString("-# > Use pinned message or add 🧑‍🌾 reaction to join this list and set boost " + tokenStr + " wanted.\n")
guidanceStr.WriteString("-# > Use pinned message or add 🧑‍🌾 reaction to join this list and set boost ")
guidanceStr.WriteString(tokenStr)
guidanceStr.WriteString(" wanted.\n")
totalContentLength := guidanceStr.Len()
for _, component := range components {
if textDisplay, ok := component.(*discordgo.TextDisplay); ok {
Expand Down Expand Up @@ -754,7 +770,11 @@ func DrawBoostList(s *discordgo.Session, contract *Contract) []discordgo.Message
if sinkEIName != "" {
sinkName += " " + sinkEIName
}
builder.WriteString("## Send every " + tokenStr + " to our sink " + sinkName + "\n")
builder.WriteString("## Send every ")
builder.WriteString(tokenStr)
builder.WriteString(" to our sink ")
builder.WriteString(sinkName)
builder.WriteString("\n")
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/boost/boost_menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ func HandleMenuReactions(s *discordgo.Session, i *discordgo.InteractionCreate) {
})
currentField.Reset()
}
currentField.WriteString(line + "\n")
currentField.WriteString(line)
currentField.WriteString("\n")
}
if currentField.Len() > 0 {
field = append(field, &discordgo.MessageEmbedField{
Expand Down
9 changes: 6 additions & 3 deletions src/boost/leaderboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,10 @@ func leaderboardTable(resp *ei.LeaderboardResponse, season string, guildNames []
bottools.AlignString("Name", nameWidth, bottools.StringAlignLeft),
bottools.AlignString("Score", scoreWidth, bottools.StringAlignRight),
}, "|")
b.WriteString(header + "\n")
b.WriteString(strings.Repeat("—", len(header)) + "\n")
b.WriteString(header)
b.WriteString("\n")
b.WriteString(strings.Repeat("—", len(header)))
b.WriteString("\n")

for _, r := range rows {
row := strings.Join([]string{
Expand All @@ -543,7 +545,8 @@ func leaderboardTable(resp *ei.LeaderboardResponse, season string, guildNames []
bottools.AlignString(r.name, nameWidth, bottools.StringAlignLeft),
bottools.AlignString(fmt.Sprintf("%.0f", r.score), scoreWidth, bottools.StringAlignRight),
}, "|")
b.WriteString(row + "\n")
b.WriteString(row)
b.WriteString("\n")
}

b.WriteString("```")
Expand Down
19 changes: 14 additions & 5 deletions src/boost/predictions_embeded.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,8 @@ func getWeeklyEmbeds(wedTime, friTime time.Time, userName, botName, botIconURL s
}
}
if seasonalEmojis.Len() > 0 {
legend.WriteString(seasonalEmojis.String() + " Seasonal LB")
legend.WriteString(seasonalEmojis.String())
legend.WriteString(" Seasonal LB")
}
if timeSaverMissing {
if legend.Len() > 0 {
Expand All @@ -576,9 +577,13 @@ func getWeeklyEmbeds(wedTime, friTime time.Time, userName, botName, botIconURL s
legend.WriteString("🕯️ Missing since")
}
if legend.Len() > 0 {
footer.WriteString("Legend: " + legend.String() + "\n")
footer.WriteString("Legend: ")
footer.WriteString(legend.String())
footer.WriteString("\n")
}
footer.WriteString(botName + " • /pred weekly • User: " + userName)
footer.WriteString(botName)
footer.WriteString(" • /pred weekly • User: ")
footer.WriteString(userName)

var title string
if weeklyType == 0 {
Expand Down Expand Up @@ -627,9 +632,13 @@ func getCollectibleEmbeds(collectibles map[string]collectiblePrediction, userNam
legend.WriteString(" Seasonal LB")
}
if legend.Len() > 0 {
footer.WriteString("Legend: " + legend.String() + "\n")
footer.WriteString("Legend: ")
footer.WriteString(legend.String())
footer.WriteString("\n")
}
footer.WriteString(botName + " • /pred collectibles • User: " + userName)
footer.WriteString(botName)
footer.WriteString(" • /pred collectibles • User: ")
footer.WriteString(userName)
return &discordgo.MessageEmbedFooter{Text: footer.String(), IconURL: botIconURL}
}

Expand Down
3 changes: 2 additions & 1 deletion src/boost/stones.go
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,8 @@ func DownloadCoopStatusStones(contractID string, coopID string, details bool, so
if showGlitch {
parts = append(parts, "🤥HabGlitch")
}
builder.WriteString(strings.Join(parts, " / ") + "\n")
builder.WriteString(strings.Join(parts, " / "))
builder.WriteString("\n")
}
if anyColleggtibles {
fmt.Fprintf(&builder, "Colleggtibles show when less than %s\n", strings.Join(colleggtibleStr, ", "))
Expand Down
6 changes: 4 additions & 2 deletions src/boost/stones_pages.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ func sendStonesPage(s *discordgo.Session, i *discordgo.InteractionCreate, newMes
pageBuilder.Reset()
currentPageSize = 0
}
pageBuilder.WriteString(line + "\n")
pageBuilder.WriteString(line)
pageBuilder.WriteString("\n")
currentPageSize += lineSize
}

Expand Down Expand Up @@ -203,7 +204,8 @@ func sendStonesPage(s *discordgo.Session, i *discordgo.InteractionCreate, newMes
})
currentField.Reset()
}
currentField.WriteString(line + "\n")
currentField.WriteString(line)
currentField.WriteString("\n")
}
if currentField.Len() > 0 {
field = append(field, &discordgo.MessageEmbedField{
Expand Down
Loading