change: shorten progress bar to fit iPhone screen
poor iPhone user :(
This commit is contained in:
		
							parent
							
								
									ce171109c8
								
							
						
					
					
						commit
						afc70788b6
					
				
							
								
								
									
										4
									
								
								bot.go
								
								
								
								
							
							
						
						
									
										4
									
								
								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 <b>%2.0f%%</b> complete.\n<pre>%s</pre>",
 | 
			
		||||
		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)
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue