From 1c6162962f33908726b46ab6584ac23e706a37d3 Mon Sep 17 00:00:00 2001 From: Jack Merrill Date: Mon, 21 Aug 2023 17:26:31 -0500 Subject: [PATCH] im smart --- fly.toml | 4 +--- internal/commands/studentlife/laundry.go | 2 +- main.go | 5 +++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fly.toml b/fly.toml index 3c19646..9c14b08 100644 --- a/fly.toml +++ b/fly.toml @@ -10,9 +10,7 @@ primary_region = "bos" build-target = "runner" [http_service] - internal_port = 8080 - force_https = true - auto_stop_machines = false + auto_stop_machines = true auto_start_machines = true min_machines_running = 1 processes = ["app"] diff --git a/internal/commands/studentlife/laundry.go b/internal/commands/studentlife/laundry.go index 1cf866f..055b9f7 100644 --- a/internal/commands/studentlife/laundry.go +++ b/internal/commands/studentlife/laundry.go @@ -24,7 +24,7 @@ type Machine struct { Name string `json:"name"` Type MachineType `json:"type"` Status string `json:"status"` - Time *time.Time `json:"time"` + Time *string `json:"time"` EstimatedTime *time.Time `json:"estimatedTime"` } diff --git a/main.go b/main.go index d6ba94a..02f918b 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ import ( studentlife "github.com/jackmerrill/hampbot/internal/commands/studentlife" util "github.com/jackmerrill/hampbot/internal/commands/util" "github.com/jackmerrill/hampbot/internal/utils/config" + "github.com/jackmerrill/hampbot/internal/utils/embed" "github.com/zekroTJA/shireikan" "github.com/charmbracelet/log" @@ -46,6 +47,10 @@ func main() { InvokeToLower: true, UseDefaultHelpCommand: true, OnError: func(ctx shireikan.Context, typ shireikan.ErrorType, err error) { + ctx.GetSession().ChannelMessageSendComplex(ctx.GetChannel().ID, &discordgo.MessageSend{ + Embed: embed.NewErrorEmbed(ctx).SetTitle("Error").SetDescription(err.Error()).MessageEmbed, + Reference: ctx.GetMessage().Reference(), + }) log.Error(err) }, })