From 31a26c825e8df0eb45a009e805084a338a91bd47 Mon Sep 17 00:00:00 2001 From: AK Date: Sun, 2 Aug 2026 20:09:50 -0700 Subject: [PATCH] fix: remove welcome plugin label from greetings --- docs/plugins.md | 4 ++-- plugins/welcome.go | 2 +- plugins/welcome_test.go | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index c721fdf..7dc45a0 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -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 diff --git a/plugins/welcome.go b/plugins/welcome.go index 41cab11..f4e3605 100644 --- a/plugins/welcome.go +++ b/plugins/welcome.go @@ -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 } diff --git a/plugins/welcome_test.go b/plugins/welcome_test.go index 00e1530..c13633e 100644 --- a/plugins/welcome_test.go +++ b/plugins/welcome_test.go @@ -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) + } }