From afc70788b6297cf536fc8a5b9e6f5e9e32c1e668 Mon Sep 17 00:00:00 2001 From: Yiyang Kang Date: Sat, 26 Nov 2022 21:05:25 +0800 Subject: [PATCH] change: shorten progress bar to fit iPhone screen poor iPhone user :( --- bot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.go b/bot.go index 6f92517..ac7d2d5 100644 --- a/bot.go +++ b/bot.go @@ -220,7 +220,7 @@ func drawBarForTrafficRecord(r stats.VnstatTrafficRecord) string { effective := lo.Max([]uint64{r.Rx, r.Tx}) max := config.MonthlyTrafficLimitGiB ratio := float64(effective) / 1024 / 1024 / 1024 / float64(max) - return fmt.Sprintf("`%s %2.0f%%`", drawBar(ratio, 25), ratio*100) + return fmt.Sprintf("`%s %2.0f%%`", drawBar(ratio, 16), ratio*100) } func handleYearProgressCmd(c tele.Context) error { @@ -232,7 +232,7 @@ func handleYearProgressCmd(c tele.Context) error { replyText := fmt.Sprintf( "\n%d is %2.0f%% complete.\n
%s
", - time.Now().Year(), ratio*100, drawBar(ratio, 25), + time.Now().Year(), ratio*100, drawBar(ratio, 20), ) return c.Reply(replyText, &tele.SendOptions{ParseMode: tele.ModeHTML}, tele.Silent) }