From ccec89bce62cbcb1c067b51509d11a8bee43f0f2 Mon Sep 17 00:00:00 2001 From: HimbeerserverDE Date: Sat, 11 Sep 2021 10:15:17 +0200 Subject: [PATCH] Prevent empty disconnect reasons --- moderation.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/moderation.go b/moderation.go index 1500a6d..4cb3e68 100644 --- a/moderation.go +++ b/moderation.go @@ -5,6 +5,10 @@ import "github.com/anon55555/mt" // Kick sends mt.ToCltDisco with the specified custom reason // and closes the ClientConn. func (cc *ClientConn) Kick(reason string) { + if reason == "" { + reason = "Kicked by proxy." + } + ack, _ := cc.SendCmd(&mt.ToCltDisco{ Reason: mt.Custom, Custom: reason,