diff --git a/docs/configuration.md b/docs/configuration.md index a1f0bc3..ccbc444 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -152,7 +152,8 @@ progression profile for the channel where it is claimed. Daily bonuses require Duck Hunt to be enabled globally and for that channel. Claims are persisted in the configured database, so restarting GoBot does not reset the daily limit. Successful consecutive UTC-day claims also report a per-user streak; missing a -day resets the streak to one. +day resets the streak to one. The streak is tracked by Daily separately from +Duck Hunt's XP and level progression. The optional `welcome` plugin listens for users joining a channel. It applies the configured probability to each join and then enforces a per-channel diff --git a/docs/plugins.md b/docs/plugins.md index b941cdf..90e7b5d 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -743,7 +743,8 @@ network and nickname. Different users may claim independently; this is not a single shared server-wide claim. The reward is added to the Duck Hunt XP profile for the channel where the claim is made, so Duck Hunt must be enabled globally and in that channel. Claims survive restarts through the configured -Bolt database. +Bolt database. Daily tracks the consecutive UTC-day claim streak separately +from Duck Hunt's XP and level progression. After changing `config.yaml`, an owner can send GoBot a private `reload` message to apply reloadable plugin settings without reconnecting. Changes to diff --git a/plugins/karma.go b/plugins/karma.go index 8708d70..c6cbbed 100644 --- a/plugins/karma.go +++ b/plugins/karma.go @@ -109,11 +109,11 @@ func formatKarmaUpdates(updates []karmaUpdate) string { } message := "" if positive { - message = ircColor(ircGreen, "Karma boost! "+strings.Join(details, ", ")+" ✨🎯🌟💫") + message = ircColor(ircGreen, "Karma boost! "+strings.Join(details, ", ")+" ✨ 🎯 🌟 💫") } else if negative { - message = ircColor(ircRed, "Karma dip! "+strings.Join(details, ", ")+" 📉🌀💥😬") + message = ircColor(ircRed, "Karma dip! "+strings.Join(details, ", ")+" 📉 🌀 💥 😬") } else { - message = ircColor(ircCyan, "Karma update! "+strings.Join(details, ", ")+" ✨📊🔄🌟") + message = ircColor(ircCyan, "Karma update! "+strings.Join(details, ", ")+" ✨ 📊 🔄 🌟") } milestones := make([]string, 0) diff --git a/plugins/karma_test.go b/plugins/karma_test.go index 931bcc4..00e5736 100644 --- a/plugins/karma_test.go +++ b/plugins/karma_test.go @@ -32,14 +32,33 @@ func TestKarmaUpdateMessageIsColorfulAndCompact(t *testing.T) { if !strings.Contains(message, "Karma boost! echo") { t.Fatalf("unexpected karma message: %q", message) } - if strings.Count(message, "✨") == 0 || strings.Count(message, "🎯") == 0 || strings.Count(message, "🌟") == 0 || strings.Count(message, "💫") == 0 { - t.Fatalf("expected four positive karma emojis: %q", message) + if !strings.Contains(message, "✨ 🎯 🌟 💫") { + t.Fatalf("expected spaced positive karma emojis: %q", message) } if !strings.Contains(message, "\x03") { t.Fatal("expected IRC color formatting") } } +func TestKarmaDecorationsKeepEmojiSeparated(t *testing.T) { + cases := []struct { + name string + updates []karmaUpdate + want string + }{ + {name: "positive", updates: []karmaUpdate{{key: "thing", delta: 1, value: 4}}, want: "✨ 🎯 🌟 💫"}, + {name: "negative", updates: []karmaUpdate{{key: "thing", delta: -1, value: -1}}, want: "📉 🌀 💥 😬"}, + {name: "mixed", updates: []karmaUpdate{{key: "thing", delta: 1, value: 1}, {key: "other", delta: -1, value: -1}}, want: "✨ 📊 🔄 🌟"}, + } + for _, test := range cases { + t.Run(test.name, func(t *testing.T) { + if message := formatKarmaUpdates(test.updates); !strings.Contains(message, test.want) { + t.Fatalf("message %q does not contain spaced decoration %q", message, test.want) + } + }) + } +} + func TestKarmaMilestoneDecoration(t *testing.T) { message := formatKarmaUpdates([]karmaUpdate{{key: "project", delta: 1, value: 25}}) if !strings.Contains(message, "project has reached +25 karma! 🏆") {