From df441014ed2b2c9629355b8464ebd3ba962da0d3 Mon Sep 17 00:00:00 2001 From: Seraphim Strub Date: Sun, 23 Apr 2023 00:33:20 +0200 Subject: [PATCH] update versions and change to std logger --- cmd/dealsbot/api/epic.go | 4 +- cmd/dealsbot/main.go | 41 ++++-- cmd/dealsbot/repository/repository.go | 2 +- cmd/delcombot/main.go | 14 +-- cmd/domaincheckbot/main.go | 19 ++- cmd/domaincheckbot/repository/repository.go | 2 +- cmd/funbot/command/img.go | 5 +- cmd/funbot/main.go | 13 +- cmd/tempbot/main.go | 18 ++- cmd/vcbot/config/apple.go | 4 +- cmd/vcbot/event/event.go | 9 +- cmd/vcbot/helper/helper.go | 21 ++-- cmd/vcbot/main.go | 9 +- cmd/welcomebot/event/listener.go | 25 ++-- cmd/welcomebot/main.go | 9 +- go.mod | 34 ++--- go.sum | 130 ++++++++++++++------ 17 files changed, 212 insertions(+), 147 deletions(-) diff --git a/cmd/dealsbot/api/epic.go b/cmd/dealsbot/api/epic.go index 49dcf08..66133f6 100644 --- a/cmd/dealsbot/api/epic.go +++ b/cmd/dealsbot/api/epic.go @@ -3,8 +3,8 @@ package api import ( "encoding/json" "fmt" - "github.com/disgoorg/log" "io" + "log" "net/http" "time" ) @@ -113,7 +113,7 @@ func (e EpicStruct) Load() error { productSlug = element.OfferMappings[0].PageSlug } if productSlug == "" { - log.Errorf("product slug not found for: %v", element.Title) + log.Printf("ERROR: product slug not found for: %v", element.Title) continue } diff --git a/cmd/dealsbot/main.go b/cmd/dealsbot/main.go index b294c85..d499c8e 100644 --- a/cmd/dealsbot/main.go +++ b/cmd/dealsbot/main.go @@ -9,10 +9,11 @@ import ( "github.com/disgoorg/disgo/discord" "github.com/disgoorg/disgo/rest" "github.com/disgoorg/disgo/webhook" - "github.com/disgoorg/log" "github.com/disgoorg/snowflake/v2" + "github.com/getsentry/sentry-go" "grow.rievo.dev/discordBots/cmd/dealsbot/api" "grow.rievo.dev/discordBots/cmd/dealsbot/repository" + "log" "os" "os/signal" "reflect" @@ -36,9 +37,23 @@ func main() { // - origin // - check ubisoft works - log.SetLevel(log.LevelInfo) - log.Info("starting dealsbot...") - log.Info("disgo version: ", disgo.Version) + err := sentry.Init(sentry.ClientOptions{ + Dsn: "https://0282823b5ee14546a4c154c129109a31@sentry.rvo.one/2", + // Set TracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + // We recommend adjusting this value in production, + TracesSampleRate: 1.0, + }) + if err != nil { + log.Fatalf("sentry.Init: %s", err) + } + // Flush buffered events before the program terminates. + defer sentry.Flush(2 * time.Second) + + sentry.CaptureMessage("DEBUG: dealsbot started") + + log.Printf("INFO: starting dealsbot...") + log.Printf("INFO: disgo version: %v", disgo.Version) client := webhook.New(webhookID, webhookToken) defer client.Close(context.TODO()) @@ -59,7 +74,7 @@ func main() { for _, api := range apis { err := api.Load() if err != nil { - log.Error(err) + log.Printf("ERROR: %v", err) } } var deals []api.Deal @@ -72,15 +87,15 @@ func main() { retrievedDeal, _ := repo.GetValue(deal.Id) if deal.Id == retrievedDeal.Id { - log.Debugf("%v is already published", deal.Id) + log.Printf("DEBUG: %v is already published", deal.Id) } else if reflect.DeepEqual(deal, retrievedDeal) { - log.Errorf("%v is published but not equal", deal.Id) + log.Printf("ERROR: %v is published but not equal", deal.Id) } else { - log.Infof("%v is new and will be published", deal.Id) + log.Printf("INFO: %v is new and will be published", deal.Id) go sendWebhook(client, deal) err := repo.SetValue(deal) if err != nil { - log.Error(err) + log.Printf("ERROR: %v", err) } } } @@ -88,9 +103,9 @@ func main() { case <-tickerGC.C: err := repo.RunGC() if err != nil && !errors.Is(err, badger.ErrNoRewrite) { - log.Errorf("error with GC: %v", err) + log.Printf("ERROR: GC: %v", err) } else { - log.Debug("GC successful") + log.Printf("DEBUG: GC successful") } case <-quit: ticker.Stop() @@ -100,7 +115,7 @@ func main() { } }() - log.Infof("dealsbot is now running. Press CTRL-C to exit.") + log.Printf("INFO: dealsbot is now running. Press CTRL-C to exit.") s := make(chan os.Signal, 1) signal.Notify(s, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) <-s @@ -115,6 +130,6 @@ func sendWebhook(client webhook.Client, deal api.Deal) { SetContent(status).Build(), rest.WithDelay(2*time.Second), ); err != nil { - log.Errorf("error sending message %v", err.Error()) + log.Printf("ERROR: sending message %v", err.Error()) } } diff --git a/cmd/dealsbot/repository/repository.go b/cmd/dealsbot/repository/repository.go index f2ed638..4c5845c 100644 --- a/cmd/dealsbot/repository/repository.go +++ b/cmd/dealsbot/repository/repository.go @@ -3,8 +3,8 @@ package repository import ( "encoding/json" "github.com/dgraph-io/badger/v4" - "github.com/disgoorg/log" "grow.rievo.dev/discordBots/cmd/dealsbot/api" + "log" ) type Repository interface { diff --git a/cmd/delcombot/main.go b/cmd/delcombot/main.go index bc6d36f..2f8c3a2 100644 --- a/cmd/delcombot/main.go +++ b/cmd/delcombot/main.go @@ -2,13 +2,12 @@ package main import ( "context" - "fmt" "github.com/disgoorg/disgo" "github.com/disgoorg/disgo/bot" "github.com/disgoorg/disgo/cache" "github.com/disgoorg/disgo/discord" "github.com/disgoorg/disgo/gateway" - "github.com/disgoorg/log" + "log" "os" ) @@ -19,9 +18,8 @@ var ( // this bot should in theory delete all registered commands for a certain bot func main() { - log.SetLevel(log.LevelDebug) - log.Info("starting delcombot...") - log.Info("disgo version: ", disgo.Version) + log.Printf("INFO: starting delcombot...") + log.Printf("INFO: disgo version: %v", disgo.Version) // permissions: // intent: @@ -44,17 +42,17 @@ func main() { client.Caches().GuildsForEach(func(guild discord.Guild) { if _, err = client.Rest().SetGuildCommands(client.ApplicationID(), guild.ID, noCommands); err != nil { - log.Info(fmt.Sprintf("error deleting guild commands from %v: ", guild.Name), err) + log.Printf("INFO: error deleting guild commands from %v: %v", guild.Name, err) } }) if _, err = client.Rest().SetGlobalCommands(client.ApplicationID(), noCommands); err != nil { - log.Info("error deleting global commands", err) + log.Printf("INFO: error deleting global commands %v", err) } if err = client.OpenGateway(context.TODO()); err != nil { log.Fatal("error while connecting to gateway: ", err) } - log.Infof("delcombot removed all guild and global commands") + log.Printf("INFO: delcombot removed all guild and global commands") } diff --git a/cmd/domaincheckbot/main.go b/cmd/domaincheckbot/main.go index a088bdc..360d63d 100644 --- a/cmd/domaincheckbot/main.go +++ b/cmd/domaincheckbot/main.go @@ -9,11 +9,11 @@ import ( "github.com/disgoorg/disgo/discord" "github.com/disgoorg/disgo/rest" "github.com/disgoorg/disgo/webhook" - "github.com/disgoorg/log" "github.com/disgoorg/snowflake/v2" "grow.rievo.dev/discordBots/cmd/domaincheckbot/config" "grow.rievo.dev/discordBots/cmd/domaincheckbot/dns" "grow.rievo.dev/discordBots/cmd/domaincheckbot/repository" + "log" "os" "os/signal" "reflect" @@ -29,9 +29,8 @@ var ( // TODO: clear db from domains removed from json func main() { - log.SetLevel(log.LevelInfo) - log.Info("starting domainCheck...") - log.Info("disgo version: ", disgo.Version) + log.Printf("INFO: starting domainCheck...") + log.Printf("INFO: disgo version: %v", disgo.Version) client := webhook.New(webhookID, webhookToken) defer client.Close(context.TODO()) @@ -54,9 +53,9 @@ func main() { case <-tickerGC.C: err := repo.RunGC() if err != nil && !errors.Is(err, badger.ErrNoRewrite) { - log.Errorf("error with GC: %v", err) + log.Printf("ERROR: with GC: %v", err) } else { - log.Debug("GC successful") + log.Printf("DEBUG: GC successful") } case <-quit: @@ -67,7 +66,7 @@ func main() { } }() - log.Infof("domainCheck is now running. Press CTRL-C to exit.") + log.Printf("INFO: domainCheck is now running. Press CTRL-C to exit.") s := make(chan os.Signal, 1) signal.Notify(s, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) <-s @@ -77,10 +76,10 @@ func checkDomain(counter int, d string, repo *repository.DomainRepository, clien domain := dns.CheckDomain(d) retrievedDomain, _ := repo.GetValue(d) if reflect.DeepEqual(domain, retrievedDomain) { - log.Debugf(" %v: did not change", d) + log.Printf("DEBUG: %v: did not change", d) return } - log.Infof("!%v: changed", d) + log.Printf("INFO: !%v: changed", d) counter += 1 if counter >= 2 { go sendWebhook(client, domain, retrievedDomain) @@ -103,6 +102,6 @@ func sendWebhook(client webhook.Client, domain repository.Domain, oldDomain repo SetContent(status).Build(), rest.WithDelay(2*time.Second), ); err != nil { - log.Errorf("error sending message %v", err.Error()) + log.Printf("ERROR: sending message %v", err.Error()) } } diff --git a/cmd/domaincheckbot/repository/repository.go b/cmd/domaincheckbot/repository/repository.go index cdadc66..c589fb2 100644 --- a/cmd/domaincheckbot/repository/repository.go +++ b/cmd/domaincheckbot/repository/repository.go @@ -3,7 +3,7 @@ package repository import ( "encoding/json" "github.com/dgraph-io/badger/v4" - "github.com/disgoorg/log" + "log" ) type Domain struct { diff --git a/cmd/funbot/command/img.go b/cmd/funbot/command/img.go index 022e96d..2ff62c0 100644 --- a/cmd/funbot/command/img.go +++ b/cmd/funbot/command/img.go @@ -5,6 +5,7 @@ import ( "github.com/disgoorg/disgo/discord" "github.com/disgoorg/disgo/events" "grow.rievo.dev/discordBots/cmd/funbot/imgur" + "log" "strings" ) @@ -32,7 +33,7 @@ func handlerImg(event *events.ApplicationCommandInteractionCreate) { } }(value) if err != nil { - event.Client().Logger().Error("error on getting link: ", err) + log.Printf("ERROR: error on getting link: %v", err) return } @@ -40,7 +41,7 @@ func handlerImg(event *events.ApplicationCommandInteractionCreate) { SetContent(link). SetEphemeral(false).Build()) if err != nil { - event.Client().Logger().Error("error on sending response: ", err) + log.Printf("ERROR: error on sending response: %v", err) return } } diff --git a/cmd/funbot/main.go b/cmd/funbot/main.go index ac77707..69d9254 100644 --- a/cmd/funbot/main.go +++ b/cmd/funbot/main.go @@ -6,9 +6,9 @@ import ( "github.com/disgoorg/disgo/bot" "github.com/disgoorg/disgo/cache" "github.com/disgoorg/disgo/gateway" - "github.com/disgoorg/log" "grow.rievo.dev/discordBots/cmd/funbot/command" "grow.rievo.dev/discordBots/cmd/funbot/config" + "log" "os" "os/signal" "strings" @@ -16,9 +16,8 @@ import ( ) func main() { - log.SetLevel(log.LevelInfo) - log.Info("starting funbot...") - log.Info("disgo version: ", disgo.Version) + log.Printf("INFO: starting funbot...") + log.Printf("INFO: disgo version: %v", disgo.Version) // permissions: // intent: @@ -51,7 +50,7 @@ func main() { } if config.RegisterGuildID != 0 { if _, err = client.Rest().SetGuildCommands(client.ApplicationID(), config.RegisterGuildID, config.NoCommands); err != nil { - log.Info("error deleting guild commands", err) + log.Printf("INFO: error deleting guild commands %v", err) } } } else { @@ -59,7 +58,7 @@ func main() { log.Fatal("error while registering commands: ", err) } if _, err = client.Rest().SetGlobalCommands(client.ApplicationID(), config.NoCommands); err != nil { - log.Info("error deleting global commands", err) + log.Printf("INFO: error deleting global commands %v", err) } } @@ -67,7 +66,7 @@ func main() { log.Fatal("error while connecting to gateway: ", err) } - log.Infof("funbot is now running. Press CTRL-C to exit.") + log.Printf("INFO: funbot is now running. Press CTRL-C to exit.") s := make(chan os.Signal, 1) signal.Notify(s, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) <-s diff --git a/cmd/tempbot/main.go b/cmd/tempbot/main.go index 42f2231..3bc349e 100644 --- a/cmd/tempbot/main.go +++ b/cmd/tempbot/main.go @@ -6,8 +6,8 @@ import ( "github.com/disgoorg/disgo/bot" "github.com/disgoorg/disgo/cache" "github.com/disgoorg/disgo/gateway" - "github.com/disgoorg/log" "github.com/disgoorg/snowflake/v2" + "log" "os" "os/signal" "syscall" @@ -21,9 +21,8 @@ var ( ) func main() { - log.SetLevel(log.LevelInfo) - log.Info("starting tempbot...") - log.Info("disgo version: ", disgo.Version) + log.Printf("INFO: starting tempbot...") + log.Printf("INFO: disgo version: %v", disgo.Version) // permissions: Manage Messages // intent: @@ -62,13 +61,12 @@ func main() { ticker := time.NewTicker(1 * time.Minute) quit := make(chan struct{}) go func() { - client.Logger().Debug("does it even run") for { select { case <-ticker.C: messages, err := client.Rest().GetMessages(channelTempID, 0, 0, 0, 100) if err != nil { - client.Logger().Error("error getting messages: ", err) + log.Printf("ERROR: getting messages: %v", err) } var messageIDs []snowflake.ID for _, message := range messages { @@ -76,17 +74,17 @@ func main() { messageIDs = append(messageIDs, message.ID) } } - client.Logger().Debug("deleting messages: ", len(messageIDs)) + log.Printf("DEBUG: deleting messages: %v", len(messageIDs)) if len(messageIDs) == 1 { err = client.Rest().DeleteMessage(channelTempID, messageIDs[0]) if err != nil { - client.Logger().Error("error deleting messages: ", err) + log.Printf("ERROR: deleting messages: %v", err) } } if len(messageIDs) > 1 { err = client.Rest().BulkDeleteMessages(channelTempID, messageIDs) if err != nil { - client.Logger().Error("error deleting messages: ", err) + log.Printf("ERROR: deleting messages: %v", err) } } case <-quit: @@ -96,7 +94,7 @@ func main() { } }() - log.Infof("tempbot is now running. Press CTRL-C to exit.") + log.Printf("INFO: tempbot is now running. Press CTRL-C to exit.") s := make(chan os.Signal, 1) signal.Notify(s, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) <-s diff --git a/cmd/vcbot/config/apple.go b/cmd/vcbot/config/apple.go index 6b2d0c0..da7776e 100644 --- a/cmd/vcbot/config/apple.go +++ b/cmd/vcbot/config/apple.go @@ -2,8 +2,8 @@ package config import ( "encoding/json" - "github.com/disgoorg/log" "io" + "log" "net/http" ) @@ -35,6 +35,6 @@ func LoadAppleList() error { return err } AppleList = data.Body - log.Debug("loaded apple list of lenght: ", len(AppleList)) + log.Printf("DEBUG: loaded apple list of lenght: %v", len(AppleList)) return nil } diff --git a/cmd/vcbot/event/event.go b/cmd/vcbot/event/event.go index e79f635..1dcc31e 100644 --- a/cmd/vcbot/event/event.go +++ b/cmd/vcbot/event/event.go @@ -4,10 +4,11 @@ import ( "fmt" "github.com/disgoorg/disgo/events" "grow.rievo.dev/discordBots/cmd/vcbot/helper" + "log" ) func JoinEvent(event *events.GuildVoiceJoin) { - event.Client().Logger().Debug("JoinEvent") + log.Printf("DEBUG: JoinEvent") channelId := *event.VoiceState.ChannelID channel, _ := event.Client().Rest().GetChannel(channelId) channelName := channel.Name() @@ -26,7 +27,7 @@ func MoveEvent(event *events.GuildVoiceMove) { // no that's not a move event return } - event.Client().Logger().Debug("MoveEvent") + log.Printf("DEBUG: MoveEvent") channelOldId := *event.OldVoiceState.ChannelID channelOld, _ := event.Client().Rest().GetChannel(channelOldId) channelOldName := channelOld.Name() @@ -44,9 +45,9 @@ func MoveEvent(event *events.GuildVoiceMove) { } func LeaveEvent(event *events.GuildVoiceLeave) { - event.Client().Logger().Debug("LeaveEvent") + log.Printf("DEBUG: LeaveEvent") if event.OldVoiceState.ChannelID == nil { - event.Client().Logger().Error("OldVoiceState.ChannelID missing") + log.Printf("ERROR: OldVoiceState.ChannelID missing") return } channelOldId := *event.OldVoiceState.ChannelID diff --git a/cmd/vcbot/helper/helper.go b/cmd/vcbot/helper/helper.go index 0b2ae52..95a02dd 100644 --- a/cmd/vcbot/helper/helper.go +++ b/cmd/vcbot/helper/helper.go @@ -7,6 +7,7 @@ import ( "github.com/disgoorg/disgo/discord" "github.com/disgoorg/snowflake/v2" "grow.rievo.dev/discordBots/cmd/vcbot/config" + "log" "math/rand" ) @@ -14,14 +15,14 @@ func SendNoMention(client bot.Client, msg, msgEdit string) { message, err := client.Rest().CreateMessage(config.ChannelVoiceLogID, discord.NewMessageCreateBuilder(). SetContent(msg).Build()) if err != nil { - client.Logger().Error("unable to send channel message: ", err) + log.Printf("ERROR: unable to send channel message: %v", err) return } _, err = client.Rest().UpdateMessage(config.ChannelVoiceLogID, message.ID, discord.NewMessageUpdateBuilder().ClearContent().SetContent(msgEdit).Build()) if err != nil { - client.Logger().Error("unable to update channel message: ", err) + log.Printf("ERROR: unable to update channel message: %v", err) return } } @@ -70,7 +71,7 @@ func UpdateVoiceChannels(client bot.Client, deleteChannels bool) { voiceChannels, err := GetVoiceChannels(client) if err != nil { - client.Logger().Error("error in getVoiceChannels: ", err) + log.Printf("ERROR: error in getVoiceChannels: %v", err) } voiceChannelsWithState := make(map[snowflake.ID]string) voiceChannelsEmpty := make(map[snowflake.ID]string) @@ -93,16 +94,16 @@ func UpdateVoiceChannels(client bot.Client, deleteChannels bool) { }) if len(voiceChannels) == 2 && len(voiceChannelsWithState) == 0 { - client.Logger().Debug("all channels are empty") + log.Printf("DEBUG: all channels are empty") return } if len(voiceChannelsWithState) >= len(voiceChannels) { // if there are no empty voiceChannels create one - client.Logger().Debug("new channel has to be created") + log.Printf("DEBUG: new channel has to be created") name, err := GetName(voiceChannels) if err != nil { - client.Logger().Error("no empty channels") + log.Printf("ERROR: no empty channels") return } _, err = client.Rest().CreateGuildChannel(config.RegisterGuildID, discord.GuildVoiceChannelCreate{ @@ -118,15 +119,15 @@ func UpdateVoiceChannels(client bot.Client, deleteChannels bool) { if len(voiceChannels)-len(voiceChannelsWithState) > 1 && deleteChannels { // if there are more than one empty voiceChannels delete all but 1 - client.Logger().Debug("channel has to be deleted") - client.Logger().Debug("empty channels: ", voiceChannelsEmpty) + log.Printf("DEBUG: channel has to be deleted") + log.Printf("DEBUG: empty channels: %v", voiceChannelsEmpty) for id, s := range voiceChannelsEmpty { // get the oldest channel and delete it - client.Logger().Debug("deleting: ", s) + log.Printf("DEBUG: deleting: %v", s) err := client.Rest().DeleteChannel(id) if err != nil { - client.Logger().Error("not able to delete: ", err) + log.Printf("ERROR: not able to delete: %v", err) return } break diff --git a/cmd/vcbot/main.go b/cmd/vcbot/main.go index b04e180..61138e2 100644 --- a/cmd/vcbot/main.go +++ b/cmd/vcbot/main.go @@ -6,18 +6,17 @@ import ( "github.com/disgoorg/disgo/bot" "github.com/disgoorg/disgo/cache" "github.com/disgoorg/disgo/gateway" - "github.com/disgoorg/log" "grow.rievo.dev/discordBots/cmd/vcbot/config" "grow.rievo.dev/discordBots/cmd/vcbot/event" + "log" "os" "os/signal" "syscall" ) func main() { - log.SetLevel(log.LevelInfo) - log.Info("starting vcbot...") - log.Info("disgo version: ", disgo.Version) + log.Printf("INFO: starting vcbot...") + log.Printf("INFO: disgo version: %v", disgo.Version) err := config.LoadAppleList() if err != nil { @@ -66,7 +65,7 @@ func main() { log.Fatal("couldn't find needed channel") } - log.Infof("vcbot is now running. Press CTRL-C to exit.") + log.Printf("ERROR: vcbot is now running. Press CTRL-C to exit.") s := make(chan os.Signal, 1) signal.Notify(s, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) <-s diff --git a/cmd/welcomebot/event/listener.go b/cmd/welcomebot/event/listener.go index f062a1e..f61f600 100644 --- a/cmd/welcomebot/event/listener.go +++ b/cmd/welcomebot/event/listener.go @@ -5,6 +5,7 @@ import ( "github.com/disgoorg/disgo/discord" "github.com/disgoorg/disgo/events" "grow.rievo.dev/discordBots/cmd/welcomebot/config" + "log" "time" ) @@ -12,12 +13,12 @@ func JoinEvent(event *events.GuildMemberJoin) { // on join send message in welcome user := event.Member.User if event.GuildID.String() != config.RegisterGuildID.String() { - event.Client().Logger().Error("join from an other guild") + log.Printf("ERROR: join from an other guild") return } guild, err := event.Client().Rest().GetGuild(config.RegisterGuildID, false) if err != nil { - event.Client().Logger().Error("could not find guild: ", err) + log.Printf("ERRPR: could not find guild: %v", err) return } @@ -38,7 +39,7 @@ func JoinEvent(event *events.GuildMemberJoin) { Build(), ) if err != nil { - event.Client().Logger().Error("on sending join message: ", err) + log.Printf("ERROR: on sending join message: %v", err) return } } @@ -47,12 +48,12 @@ func LeaveEvent(event *events.GuildMemberLeave) { user := event.User if event.GuildID.String() != config.RegisterGuildID.String() { - event.Client().Logger().Error("leave from an other guild") + log.Printf("ERROR: leave from an other guild") return } guild, err := event.Client().Rest().GetGuild(config.RegisterGuildID, false) if err != nil { - event.Client().Logger().Error("could not find guild: ", err) + log.Printf("ERROR: could not find guild: %v", err) return } @@ -63,14 +64,14 @@ func LeaveEvent(event *events.GuildMemberLeave) { Build(), ) if err != nil { - event.Client().Logger().Error("on sending leave message: ", err) + log.Printf("ERROR: on sending leave message: %v", err) return } } func ReactionEvent(event *events.ComponentInteractionCreate) { - if event.ChannelID() != config.ChannelWelcomeID { + if event.Channel().ID != config.ChannelWelcomeID { // reaction is not in welcome chat return } @@ -86,7 +87,7 @@ func ReactionEvent(event *events.ComponentInteractionCreate) { } approver, err := event.Client().Rest().GetMember(config.RegisterGuildID, approverID) if err != nil { - event.Client().Logger().Error("could not find user: ", err) + log.Printf("ERROR: could not find user: %v", err) return } hasPermission := func() bool { @@ -104,7 +105,7 @@ func ReactionEvent(event *events.ComponentInteractionCreate) { SetContent("you don't have permissions to do this"). Build()) if err != nil { - event.Client().Logger().Error("could not respond to reaction: ", err) + log.Printf("ERROR: could not respond to reaction: %v", err) return } return @@ -113,7 +114,7 @@ func ReactionEvent(event *events.ComponentInteractionCreate) { messageID := event.Message.ID message, err := event.Client().Rest().GetMessage(config.ChannelWelcomeID, messageID) if err != nil { - event.Client().Logger().Error("could not find message: ", err) + log.Printf("ERROR: could not find message: %v", err) return } if len(message.Mentions) != 1 { @@ -125,7 +126,7 @@ func ReactionEvent(event *events.ComponentInteractionCreate) { // add role to user (bot role needs to be above roleAppleID) err = event.Client().Rest().AddMemberRole(config.RegisterGuildID, user.ID, config.RoleAppleID) if err != nil { - event.Client().Logger().Error("not able to add role: ", err) + log.Printf("ERROR: not able to add role: %v", err) return } @@ -149,7 +150,7 @@ func ReactionEvent(event *events.ComponentInteractionCreate) { ClearContainerComponents(). Build()) if err != nil { - event.Client().Logger().Error("could not update message: ", err) + log.Printf("ERROR: could not update message: %v", err) return } } diff --git a/cmd/welcomebot/main.go b/cmd/welcomebot/main.go index c9eba5e..d0058d8 100644 --- a/cmd/welcomebot/main.go +++ b/cmd/welcomebot/main.go @@ -6,18 +6,17 @@ import ( "github.com/disgoorg/disgo/bot" "github.com/disgoorg/disgo/cache" "github.com/disgoorg/disgo/gateway" - "github.com/disgoorg/log" "grow.rievo.dev/discordBots/cmd/welcomebot/config" "grow.rievo.dev/discordBots/cmd/welcomebot/event" + "log" "os" "os/signal" "syscall" ) func main() { - log.SetLevel(log.LevelInfo) - log.Info("starting welcomebot...") - log.Info("disgo version: ", disgo.Version) + log.Printf("INFO: starting welcomebot...") + log.Printf("INFO: disgo version: %v", disgo.Version) // permissions: Manage Roles // intent: Server Members Intent @@ -73,7 +72,7 @@ func main() { log.Fatal("couldn't find needed role") } - log.Infof("welcomebot is now running. Press CTRL-C to exit.") + log.Printf("INFO: welcomebot is now running. Press CTRL-C to exit.") s := make(chan os.Signal, 1) signal.Notify(s, syscall.SIGINT, syscall.SIGTERM, os.Interrupt) <-s diff --git a/go.mod b/go.mod index 4afc851..f8dff8f 100644 --- a/go.mod +++ b/go.mod @@ -3,31 +3,33 @@ module grow.rievo.dev/discordBots go 1.20 require ( - github.com/dgraph-io/badger/v4 v4.0.1 - github.com/disgoorg/disgo v0.15.1-0.20230203231532-07092d420798 + github.com/dgraph-io/badger/v4 v4.1.0 + github.com/disgoorg/disgo v0.16.2 github.com/disgoorg/log v1.2.1-0.20220709130509-d138f028c3b7 github.com/disgoorg/snowflake/v2 v2.0.1 - golang.org/x/net v0.5.0 + github.com/getsentry/sentry-go v0.20.0 + golang.org/x/net v0.9.0 ) require ( - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/disgoorg/json v1.0.0 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect - github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect - github.com/golang/protobuf v1.3.1 // indirect - github.com/golang/snappy v0.0.3 // indirect - github.com/google/flatbuffers v1.12.1 // indirect + github.com/golang/glog v1.1.1 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/flatbuffers v23.3.3+incompatible // indirect github.com/gorilla/websocket v1.5.0 // indirect - github.com/klauspost/compress v1.12.3 // indirect + github.com/klauspost/compress v1.16.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b // indirect - go.opencensus.io v0.22.5 // indirect - golang.org/x/crypto v0.5.0 // indirect - golang.org/x/exp v0.0.0-20230203172020-98cc5a0785f9 // indirect - golang.org/x/sys v0.4.0 // indirect + go.opencensus.io v0.24.0 // indirect + golang.org/x/crypto v0.8.0 // indirect + golang.org/x/exp v0.0.0-20230420155640-133eef4313cb // indirect + golang.org/x/sys v0.7.0 // indirect + golang.org/x/text v0.9.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect ) diff --git a/go.sum b/go.sum index 290541f..0375a9a 100644 --- a/go.sum +++ b/go.sum @@ -1,76 +1,106 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/badger/v4 v4.0.1 h1:zwLYFc4sfxKdaRTvS6wlHsSuYWNUiWnYLU+TS+/nCDI= -github.com/dgraph-io/badger/v4 v4.0.1/go.mod h1:edFJfgVfwYjg+grodpS7Yj2vohQMK3VL6eCaR6EpRJU= +github.com/dgraph-io/badger/v4 v4.1.0 h1:E38jc0f+RATYrycSUf9LMv/t47XAy+3CApyYSq4APOQ= +github.com/dgraph-io/badger/v4 v4.1.0/go.mod h1:P50u28d39ibBRmIJuQC/NSdBOg46HnHw7al2SW5QRHg= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/disgoorg/disgo v0.15.1-0.20230203231532-07092d420798 h1:BW5wOwP53TX8XgjrSSL6DiIzKijHpKBDl/jWAGYGT20= -github.com/disgoorg/disgo v0.15.1-0.20230203231532-07092d420798/go.mod h1:j7MCI6foUipYNozxwttr2hcaEQa3gNEbcwgLnyLUf6E= +github.com/disgoorg/disgo v0.16.2 h1:Qo1Cwmev2mxQll+f/NDB8kTCyMCrAq3/1JohXcpgUYQ= +github.com/disgoorg/disgo v0.16.2/go.mod h1:hUkznOmm+f+owh/MuOBX0sDviQV5cL0FqcWbpIyV1Y0= github.com/disgoorg/json v1.0.0 h1:kDhSM661fgIuNoZF3BO5/odaR5NSq80AWb937DH+Pdo= github.com/disgoorg/json v1.0.0/go.mod h1:BHDwdde0rpQFDVsRLKhma6Y7fTbQKub/zdGO5O9NqqA= github.com/disgoorg/log v1.2.1-0.20220709130509-d138f028c3b7 h1:TDiZG14dzJgtdlt4sZjgLvtpA3Q0yxK9QMo1R1p2LCs= github.com/disgoorg/log v1.2.1-0.20220709130509-d138f028c3b7/go.mod h1:hhQWYTFTnIGzAuFPZyXJEi11IBm9wq+/TVZt/FEwX0o= github.com/disgoorg/snowflake/v2 v2.0.1 h1:CuUxGLwggUxEswZOmZ+mZ5i0xSumQdXW9tXW7uGqe+0= github.com/disgoorg/snowflake/v2 v2.0.1/go.mod h1:SPU9c2CNn5DSyb86QcKtdZgix9osEtKrHLW4rMhfLCs= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/getsentry/sentry-go v0.20.0 h1:bwXW98iMRIWxn+4FgPW7vMrjmbym6HblXALmhjHmQaQ= +github.com/getsentry/sentry-go v0.20.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/glog v1.1.1 h1:jxpi2eWoU84wbX9iIEyAeeoac3FLuifZpY9tcNUD9kw= +github.com/golang/glog v1.1.1/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= -github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/flatbuffers v23.3.3+incompatible h1:5PJI/WbJkaMTvpGxsHVKG/LurN/KnWXNyGpwSCDgen0= +github.com/google/flatbuffers v23.3.3+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.12.3 h1:G5AfA94pHPysR56qqrkO2pxEexdDzrpFJ6yt/VqWxVU= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b h1:qYTY2tN72LhgDj2rtWG+LI6TXFl2ygFQQ4YezfVaGQE= github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b/go.mod h1:/pA7k3zsXKdjjAiUhB5CjuKib9KJGCaLvZwtxGC8U0s= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= 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/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= -golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= +golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230203172020-98cc5a0785f9 h1:frX3nT9RkKybPnjyI+yvZh6ZucTZatCCEm9D47sZ2zo= -golang.org/x/exp v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230420155640-133eef4313cb h1:rhjz/8Mbfa8xROFiH+MQphmAmgqRM0bOMnytznhWEXk= +golang.org/x/exp v0.0.0-20230420155640-133eef4313cb/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -84,29 +114,31 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -117,10 +149,30 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=