mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 11:51:17 +00:00
[core] Add support for "annoumcement" event type
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
4c5fcc9e91
commit
91846e300f
2 changed files with 12 additions and 0 deletions
|
@ -16,6 +16,7 @@ var (
|
|||
)
|
||||
|
||||
var (
|
||||
eventTypeAnnouncement = ptrStr("announcement")
|
||||
eventTypeBan = ptrStr("ban")
|
||||
eventTypeBits = ptrStr("bits")
|
||||
eventTypeCustom = ptrStr("custom")
|
||||
|
@ -42,6 +43,7 @@ var (
|
|||
eventTypeTwitchTitleUpdate = ptrStr("title_update")
|
||||
|
||||
knownEvents = []*string{
|
||||
eventTypeAnnouncement,
|
||||
eventTypeBan,
|
||||
eventTypeBits,
|
||||
eventTypeCustom,
|
||||
|
|
10
irc.go
10
irc.go
|
@ -399,6 +399,16 @@ func (i ircHandler) handleTwitchUsernotice(m *irc.Message) {
|
|||
// Notices SHOULD have msg-id tags...
|
||||
log.WithField("msg", m).Warn("Received usernotice without msg-id")
|
||||
|
||||
case "announcement":
|
||||
evtData := plugins.FieldCollectionFromData(map[string]any{
|
||||
"channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel
|
||||
"color": m.Tags["msg-param-color"],
|
||||
"user": m.Tags["login"], // Compatibility to plugins.DeriveUser
|
||||
})
|
||||
log.WithFields(log.Fields(evtData.Data())).Info("Announcement was made")
|
||||
|
||||
go handleMessage(i.c, m, eventTypeAnnouncement, evtData)
|
||||
|
||||
case "giftpaidupgrade":
|
||||
evtData := plugins.FieldCollectionFromData(map[string]interface{}{
|
||||
"channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel
|
||||
|
|
Loading…
Reference in a new issue