## TL;DR

Send the deferred acknowledgement (type 5) first, then run your database calls or API work, then edit the original response through the interaction token. If your command works locally but the reply never shows up in production, a slow first response is the likely cause, and deferring is the fix.

## Steps

1. Never do slow work before answering a Discord interaction. Send the deferred acknowledgement (type 5) first, then run your database calls or API work, then edit the original response through the interaction token. If your command works locally but the reply never shows up in production, a slow first response is the likely cause, and deferring is the fix.

## When to use

You are seeing this: Never do slow work before answering a Discord interaction. Use this skill when you run into "Discord interactions: acknowledge first with a deferred callback, then do slow work".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
