move stat to 23:00
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-04-06 17:56:04 +07:00
parent 64345c9350
commit 4ceb63a307
2 changed files with 7 additions and 12 deletions
+2 -7
View File
@@ -126,7 +126,7 @@ func (db *DB) SetPause(chatID int64, duration time.Duration) error {
return err
}
func (db *DB) GetStat(chatID int64, cron bool) (map[string]int, error) {
func (db *DB) GetStat(chatID int64) (map[string]int, error) {
ctx := context.Background()
if err := db.AddChat(chatID); err != nil {
@@ -135,12 +135,7 @@ func (db *DB) GetStat(chatID int64, cron bool) (map[string]int, error) {
loc, _ := time.LoadLocation("Asia/Novosibirsk")
t := time.Now().In(loc)
if cron {
t = t.Add(-24 * time.Hour)
}
if !cron {
t = time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, loc)
}
t = time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, loc)
res := map[string]int{}