Skip to content

discord

This directory provides a comprehensive Talon integration for Discord, supporting both the official desktop clients (across macOS, Windows, and Linux) and the Discord web client running in a browser.

The integration is built with a modular architecture that separates the user-facing voice commands, the abstract definition of application actions, and the platform-specific keyboard shortcuts.

Architecture and Workflow

The integration is driven by four primary files that work together to translate spoken voice commands into Discord keyboard shortcuts:

  • discord.py sets up the application context. It targets Discord desktop applications across various platforms, as well as instances of Discord running in web browsers (discord.com). It defines a set of abstract Talon actions (like discord_mute, discord_toggle_pins, and discord_quick_switcher) and maps out the custom discord_destination list (used for navigating quickly to users, voice channels, or servers).
  • discord.talon defines the voice grammar interface. When Discord is the active window, this file activates the unified user.messaging and user.emoji tags, exposing general messaging commands. It maps friendly speech commands (e.g., "toggle pins", "mute and sleep", or "switcher") directly to the abstract actions declared in discord.py.
  • discord_mac.py and discord_win.py implement the platform-specific keyboard shortcuts. They map the abstract actions defined in discord.py to macOS (using Command-based shortcuts) and Windows/Linux (using Control-based shortcuts) respectively.

Key Features

The Discord voice control commands are categorized into three main areas:

1. Navigation and Quick Switcher

The integration leverages Discord's built-in "Quick Switcher" to allow rapid navigation using voice:

  • Spoken commands like {user.discord_destination} [text] activate the switcher and prepopulate it with search prefixes (such as @ for users, ! for voice channels, and * for servers).
  • Voice actions like "oldest unread", "mentions last", or "mentions next" make it easy to cycle through unread direct messages, channel highlights, and server activity.

2. User Interface Toggles

Manage Discord's sidebars and popouts without needing to aim with a mouse:

  • "toggle pins": Opens or closes pinned messages.
  • "toggle inbox": Accesses mentions and unread messages.
  • "toggle member list": Shows or hides the channel user list.
  • "pick emoji" / "pick gif" / "pick sticker": Focuses and opens the respective media picker drawers.

3. Voice Channels and Call Management

Control your microphone and call status hands-free:

  • "mute" / "unmute" / "deafen": Toggles audio inputs and outputs.
  • "mute and sleep": A convenient macro that mutes your microphone in Discord and simultaneously puts Talon's speech recognition to sleep to prevent accidental voice inputs.
  • "answer call" / "decline call": Manages incoming voice/video calls.