discord-api-docs icon indicating copy to clipboard operation
discord-api-docs copied to clipboard

Locking a thread before a user app can respond results in unavoidable error

Open bignutty opened this issue 1 month ago • 0 comments

Description

Running a user app slash command in a thread, then locking the thread before the command can respond (for example via deferred message or followup) will result in an unavoidable error.

If the bot is in the server the

{"message": "Thread is archived", "code": 50083}

error will be returned by the API. If the bot is not in the server, the error will be

{"message": "Missing Access", "code": 50001}

Steps to Reproduce

  1. Run a slash command in a thread.
  2. Have the command respond with a deferred ack.
  3. Lock the thread as a moderator.
  4. Have the bot respond to the deferred command.
  5. Observe

Expected Behavior

The response message is forced ephemeral for the user who ran the command, as happens with context menu commands inside of locked threads.

Current Behavior

The API will return an error that cannot be predicted/avoided.

Screenshots/Videos

The result of your actions

  • Command gets stuck in an infinite loading state, the bot developer will see an annoying error in their logs

Client and System Information

bignutty avatar May 21 '24 19:05 bignutty