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
4 changes: 2 additions & 2 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ flooded by a greeting for every arrival. The catalog contains short original
lines and supports the `{nick}` placeholder:

~~~text
[Welcome] The Evil Has Landed.
[Welcome] A wild Pzycho appeared!
The Evil Has Landed.
A wild Pzycho appeared!
~~~

There is no command to enable it at runtime. Once enabled, it applies to
Expand Down
2 changes: 1 addition & 1 deletion plugins/welcome.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ func (p *Welcome) HandleEvent(b *bot.Bot, m bot.Message) bool {
if line == "" {
return false
}
b.Send(m.Target, ircColor(ircCyan, "[Welcome] "+line))
b.Send(m.Target, ircColor(ircCyan, line))
return true
}
6 changes: 5 additions & 1 deletion plugins/welcome_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ func TestWelcomeSkipsSelfAndAppliesChannelCooldown(t *testing.T) {
}

func TestWelcomeUsesMIRCColor(t *testing.T) {
if !strings.Contains(ircColor(ircCyan, "[Welcome] hello"), "\x03") {
message := ircColor(ircCyan, "hello")
if !strings.Contains(message, "\x03") {
t.Fatal("expected standard mIRC color control code")
}
if strings.Contains(message, "[Welcome]") {
t.Fatalf("welcome output should contain only the configured sentence: %q", message)
}
}