commands_sync

command
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: BSD-3-Clause Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

This example synchronizes the application (slash) commands declared in this file with Discord using ApplicationCommandsSync. Unlike ApplicationCommandBulkOverwrite (a single PUT that counts against the daily application-command limits and resets command permissions), the sync compares the desired commands with the registered ones by normalized content and issues only the minimum number of REST calls: one POST per new command, one PATCH per changed command and, when asked, one DELETE per removed command. Unchanged commands are never re-sent.

Usage:

DISCORD_TOKEN=... DISCORD_APP_ID=... go run .            # apply
DISCORD_TOKEN=... DISCORD_APP_ID=... DRY_RUN=1 go run .  # plan only
go run . -token ... -app ... -guild <id>                 # guild-scoped
go run . -delete-removed                                 # also delete removed commands

The gateway is never opened: the sync is pure REST.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL