fix: initialize remake count

This commit is contained in:
purofle 2025-05-06 02:20:10 +08:00
parent eda80b6650
commit 544a8c711b
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View File

@ -21,10 +21,11 @@ type Handler struct {
remake *Remake remake *Remake
} }
func NewHandler(bot *tele.Bot, logger *zap.Logger) *Handler { func NewHandler(bot *tele.Bot, logger *zap.Logger, remake *Remake) *Handler {
return &Handler{ return &Handler{
bot: bot, bot: bot,
logger: logger, logger: logger,
remake: remake,
} }
} }

View File

@ -40,5 +40,8 @@ func NewRemake() *Remake {
for _, country := range remake.CountryList { for _, country := range remake.CountryList {
remake.TotalPopulation += country.Population remake.TotalPopulation += country.Population
} }
remake.RemakeCount = make(map[int64]*RemakeData)
return &remake return &remake
} }