
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
discord-progress-bar
Advanced tools
A Python library for creating customizable progress bars with Discord emojis in your Discord bot messages.
Discord Progress Bar is a Python library that allows you to create visually appealing progress bars in your Discord bot messages using custom emojis. It provides a simple API to generate progress bars of different styles and lengths, making it easy to display progress, loading states, or completion percentages in your Discord applications.
Built on:
TIP: Create beautiful progress bars in your Discord bot with just a few lines of code!
import discord
from discord_progress_bar import ProgressBarManager
# Create a Discord bot with emoji caching enabled
bot = discord.Bot(cache_app_emojis=True)
# Create the progress bar manager (doesn't load emojis yet)
progress_manager = ProgressBarManager(bot)
@bot.event
async def on_ready():
"""Load emojis when the bot is ready."""
await progress_manager.load()
print(f"Logged in as {bot.user}")
@bot.command()
async def show_progress(ctx, percent: float = 0.5):
"""Display a progress bar with the specified percentage."""
progress_bar = await progress_manager.progress_bar("green", length=10)
await ctx.send(f"Progress: {progress_bar.partial(percent)}")
# Run your bot
bot.run("YOUR_TOKEN")
NOTE: For a complete example, check the examples directory.
Discord Progress Bar works by using custom Discord emojis to create visually appealing progress bars in your bot messages. Here's how it works:
ProgressBarManager
class handles:ProgressBar
classProgressBar
class handles:Discord Progress Bar is fully type-annotated and type-safe. It uses basedpyright
for
type checking.
NOTE: While Discord Progress Bar itself is fully typed, the underlying py-cord library has limited type annotations, which may affect type checking in some areas.
@discord.slash_command()
async def show_progress(self, ctx: discord.ApplicationContext, percent: float = 0.5) -> None:
"""Display a progress bar with the specified percentage."""
# Get a progress bar with the default "green" style
progress_bar = await self.progress_bar_manager.progress_bar("green", length=10)
# Render the progress bar at the specified percentage
await ctx.respond(f"Progress: {progress_bar.partial(percent)}")
@discord.slash_command()
async def show_progress_states(self, ctx: discord.ApplicationContext) -> None:
"""Display different progress bar states."""
progress_bar = await self.progress_bar_manager.progress_bar("green", length=10)
# Empty progress bar (0%)
empty = progress_bar.empty()
# Partial progress bar (50%)
half = progress_bar.partial(0.5)
# Full progress bar (100%)
full = progress_bar.full()
await ctx.respond(f"Empty: {empty}\nHalf: {half}\nFull: {full}")
@discord.slash_command()
async def show_different_lengths(self, ctx: discord.ApplicationContext) -> None:
"""Display progress bars with different lengths."""
# Short progress bar (5 segments)
short_bar = await self.progress_bar_manager.progress_bar("green", length=5)
# Medium progress bar (10 segments)
medium_bar = await self.progress_bar_manager.progress_bar("green", length=10)
# Long progress bar (20 segments)
long_bar = await self.progress_bar_manager.progress_bar("green", length=20)
await ctx.respond(
f"Short (5): {short_bar.partial(0.7)}\n"
f"Medium (10): {medium_bar.partial(0.7)}\n"
f"Long (20): {long_bar.partial(0.7)}"
)
For more examples, check the examples directory in the repository.
When creating your Discord bot, make sure to enable emoji caching:
bot = discord.Bot(cache_app_emojis=True)
This is required for the ProgressBarManager
to properly load and manage emojis.
Create a ProgressBarManager
instance when your bot starts, and load emojis in the
on_ready
event:
# Create the manager (doesn't load emojis yet)
progress_manager = ProgressBarManager(bot)
@bot.event
async def on_ready():
"""Load emojis from the server after the bot is ready."""
await progress_manager.load()
This approach ensures that your bot can properly initialize and load emojis once it's connected to Discord.
You can create custom progress bar styles by providing your own emoji images:
from discord_progress_bar import ProgressBarPart
# Define URLs for each part of the progress bar
custom_style = {
ProgressBarPart.LEFT_EMPTY: "https://example.com/left_empty.png",
ProgressBarPart.LEFT_FILLED: "https://example.com/left_filled.png",
ProgressBarPart.MIDDLE_EMPTY: "https://example.com/middle_empty.png",
ProgressBarPart.MIDDLE_FILLED: "https://example.com/middle_filled.png",
ProgressBarPart.RIGHT_EMPTY: "https://example.com/right_empty.png",
ProgressBarPart.RIGHT_FILLED: "https://example.com/right_filled.png",
}
# Create emojis from URLs
await self.progress_bar_manager.create_emojis_from_urls("custom_style", custom_style)
import pathlib
from discord_progress_bar import ProgressBarPart
# Define file paths for each part of the progress bar
custom_style = {
ProgressBarPart.LEFT_EMPTY: pathlib.Path("path/to/left_empty.png"),
ProgressBarPart.LEFT_FILLED: pathlib.Path("path/to/left_filled.png"),
ProgressBarPart.MIDDLE_EMPTY: pathlib.Path("path/to/middle_empty.png"),
ProgressBarPart.MIDDLE_FILLED: pathlib.Path("path/to/middle_filled.png"),
ProgressBarPart.RIGHT_EMPTY: pathlib.Path("path/to/right_empty.png"),
ProgressBarPart.RIGHT_FILLED: pathlib.Path("path/to/right_filled.png"),
}
# Create emojis from files
await self.progress_bar_manager.create_emojis_from_files("custom_style", custom_style)
WARNING: Please be aware of the following limitations:
- Python Version: Supports Python 3.12 only
- Discord Bot Framework: Currently only supports py-cord, not discord.py or other Discord API wrappers
- Emoji Limits: Subject to Discord's app emoji limits (2'000 emojis per app - should be plenty for most use cases)
- Pre-release Status: This package is currently in alpha stage and may have unexpected behaviors or breaking changes in future versions
- Custom Styles: Creating custom styles requires providing all six emoji parts (LEFT_EMPTY, LEFT_FILLED, MIDDLE_EMPTY, MIDDLE_FILLED, RIGHT_EMPTY, RIGHT_FILLED)
If you encounter issues or have questions about discord-progress-bar:
@paillat
TIP: Before asking for help, check if your question is already answered in the examples directory or existing GitHub issues.
ruff check .
,ruff format .
,
basedpyright .
Development Tools:
CAUTION: This is an early-stage project and may have unexpected behaviors or bugs. Please report any issues you encounter.
MIT License - Copyright (c) 2025 Paillat-dev
Made with ❤ by Paillat-dev
FAQs
A Python library for creating customizable progress bars with Discord emojis in your Discord bot messages.
We found that discord-progress-bar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.