[core] Update go-irc to v4.0.0

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-09-11 19:51:38 +02:00
parent 2bec4f82ed
commit bcc5b4eba7
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5
50 changed files with 74 additions and 73 deletions

View file

@ -7,8 +7,8 @@ import (
"os"
"os/exec"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -3,9 +3,9 @@ package main
import (
"sync"
"github.com/go-irc/irc"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -6,11 +6,11 @@ import (
"sync"
"time"
"github.com/go-irc/irc"
"github.com/mitchellh/hashstructure/v2"
"github.com/pkg/errors"
"github.com/robfig/cron/v3"
log "github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/go_helpers/v2/str"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -4,7 +4,7 @@ import (
"strings"
"sync"
"github.com/go-irc/irc"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
)
@ -31,10 +31,10 @@ func newTwitchUserStateStore() *twitchUserStateStore {
func parseTwitchUserState(m *irc.Message) (*twitchUserState, error) {
var (
color, _ = m.GetTag("color")
displayName, _ = m.GetTag("display-name")
color, _ = m.Tags["color"]
displayName, _ = m.Tags["display-name"]
emoteSets []string
rawSets, _ = m.GetTag("emote-sets")
rawSets, _ = m.Tags["emote-sets"]
)
if rawSets != "" {

View file

@ -4,9 +4,9 @@ import (
"strings"
"sync"
"github.com/go-irc/irc"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -11,12 +11,12 @@ import (
"strings"
"time"
"github.com/go-irc/irc"
"github.com/gofrs/uuid/v3"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"golang.org/x/crypto/argon2"
"golang.org/x/crypto/bcrypt"
"gopkg.in/irc.v4"
"gopkg.in/yaml.v3"
"github.com/Luzifer/go_helpers/v2/str"

View file

@ -8,8 +8,8 @@ import (
"time"
"github.com/Masterminds/sprig/v3"
"github.com/go-irc/irc"
log "github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/go_helpers/v2/str"
korvike "github.com/Luzifer/korvike/functions"

View file

@ -3,8 +3,8 @@ package main
import (
"strings"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"
@ -95,10 +95,7 @@ func init() {
)
tplFuncs.Register("tag", func(m *irc.Message, r *plugins.Rule, fields *plugins.FieldCollection) interface{} {
return func(tag string) string {
s, _ := m.GetTag(tag)
return s
}
return func(tag string) string { return m.Tags[tag] }
}, plugins.TemplateFuncDocumentation{
Description: "Takes the message sent to the channel, returns the value of the tag specified",
Syntax: "tag <tagname>",

2
go.mod
View file

@ -11,7 +11,6 @@ require (
github.com/getsentry/sentry-go v0.23.0
github.com/glebarez/sqlite v1.9.0
github.com/go-git/go-git/v5 v5.8.1
github.com/go-irc/irc v2.1.0+incompatible
github.com/go-sql-driver/mysql v1.7.1
github.com/gofrs/uuid v4.4.0+incompatible
github.com/gofrs/uuid/v3 v3.1.2
@ -26,6 +25,7 @@ require (
github.com/stretchr/testify v1.8.4
github.com/wzshiming/openapi v0.0.0-20200703171632-c7220b3c9cfb
golang.org/x/crypto v0.12.0
gopkg.in/irc.v4 v4.0.0
gopkg.in/yaml.v3 v3.0.1
gorm.io/driver/mysql v1.5.1
gorm.io/driver/postgres v1.5.2

8
go.sum
View file

@ -74,8 +74,6 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f h1:Pz0
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f/go.mod h1:8LHG1a3SRW71ettAD/jW13h8c6AqjVSeL11RAdgaqpo=
github.com/go-git/go-git/v5 v5.8.1 h1:Zo79E4p7TRk0xoRgMq0RShiTHGKcKI4+DI6BfJc/Q+A=
github.com/go-git/go-git/v5 v5.8.1/go.mod h1:FHFuoD6yGz5OSKEBK+aWN9Oah0q54Jxl0abmj6GnqAo=
github.com/go-irc/irc v2.1.0+incompatible h1:pg7pMVq5OYQbqTxceByD/EN8VIsba7DtKn49rsCnG8Y=
github.com/go-irc/irc v2.1.0+incompatible/go.mod h1:jJILTRy8s/qOvusiKifAEfhQMVwft1ZwQaVJnnzmyX4=
github.com/go-jose/go-jose/v3 v3.0.0 h1:s6rrhirfEP/CGIoc6p+PZAeogN2SxKav6Wp7+dyMWVo=
github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc=
@ -265,13 +263,16 @@ github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/wzshiming/openapi v0.0.0-20200703171632-c7220b3c9cfb h1:G0Rrif8QdbAz7Xy53H4Xumy6TuyKHom8pu8z/jdLwwM=
@ -363,6 +364,7 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@ -389,6 +391,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/irc.v4 v4.0.0 h1:5jsLkU2Tg+R2nGNqmkGCrciasyi4kNkDXhyZD+C31yY=
gopkg.in/irc.v4 v4.0.0/go.mod h1:BfjDz9MmuWW6OZY7iq4naOhudO8+QQCdO4Ko18jcsRE=
gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=

View file

@ -3,8 +3,8 @@ package announce
import (
"regexp"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -4,9 +4,9 @@ import (
"net/http"
"regexp"
"github.com/go-irc/irc"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -4,8 +4,8 @@ import (
"context"
"fmt"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -4,8 +4,8 @@ import (
"context"
"regexp"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/internal/actors/linkdetector"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"

View file

@ -6,8 +6,8 @@ import (
"strconv"
"strings"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -6,9 +6,9 @@ import (
"strconv"
"strings"
"github.com/go-irc/irc"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/database"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -4,7 +4,7 @@ import (
"math/rand"
"time"
"github.com/go-irc/irc"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -1,8 +1,8 @@
package deleteactor
import (
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"
@ -29,7 +29,7 @@ func Register(args plugins.RegistrationArguments) error {
type actor struct{}
func (a actor) Execute(_ *irc.Client, m *irc.Message, _ *plugins.Rule, eventData *plugins.FieldCollection, _ *plugins.FieldCollection) (preventCooldown bool, err error) {
msgID, ok := m.Tags.GetTag("id")
msgID, ok := m.Tags["id"]
if !ok || msgID == "" {
return false, nil
}

View file

@ -3,8 +3,8 @@ package eventmod
import (
"encoding/json"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -7,8 +7,8 @@ import (
"net/url"
"time"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -1,7 +1,7 @@
package linkdetector
import (
"github.com/go-irc/irc"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/internal/linkcheck"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -5,8 +5,8 @@ import (
"strings"
"time"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/internal/actors/clipdetector"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
@ -172,7 +172,7 @@ func (a actor) Execute(c *irc.Client, m *irc.Message, r *plugins.Rule, eventData
}
case "delete":
msgID, ok := m.Tags.GetTag("id")
msgID, ok := m.Tags["id"]
if !ok || msgID == "" {
return false, errors.New("found no mesage id")
}

View file

@ -1,8 +1,8 @@
package log
import (
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/sirupsen/logrus"

View file

@ -4,8 +4,8 @@ import (
"encoding/json"
"net/http"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -4,8 +4,8 @@ import (
"net/http"
"strings"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -4,8 +4,8 @@ import (
"context"
"strings"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -6,9 +6,9 @@ import (
"sync"
"time"
"github.com/go-irc/irc"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/go_helpers/v2/str"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
@ -210,7 +210,7 @@ func (a actor) Execute(_ *irc.Client, m *irc.Message, r *plugins.Rule, eventData
}
enforcement := strings.NewReplacer(
"$msgid", string(stMsg.Msg.Tags["id"]),
"$msgid", stMsg.Msg.Tags["id"],
"$user", plugins.DeriveUser(stMsg.Msg, nil),
).Replace(actionName)
@ -218,7 +218,7 @@ func (a actor) Execute(_ *irc.Client, m *irc.Message, r *plugins.Rule, eventData
continue
}
if err = action(channel, rawMatch, string(stMsg.Msg.Tags["id"]), plugins.DeriveUser(stMsg.Msg, nil)); err != nil {
if err = action(channel, rawMatch, stMsg.Msg.Tags["id"], plugins.DeriveUser(stMsg.Msg, nil)); err != nil {
return false, errors.Wrap(err, "executing action")
}

View file

@ -5,8 +5,8 @@ import (
"strings"
"time"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/database"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
@ -172,7 +172,7 @@ func (a actorPunish) Execute(_ *irc.Client, m *irc.Message, r *plugins.Rule, eve
}
case "delete":
msgID, ok := m.Tags.GetTag("id")
msgID, ok := m.Tags["id"]
if !ok || msgID == "" {
return false, errors.New("found no mesage id")
}

View file

@ -3,8 +3,8 @@ package quotedb
import (
"strconv"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/database"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -1,8 +1,8 @@
package raw
import (
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -6,10 +6,10 @@ import (
"net/http"
"strings"
"github.com/go-irc/irc"
"github.com/gorilla/mux"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)
@ -124,12 +124,12 @@ func (a actor) Execute(_ *irc.Client, m *irc.Message, r *plugins.Rule, eventData
}
if attrs.MustBool("as_reply", ptrBoolFalse) {
id, ok := m.GetTag("id")
id, ok := m.Tags["id"]
if ok {
if ircMessage.Tags == nil {
ircMessage.Tags = make(irc.Tags)
}
ircMessage.Tags["reply-parent-msg-id"] = irc.TagValue(id)
ircMessage.Tags["reply-parent-msg-id"] = id
}
}

View file

@ -3,8 +3,8 @@ package shield
import (
"context"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -3,8 +3,8 @@ package shoutout
import (
"regexp"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -1,8 +1,8 @@
package stopexec
import (
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -5,8 +5,8 @@ import (
"strconv"
"time"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -4,9 +4,9 @@ import (
"fmt"
"net/http"
"github.com/go-irc/irc"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/database"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -4,8 +4,8 @@ import (
"context"
"strings"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -1,8 +1,8 @@
package whisper
import (
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -3,8 +3,8 @@ package customevent
import (
"strings"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -5,8 +5,8 @@ import (
"sync"
"time"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/database"
"github.com/Luzifer/twitch-bot/v3/plugins"

View file

@ -4,9 +4,9 @@ import (
"strings"
"time"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"
@ -84,9 +84,9 @@ func handleRaffleEntry(m *irc.Message, channel, user string) error {
re := raffleEntry{
RaffleID: r.ID,
UserID: string(m.Tags["user-id"]),
UserID: m.Tags["user-id"],
UserLogin: user,
UserDisplayName: string(m.Tags["display-name"]),
UserDisplayName: m.Tags["display-name"],
EnteredAt: time.Now().UTC(),
}
@ -95,7 +95,7 @@ func handleRaffleEntry(m *irc.Message, channel, user string) error {
}
raffleEventFields := plugins.FieldCollectionFromData(map[string]any{
"user_id": string(m.Tags["user-id"]),
"user_id": m.Tags["user-id"],
"user": user,
})

8
irc.go
View file

@ -9,9 +9,9 @@ import (
"sync"
"time"
"github.com/go-irc/irc"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
"github.com/Luzifer/twitch-bot/v3/plugins"
@ -209,8 +209,8 @@ func (ircHandler) getChannel(m *irc.Message) string {
}
func (i ircHandler) handleClearChat(m *irc.Message) {
seconds, secondsErr := strconv.Atoi(string(m.Tags["ban-duration"]))
targetUserID, hasTargetUserID := m.Tags.GetTag("target-user-id")
seconds, secondsErr := strconv.Atoi(m.Tags["ban-duration"])
targetUserID, hasTargetUserID := m.Tags["target-user-id"]
var (
evt *string
@ -493,7 +493,7 @@ func (i ircHandler) handleTwitchWhisper(m *irc.Message) {
}
func (ircHandler) tagToNumeric(m *irc.Message, tag string, fallback int64) int64 {
tv := string(m.Tags[tag])
tv := m.Tags[tag]
if tv == "" {
return fallback
}

View file

@ -7,8 +7,8 @@ import (
"text/template"
"time"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)

View file

@ -4,7 +4,7 @@ import (
"strconv"
"strings"
"github.com/go-irc/irc"
"gopkg.in/irc.v4"
)
const (
@ -32,7 +32,7 @@ func ParseBadgeLevels(m *irc.Message) BadgeCollection {
return out
}
badgeString, ok := m.GetTag("badges")
badgeString, ok := m.Tags["badges"]
if !ok || len(badgeString) == 0 {
return out
}

View file

@ -4,7 +4,7 @@ import (
"fmt"
"strings"
"github.com/go-irc/irc"
"gopkg.in/irc.v4"
)
func DeriveChannel(m *irc.Message, evtData *FieldCollection) string {

View file

@ -1,10 +1,10 @@
package plugins
import (
"github.com/go-irc/irc"
"github.com/pkg/errors"
"github.com/robfig/cron/v3"
log "github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/database"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"

View file

@ -11,10 +11,10 @@ import (
"strings"
"time"
"github.com/go-irc/irc"
"github.com/mitchellh/hashstructure/v2"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"gopkg.in/yaml.v3"
"github.com/Luzifer/go_helpers/v2/str"

View file

@ -5,8 +5,8 @@ import (
"testing"
"time"
"github.com/go-irc/irc"
"github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/pkg/twitch"
)

View file

@ -4,9 +4,9 @@ import (
"fmt"
"net/http"
"github.com/go-irc/irc"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/go_helpers/v2/backoff"
"github.com/Luzifer/go_helpers/v2/str"

View file

@ -8,9 +8,9 @@ import (
"text/template"
"time"
"github.com/go-irc/irc"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"gopkg.in/irc.v4"
"github.com/Luzifer/twitch-bot/v3/plugins"
)
@ -63,7 +63,7 @@ func generateTplDocsRender(e *plugins.TemplateFuncDocumentationExample) (string,
User: "exampleuser",
Host: "exampleuser.tmi.twitch.tv",
},
Tags: map[string]irc.TagValue{
Tags: map[string]string{
"badge-info": "subscriber/26",
"badges": "moderator/1,subscriber/24",
"color": "#8A2BE2",