mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 11:51:17 +00:00
[lint] Properly format inputs
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
e2c6f99f29
commit
8247978151
43 changed files with 97 additions and 54 deletions
|
@ -5,10 +5,11 @@ import (
|
|||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -7,10 +7,11 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -4,10 +4,11 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -3,10 +3,11 @@ package main
|
|||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -5,8 +5,9 @@ import (
|
|||
_ "embed"
|
||||
"text/template"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
//go:embed actorDocs.tpl
|
||||
|
|
|
@ -6,13 +6,14 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/mitchellh/hashstructure/v2"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/robfig/cron/v3"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
var cronParser = cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)
|
||||
|
|
|
@ -3,9 +3,10 @@ package main
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func getAuthorizationFromRequest(r *http.Request) (string, *twitch.Client, error) {
|
||||
|
|
|
@ -4,8 +4,9 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/go-irc/irc"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
)
|
||||
|
||||
type (
|
||||
|
|
|
@ -10,12 +10,13 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/gofrs/uuid/v3"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
const expectedMinConfigVersion = 2
|
||||
|
|
|
@ -9,10 +9,11 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
)
|
||||
|
||||
const websocketPingInterval = 30 * time.Second
|
||||
|
|
|
@ -4,11 +4,12 @@ import (
|
|||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/gofrs/uuid/v3"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
func registerEditorAutoMessageRoutes() {
|
||||
|
|
|
@ -4,11 +4,12 @@ import (
|
|||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/gofrs/uuid/v3"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
type (
|
||||
|
|
|
@ -6,8 +6,9 @@ import (
|
|||
"regexp"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
func registerEditorGlobalMethods() {
|
||||
|
|
|
@ -4,11 +4,12 @@ import (
|
|||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/gofrs/uuid/v3"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
func registerEditorRulesRoutes() {
|
||||
|
|
|
@ -3,9 +3,10 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
var _ plugins.RegisterFunc = Register
|
||||
|
|
|
@ -7,10 +7,11 @@ import (
|
|||
"text/template"
|
||||
"time"
|
||||
|
||||
korvike "github.com/Luzifer/korvike/functions"
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
korvike "github.com/Luzifer/korvike/functions"
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
var tplFuncs = newTemplateFuncProvider()
|
||||
|
|
|
@ -3,9 +3,10 @@ package main
|
|||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -3,10 +3,11 @@ package main
|
|||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -4,8 +4,9 @@ import (
|
|||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
const actorName = "delay"
|
||||
|
|
|
@ -3,9 +3,10 @@ package deleteactor
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
const actorName = "delete"
|
||||
|
|
|
@ -4,10 +4,11 @@ import (
|
|||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
)
|
||||
|
||||
const actorName = "modchannel"
|
||||
|
|
|
@ -7,12 +7,13 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -8,9 +8,10 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -6,9 +6,10 @@ import (
|
|||
"strconv"
|
||||
"sync"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -7,9 +7,10 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package raw
|
||||
|
||||
import (
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
const actorName = "raw"
|
||||
|
|
|
@ -4,10 +4,11 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
const actorName = "respond"
|
||||
|
|
|
@ -4,9 +4,10 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
const actorName = "timeout"
|
||||
|
|
|
@ -3,9 +3,10 @@ package whisper
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
const actorName = "whisper"
|
||||
|
|
|
@ -6,8 +6,9 @@ import (
|
|||
"math"
|
||||
"math/rand"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
func Register(args plugins.RegistrationArguments) error {
|
||||
|
|
5
irc.go
5
irc.go
|
@ -9,11 +9,12 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -5,9 +5,10 @@ import (
|
|||
"text/template"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
// Compile-time assertion
|
||||
|
|
|
@ -9,9 +9,10 @@ import (
|
|||
"plugin"
|
||||
"strings"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
func loadPlugins(pluginDir string) error {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package plugins
|
||||
|
||||
import (
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/robfig/cron/v3"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
)
|
||||
|
||||
type (
|
||||
|
|
|
@ -6,12 +6,13 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/mitchellh/hashstructure/v2"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
)
|
||||
|
||||
type (
|
||||
|
|
|
@ -5,9 +5,10 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/go-irc/irc"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -4,6 +4,9 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
"github.com/Luzifer/twitch-bot/internal/actors/ban"
|
||||
"github.com/Luzifer/twitch-bot/internal/actors/delay"
|
||||
|
@ -20,8 +23,6 @@ import (
|
|||
"github.com/Luzifer/twitch-bot/internal/template/random"
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
3
store.go
3
store.go
|
@ -9,8 +9,9 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
const eventSubSecretLength = 32
|
||||
|
|
|
@ -8,10 +8,11 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/wzshiming/openapi/spec"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -15,12 +15,13 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
"github.com/gofrs/uuid/v3"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/mitchellh/hashstructure/v2"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -11,9 +11,10 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/backoff"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/backoff"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -4,10 +4,11 @@ import (
|
|||
"encoding/json"
|
||||
"sync"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Luzifer/twitch-bot/plugins"
|
||||
"github.com/Luzifer/twitch-bot/twitch"
|
||||
)
|
||||
|
||||
type (
|
||||
|
|
|
@ -4,11 +4,12 @@ import (
|
|||
"encoding/hex"
|
||||
"net/http"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
"github.com/gofrs/uuid/v3"
|
||||
"github.com/pkg/errors"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
|
||||
"github.com/Luzifer/go_helpers/v2/str"
|
||||
)
|
||||
|
||||
func fillAuthToken(token *configAuthToken) error {
|
||||
|
|
Loading…
Reference in a new issue