Phuriwaj

Discord Text-Based Progress Bars

Render percentage bars in Discord messages using Unicode block characters inside a monospace code block. Works in any Discord client since it requires no special rendering.

Why / When to Use

When displaying progress, usage, or health metrics in a Discord bot message and you need a visual bar without image attachments. Pairs well with ANSI color labels.

Core Concept / Commands

Two key Unicode characters:

  • β–ˆ (U+2588) β€” filled block
  • β–‘ (U+2591) β€” light shade (empty)

Formula (10-block bar)

def make_bar(pct: int, width: int = 10) -> str:
    filled = round(pct / 100 * width)
    empty = width - filled
    return "β–ˆ" * filled + "β–‘" * empty
 
# Usage
bar = make_bar(80)   # β†’ "β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘"

Aligned multi-metric display

Wrap in a triple-backtick code block for monospace alignment:

CPU  [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘] 80%
RAM  [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘] 50%
DISK [β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘] 30%

Python to generate:

metrics = [("CPU", 80), ("RAM", 50), ("DISK", 30)]
lines = [f"{label:<5}[{make_bar(pct)}] {pct}%" for label, pct in metrics]
message = "```\n" + "\n".join(lines) + "\n```"

Key Options / Variants

StyleExample
Brackets[β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘] 80%
Pipe|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘| 80%
Label + barCPU [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘] 80%

Gotchas

  • Must use a triple-backtick code block to force monospace font; otherwise characters won’t align.
  • round() can cause minor off-by-one for some percentages β€” acceptable for display purposes.
  • Emoji (πŸ”΄πŸŸ‘πŸŸ’) can be combined outside the bar for quick color-coded severity.

Source

Conversation: β€œText-based percentage bars for Discord” β€” 2026-05-17

Updates β€” 2026-05-17

Self-contained build_bar variant (includes brackets + percentage label)

The build_bar function below returns the full formatted string including brackets and percentage β€” drop it directly into an f-string without extra formatting:

def build_bar(percentage: float, width: int = 10) -> str:
    filled = round(percentage / 100 * width)
    empty = width - filled
    return f"[{'β–ˆ' * filled}{'β–‘' * empty}] {percentage:.0f}%"
 
# Usage in a Discord message line:
token_indicator = 'πŸ”΄' if token_pct >= 80 else '🟑' if token_pct >= 50 else '🟒'
lines = [
    f"**Token Usage:** {token_indicator} {build_bar(token_pct)} of {token_cap} tokens",
    f"**Reset:** ⏰ __***{format_reset(token_reset)}***__",
]

Output: **Token Usage:** 🟑 [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘] 50% of 5000 tokens

Use build_bar when the bar and percentage belong together on one line. Use make_bar (core concept above) when you need the raw block string for custom placement.