From 51300096442abd19d590652367700b51beae3b70 Mon Sep 17 00:00:00 2001 From: Eccentric Date: Wed, 3 Jan 2024 19:56:23 +0000 Subject: [PATCH] pretty console --- discord/account.go | 4 ---- discord/discord.go | 12 ++++++------ fortnite/image.go | 2 +- fortnite/interact.go | 4 ++-- fortnite/person.go | 1 - fortnite/shop.go | 2 +- handlers/client.go | 1 - main.go | 4 ++-- person/attribute.go | 1 - person/gift.go | 1 - person/item.go | 1 - 11 files changed, 12 insertions(+), 21 deletions(-) diff --git a/discord/account.go b/discord/account.go index 23b0e45..cef1cd2 100644 --- a/discord/account.go +++ b/discord/account.go @@ -41,19 +41,16 @@ func createHandler(s *discordgo.Session, i *discordgo.InteractionCreate) { func createModalHandler(s *discordgo.Session, i *discordgo.InteractionCreate) { data := i.ModalSubmitData() if len(data.Components) <= 0 { - aid.Print("No components found") return } components, ok := data.Components[0].(*discordgo.ActionsRow) if !ok { - aid.Print("Failed to assert TextInput") return } display, ok := components.Components[0].(*discordgo.TextInput) if !ok { - aid.Print("Failed to assert TextInput") return } @@ -189,7 +186,6 @@ func codeHandler(s *discordgo.Session, i *discordgo.InteractionCreate) { decrypt, err := aid.KeyPair.DecryptAndVerifyB64(encrypted, sig) if err || string(decrypt) != code { - aid.Print("Failed to verify code that was just generated so we're not going to send it") return } diff --git a/discord/discord.go b/discord/discord.go index ab35e38..ffa0a5a 100644 --- a/discord/discord.go +++ b/discord/discord.go @@ -68,7 +68,7 @@ func (c *DiscordClient) UnregisterCommands() { for _, command := range commands { err := c.Client.ApplicationCommandDelete(aid.Config.Discord.ID, aid.Config.Discord.Guild, command.ID) if err != nil { - aid.Print("Failed to delete command: " + command.Name) + aid.Print("(discord) failed to delete command: " + command.Name) } } @@ -77,7 +77,7 @@ func (c *DiscordClient) UnregisterCommands() { for _, command := range commands { err := c.Client.ApplicationCommandDelete(aid.Config.Discord.ID, "", command.ID) if err != nil { - aid.Print("Failed to delete command: " + command.Name) + aid.Print("(discord) failed to delete command: " + command.Name) } } } @@ -96,7 +96,7 @@ func (c *DiscordClient) RegisterCommands() { _, err := c.Client.ApplicationCommandBulkOverwrite(aid.Config.Discord.ID, aid.Config.Discord.Guild, update) if err != nil { - aid.Print("Failed to register commands", err) + aid.Print("(discord) failed to register commands", err) return } } @@ -104,7 +104,7 @@ func (c *DiscordClient) RegisterCommands() { func (c *DiscordClient) GetRegisteredCommands() []*discordgo.ApplicationCommand { commands, err := c.Client.ApplicationCommands(aid.Config.Discord.ID, aid.Config.Discord.Guild) if err != nil { - aid.Print("Failed to get commands") + aid.Print("(discord) failed to get commands") return nil } @@ -114,7 +114,7 @@ func (c *DiscordClient) GetRegisteredCommands() []*discordgo.ApplicationCommand func (c *DiscordClient) GetGlobalRegisteredCommands() []*discordgo.ApplicationCommand { commands, err := c.Client.ApplicationCommands(aid.Config.Discord.ID, "") if err != nil { - aid.Print("Failed to get commands") + aid.Print("(discord) failed to get commands") return nil } @@ -122,7 +122,7 @@ func (c *DiscordClient) GetGlobalRegisteredCommands() []*discordgo.ApplicationCo } func (c *DiscordClient) readyHandler(s *discordgo.Session, event *discordgo.Ready) { - aid.Print("Discord bot is ready") + aid.Print("(discord) bot is ready") } func (c *DiscordClient) interactionHandler(s *discordgo.Session, i *discordgo.InteractionCreate) { diff --git a/fortnite/image.go b/fortnite/image.go index 2f378a1..52f84fa 100644 --- a/fortnite/image.go +++ b/fortnite/image.go @@ -345,5 +345,5 @@ func GeneratePlaylistImages() { GenerateTrioImage() GenerateSquadImage() - aid.Print("Generated playlist images") + aid.Print("(snow) generated playlist images") } \ No newline at end of file diff --git a/fortnite/interact.go b/fortnite/interact.go index 8693f47..b6f3870 100644 --- a/fortnite/interact.go +++ b/fortnite/interact.go @@ -235,7 +235,7 @@ func (f *FortniteAPI) GetPlaylistImage(playlist string) (any, error) { } func PreloadCosmetics(max int) error { - aid.Print("Fortnite Assets from", StaticAPI.URL) + aid.Print("(snow) assets from", StaticAPI.URL) list, err := StaticAPI.GetAllCosmetics() if err != nil { @@ -324,7 +324,7 @@ func PreloadCosmetics(max int) error { withDisplayAssets++ } - aid.Print("Preloaded", len(Cosmetics.Items), "cosmetics with", withDisplayAssets, "display assets", "(", float64(withDisplayAssets)/float64(len(assetData))*100, "% ) coverage" ) + aid.Print("(snow) preloaded", len(Cosmetics.Items), "cosmetics") return nil } diff --git a/fortnite/person.go b/fortnite/person.go index ec1e962..f2822b3 100644 --- a/fortnite/person.go +++ b/fortnite/person.go @@ -145,6 +145,5 @@ func GiveEverything(person *p.Person) { } storage.Repo.BulkCreateItems(&items) - aid.Print("Gave everything to " + person.DisplayName) person.Save() } \ No newline at end of file diff --git a/fortnite/shop.go b/fortnite/shop.go index fc125ad..e2c9899 100644 --- a/fortnite/shop.go +++ b/fortnite/shop.go @@ -432,5 +432,5 @@ func GenerateRandomStorefront() { storefront.Add(weekly) StaticCatalog = storefront - aid.Print("Generated new random storefront") + aid.Print("(snow) generated random storefront") } \ No newline at end of file diff --git a/handlers/client.go b/handlers/client.go index 508804e..320f6cb 100644 --- a/handlers/client.go +++ b/handlers/client.go @@ -35,7 +35,6 @@ func PostClientProfileAction(c *fiber.Ctx) error { profile := person.GetProfileFromType(c.Query("profileId")) if profile == nil { - aid.Print(c.Query("profileId"), "not found") return c.Status(404).JSON(aid.ErrorBadRequest("No Profile Found")) } defer profile.ClearProfileChanges() diff --git a/main.go b/main.go index 00e951a..56d7744 100644 --- a/main.go +++ b/main.go @@ -26,8 +26,8 @@ func init() { case "postgres": postgresStorage := storage.NewPostgresStorage() if aid.Config.Database.DropAllTables { - aid.Print("Dropping all tables") postgresStorage.DropTables() + aid.Print("(snow) all tables dropped and reset") } postgresStorage.MigrateAll() device = postgresStorage @@ -127,7 +127,7 @@ func main() { player.Get("/locker", handlers.GetPlayerLocker) r.Hooks().OnListen(func(ld fiber.ListenData) error { - aid.Print("Listening on " + aid.Config.API.Host + ":" + ld.Port) + aid.Print("(fiber) listening on " + aid.Config.API.Host + ":" + ld.Port) return nil }) diff --git a/person/attribute.go b/person/attribute.go index ded96c2..5397f15 100644 --- a/person/attribute.go +++ b/person/attribute.go @@ -51,7 +51,6 @@ func (a *Attribute) Delete() { func (a *Attribute) Save() { if a.ProfileID == "" { - aid.Print("error saving attribute", a.Key, "profile id is empty") return } storage.Repo.SaveAttribute(a.ToDatabase(a.ProfileID)) diff --git a/person/gift.go b/person/gift.go index efb3b4d..5739558 100644 --- a/person/gift.go +++ b/person/gift.go @@ -116,7 +116,6 @@ func (g *Gift) ToDatabase(profileId string) *storage.DB_Gift { func (g *Gift) Save() { if g.ProfileID == "" { - aid.Print("error saving gift", g.ID, "no profile id") return } diff --git a/person/item.go b/person/item.go index 36a0f3a..5986ccb 100644 --- a/person/item.go +++ b/person/item.go @@ -184,7 +184,6 @@ func (i *Item) ToDatabase(profileId string) *storage.DB_Item { func (i *Item) Save() { if i.ProfileID == "" { - aid.Print("error saving item", i.ID, "no profile id") return }