Skip to main content
The utility commands give you quick diagnostics and quick references without cluttering the channel. You can inspect the active track, check the bot’s latency, or open the command list at any time. These commands reuse the shared helper functions in ui/embeds.py, which keeps the modular UI consistent across the bot.

/nowplaying

Sends a detailed embed for the track currently being played, including artist, duration, artwork, and who requested it.
/nowplaying reads the active track from vc.current and builds a rich embed using the same metadata and helper functions used by the automatic Now Playing message. Because the embed is sent ephemerally, each user can request it independently without flooding the channel. Behavior
  • Checks that vc is not None and that vc.playing is True; sends an error and returns early otherwise.
  • Reads the current track from vc.current.
  • Builds a nextcord.Embed with:
    • Title: 💿 Currently Playing
    • Description: a clickable hyperlink formatted as [track.title](track.uri)
    • Color: blue (nextcord.Color.blue())
    • Field “Artist”: track.author (inline)
    • Field “Duration”: format_time(track.length) in M:SS format (inline)
    • Thumbnail: resolved by get_track_artwork(track) (set only if a URL is found)
    • Footer: "Requested by {requester}" with the requester’s avatar, sourced from track.extras
  • Sends the embed as an ephemeral message.
Error responses

/ping

Reports the bot’s current WebSocket latency in milliseconds.
/ping reads bot.latency, which Nextcord exposes as the round-trip time of the WebSocket heartbeat in seconds. The command multiplies it by 1000 and rounds to the nearest integer to produce a millisecond value that is easier to read. Behavior
  • Reads bot.latency (a float, measured in seconds).
  • Computes latency_ms = round(bot.latency * 1000).
  • Sends "Pong! Latency: {latency_ms}ms" ephemerally.
WebSocket latency reflects the heartbeat connection between the bot process and Discord’s gateway, not audio stream latency from Lavalink. High values here typically indicate network issues between the host machine and Discord.

/help

Sends a formatted list of every available slash command with a one-line description of each.
/help hard-codes the list of all registered slash commands into a single ephemeral text message. It covers every command documented across the Command Reference, making it a useful quick-reference for server members who are unfamiliar with the bot. Behavior
  • Builds a multi-line string listing all available commands and their purposes.
  • Sends the string as an ephemeral message.
Commands listed

Helper Functions

Two helper functions in ui/embeds.py are shared by multiple commands. They are not slash commands themselves, but they explain how the bot renders track metadata and artwork across the modular UI.

format_time

Converts a duration in milliseconds to a human-readable M:SS string. It is used by /play, /nowplaying, and the on_wavelink_track_start event to format track lengths consistently.
Examples
Hours are not broken out separately — a three-hour track would display as "180:00". The format keeps things simple for typical song lengths.

get_track_artwork

Resolves the best available artwork URL for a wavelink.Playable track. It is used by /play and /nowplaying, and by the on_wavelink_track_start event handler.
Resolution order
  1. track.artwork — the primary artwork attribute provided by Wavelink.
  2. track.thumbnail — a fallback attribute present on some track types.
  3. If neither is set and track.source contains 'youtube', constructs a YouTube thumbnail URL: https://i.ytimg.com/vi/{track.identifier}/hqdefault.jpg.
  4. Returns None if no artwork can be found (callers guard against this before calling set_thumbnail or set_image).
The YouTube fallback uses the hqdefault image size, which is 480×360 pixels — large enough for Discord embeds without exceeding file-size limits.

Playback Commands

Jump from diagnostics to the main playback and queue controls.

Command Overview

Review the full command catalog and where each command fits.

Module Reference

Map the utility helpers to the modular code structure behind them.

Testing Strategies

Validate the bot logic behind the command surface with pytest.