Skip to content

Commit 2709cae

Browse files
authored
Merge pull request #984 from mkmccarty/mm-branch-2
feat: add version information to bot startup logs and output
2 parents 7535081 + 046799e commit 2709cae

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ var Version = "development"
8888
var debugLogging = true
8989

9090
func init() {
91+
version.Version = Version
9192
log.Printf("Starting Discord Bot: %s (%s)\n", version.Release, Version)
9293

9394
// Read application parameters

src/tasks/tasks.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/mkmccarty/TokenTimeBoostBot/src/config"
1717
"github.com/mkmccarty/TokenTimeBoostBot/src/ei"
1818
"github.com/mkmccarty/TokenTimeBoostBot/src/events"
19+
"github.com/mkmccarty/TokenTimeBoostBot/src/version"
1920
)
2021

2122
const eggIncContractsURL string = "https://raw.githubusercontent.com/carpetsage/egg/main/periodicals/data/contracts.json"
@@ -85,11 +86,15 @@ func HandleReloadContractsCommand(s *discordgo.Session, i *discordgo.Interaction
8586
// then we have new data
8687
if time.Since(lastContractUpdate) < 1*time.Minute || time.Since(lastEventUpdate) < 1*time.Minute {
8788
str = "Updated Egg Inc contract data:.\n"
89+
str += fmt.Sprintf("> Boost Bot version: %s (%s)\n", version.Release, version.Version)
8890
str += fmt.Sprintf("> Contracts: %s\n", lastContractUpdate.Format(time.RFC1123))
8991
str += fmt.Sprintf("> Events: %s\n", lastEventUpdate.Format(time.RFC1123))
92+
str += fmt.Sprintf("> Collegeggtibles: %d\n", len(ei.CustomEggMap))
9093
} else {
94+
str += fmt.Sprintf("> Boost Bot version: %s (%s)\n", version.Release, version.Version)
9195
str += fmt.Sprintf("> Contracts: %s\n", lastContractUpdate.Format(time.RFC1123))
9296
str += fmt.Sprintf("> Events: %s\n", lastEventUpdate.Format(time.RFC1123))
97+
str += fmt.Sprintf("> Collegeggtibles: %d\n", len(ei.CustomEggMap))
9398
}
9499

95100
_, _ = s.FollowupMessageCreate(i.Interaction, true,

0 commit comments

Comments
 (0)