mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
[core] Use empty resub message when none given
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
f674735689
commit
585161930d
1 changed files with 7 additions and 1 deletions
8
irc.go
8
irc.go
|
@ -434,10 +434,16 @@ func (i ircHandler) handleTwitchUsernotice(m *irc.Message) {
|
||||||
go handleMessage(i.c, m, eventTypeRaid, evtData)
|
go handleMessage(i.c, m, eventTypeRaid, evtData)
|
||||||
|
|
||||||
case "resub":
|
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{}{
|
evtData := plugins.FieldCollectionFromData(map[string]interface{}{
|
||||||
"channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel
|
"channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel
|
||||||
"from": m.Tags["login"],
|
"from": m.Tags["login"],
|
||||||
"message": m.Trailing(),
|
"message": message,
|
||||||
"subscribed_months": m.Tags["msg-param-cumulative-months"],
|
"subscribed_months": m.Tags["msg-param-cumulative-months"],
|
||||||
"plan": m.Tags["msg-param-sub-plan"],
|
"plan": m.Tags["msg-param-sub-plan"],
|
||||||
"user": m.Tags["login"], // Compatibility to plugins.DeriveUser
|
"user": m.Tags["login"], // Compatibility to plugins.DeriveUser
|
||||||
|
|
Loading…
Reference in a new issue