From f6076f02d2cd1405095fec55f7b4fbc2af3fec1d Mon Sep 17 00:00:00 2001 From: Kichiyaki Date: Sat, 6 Jun 2020 14:59:11 +0200 Subject: [PATCH] fix bug with village url --- cron/cron.go | 2 +- cron/message.go | 2 +- main.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cron/cron.go b/cron/cron.go index c331326..5f21bf3 100644 --- a/cron/cron.go +++ b/cron/cron.go @@ -32,7 +32,7 @@ type handler struct { api *sdk.SDK } -func AttachHandlers(c *cron.Cron, cfg Config) { +func Attach(c *cron.Cron, cfg Config) { h := &handler{ since: time.Now(), serverRepo: cfg.ServerRepo, diff --git a/cron/message.go b/cron/message.go index 043ca20..ec57319 100644 --- a/cron/message.go +++ b/cron/message.go @@ -50,7 +50,7 @@ func newMessageData(cfg newMessageDataConfig) messageData { cfg.ennoblement.Village.Name, cfg.ennoblement.Village.X, cfg.ennoblement.Village.Y) - data.villageURL = utils.FormatVillageURL(cfg.world, cfg.host, cfg.ennoblement.VillageID) + data.villageURL = utils.FormatVillageURL(cfg.world, cfg.host, cfg.ennoblement.Village.ID) } if !isPlayerNil(cfg.ennoblement.OldOwner) { data.oldOwnerName = cfg.ennoblement.OldOwner.Name diff --git a/main.go b/main.go index 52489fc..4d0631d 100644 --- a/main.go +++ b/main.go @@ -66,7 +66,7 @@ func main() { c := cron.New(cron.WithChain( cron.SkipIfStillRunning(cron.VerbosePrintfLogger(log.New(os.Stdout, "cron: ", log.LstdFlags))), )) - _cron.AttachHandlers(c, _cron.Config{ + _cron.Attach(c, _cron.Config{ ServerRepo: serverRepo, TribeRepo: tribeRepo, Discord: sess,