This commit is contained in:
@ -24,6 +24,7 @@ const (
|
||||
emojiUp = "\xE2\xAC\x86"
|
||||
emojiDeaths = "\xF0\x9F\x92\x80"
|
||||
emojiTime = "\xF0\x9F\x95\x90"
|
||||
emojiGun = "\xF0\x9F\x94\xAB"
|
||||
)
|
||||
|
||||
func (p *playerInfo) updatePlayerInfo(ctx context.Context) error {
|
||||
@ -36,10 +37,16 @@ func (p *playerInfo) updatePlayerInfo(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
kills, err := db.getKillsByOPlayerID(ctx, player.id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
test := `*%s* | %s
|
||||
%s Уровень: *%s*
|
||||
%s Смертей: *%d*
|
||||
%s Время в игре: %s
|
||||
%s Фрагов: %d
|
||||
`
|
||||
|
||||
access := "\xE2\x9D\x8C offLine"
|
||||
@ -55,12 +62,22 @@ func (p *playerInfo) updatePlayerInfo(ctx context.Context) error {
|
||||
test = fmt.Sprintf(test, player.name, access,
|
||||
emojiUp, level,
|
||||
emojiDeaths, player.deaths,
|
||||
emojiTime, player.onlineDuration.String())
|
||||
emojiTime, player.onlineDuration.String(),
|
||||
emojiGun, kills,
|
||||
)
|
||||
|
||||
if p.playerMessageID != 0 {
|
||||
mess := tgbotapi.NewEditMessageText(conf.ChatID, p.playerMessageID, test)
|
||||
mess.ParseMode = tgbotapi.ModeMarkdown
|
||||
|
||||
ikm := tgbotapi.NewInlineKeyboardMarkup(
|
||||
tgbotapi.NewInlineKeyboardRow(
|
||||
tgbotapi.NewInlineKeyboardButtonData("Подробнее", "additional"),
|
||||
),
|
||||
)
|
||||
|
||||
mess.ReplyMarkup = &ikm
|
||||
|
||||
_, err := botApi.Send(mess)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed to update message")
|
||||
|
Reference in New Issue
Block a user