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
3 changes: 2 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions plugins/karma.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 21 additions & 2 deletions plugins/karma_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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! 🏆") {
Expand Down