From 585161930d47f979e31091d79476f5633b34433e Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 17 Apr 2022 13:44:47 +0200 Subject: [PATCH] [core] Use empty resub message when none given Signed-off-by: Knut Ahlers --- irc.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/irc.go b/irc.go index 266a097..2db288c 100644 --- a/irc.go +++ b/irc.go @@ -434,10 +434,16 @@ func (i ircHandler) handleTwitchUsernotice(m *irc.Message) { go handleMessage(i.c, m, eventTypeRaid, evtData) case "resub": + message := m.Trailing() + if message == i.getChannel(m) { + // If no message is given, Trailing yields the channel name + message = "" + } + evtData := plugins.FieldCollectionFromData(map[string]interface{}{ "channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel "from": m.Tags["login"], - "message": m.Trailing(), + "message": message, "subscribed_months": m.Tags["msg-param-cumulative-months"], "plan": m.Tags["msg-param-sub-plan"], "user": m.Tags["login"], // Compatibility to plugins.DeriveUser