This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"sync"
|
||||
|
||||
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
|
||||
"github.com/hako/durafmt"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
@ -59,10 +60,17 @@ func (p *playerInfo) updatePlayerInfo(ctx context.Context) error {
|
||||
level = fmt.Sprintf("%d", player.level)
|
||||
}
|
||||
|
||||
d := durafmt.Parse(player.onlineDuration).LimitFirstN(3)
|
||||
|
||||
units, err := durafmt.DefaultUnitsCoder.Decode("мес.:мес.,нед.:нед.,дн.:дн.,чс.:чс.,мин.:мин.,cек.:cек.,-:-,-:-")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
test = fmt.Sprintf(test, player.name, access,
|
||||
emojiUp, level,
|
||||
emojiDeaths, player.deaths,
|
||||
emojiTime, player.onlineDuration.String(),
|
||||
emojiTime, d.Format(units),
|
||||
emojiGun, kills,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user