Skip to content

🎉 feat: Add funny Egg, Inc. status messages and improve heartbeat#2184

Merged
mkmccarty merged 1 commit intomainfrom
mm-branch-1
Feb 13, 2026
Merged

🎉 feat: Add funny Egg, Inc. status messages and improve heartbeat#2184
mkmccarty merged 1 commit intomainfrom
mm-branch-1

Conversation

@mkmccarty
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 13, 2026 03:35
@mkmccarty mkmccarty merged commit 5ded2d8 into main Feb 13, 2026
14 checks passed
@mkmccarty mkmccarty deleted the mm-branch-1 branch February 13, 2026 03:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds rotating funny status messages related to Egg, Inc. gameplay to the Discord bot's presence and reorganizes the download logic for EggInc artifact configuration data. The changes aim to make the bot more engaging while ensuring proper data loading order.

Changes:

  • Added 25 humorous Egg, Inc.-themed status messages that rotate every 2 minutes in the heartbeat
  • Reorganized the artifact config download to occur earlier in the execution flow before the artifact data download
  • Removed commented-out duplicate code and cleaned up the tasks file

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
main.go Added math/rand import, changed initial status to "Syncing...", and implemented rotating funny status messages in the heartbeat function
src/tasks/tasks.go Moved downloadEggIncData call for eiafx-config earlier and removed duplicate download/load logic for the same file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"flag"
"fmt"
"log"
"math/rand"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "math/rand/v2" instead of "math/rand" to be consistent with the rest of the codebase. All other files in the project that use random numbers import "math/rand/v2", including src/boost/boost.go, src/boost/boost_admin.go, src/boost/contract.go, src/boost/roles.go, and src/tasks/tasks.go. The v2 package provides better defaults and doesn't require manual seeding.

Suggested change
"math/rand"
"math/rand/v2"

Copilot uses AI. Check for mistakes.
Comment on lines +1145 to +1170
funnyPhrases := []string{
"Hatching chickens",
"Shipping eggs",
"Upgrading silos",
"Building habs",
"Swiping drones",
"Launching rockets",
"Counting my Golden Eggs",
"Prestiging",
"Counting chickens",
"Running chickens",
"Tapping silos",
"Researching eggs",
"Cracking contracts",
"Boosting production",
"Consuming artifacts",
"Petting chickens",
"Waiting on my next TE",
"Calculating optimal boosts",
"Watching my Egg, Inc. empire grow",
"Collecting daily rewards",
"Checking for new contracts",
"Optimizing my farm layout",
"Jiggling artifacts",
"Setting completion alarms",
}
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The funnyPhrases slice is recreated on every heartbeat tick (every 2 minutes when counter is even). This is inefficient as it allocates a new slice with 25 strings repeatedly. Consider moving this slice to package-level scope or outside the ticker loop to improve performance and reduce unnecessary allocations.

Copilot uses AI. Check for mistakes.
Comment on lines +1186 to +1193
log.Printf("Heartbeat error: %v", err)
err := s.Close()
if err != nil {
log.Fatalf("Cannot close the session: %v", err)
}
err = s.Open()
if err != nil {
log.Fatalf("Cannot open the session: %v", err)
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error recovery logic here is problematic. When UpdateStatusComplex fails, the code attempts to close and reopen the Discord session using log.Fatalf(), which will terminate the entire application. This is too aggressive for a heartbeat function that runs in a goroutine. If a status update fails, it shouldn't crash the entire bot. Consider either removing this recovery logic entirely and just logging the error, or implementing a more graceful reconnection strategy without using log.Fatalf().

Suggested change
log.Printf("Heartbeat error: %v", err)
err := s.Close()
if err != nil {
log.Fatalf("Cannot close the session: %v", err)
}
err = s.Open()
if err != nil {
log.Fatalf("Cannot open the session: %v", err)
log.Printf("Heartbeat error updating status: %v", err)
if cerr := s.Close(); cerr != nil {
log.Printf("Heartbeat error closing session after status failure: %v", cerr)
}
if oerr := s.Open(); oerr != nil {
log.Printf("Heartbeat error reopening session after status failure: %v", oerr)

Copilot uses AI. Check for mistakes.
"Setting completion alarms",
}

// Randomly choose between showing contract count or a funny phrase
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "Randomly choose between showing contract count or a funny phrase" but the code always shows a funny phrase - there's no logic to show contract count. Either update the comment to match the actual behavior or implement the contract count display logic as the comment suggests.

Suggested change
// Randomly choose between showing contract count or a funny phrase
// Randomly choose a funny status phrase

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant