Discord API · error code

Discord error 520006: Cannot expire a non-poll message

Permanent - do not retryHTTP 400Validation and request shape

Last verified against Discord Developer Docs - Opcodes and status codes

What Discord returns
Cannot expire a non-poll message

What error 520006 means

You called POST /channels/{channel.id}/polls/{message.id}/expire with the ID of a message that has no poll. The expire endpoint only works on poll messages.

This is almost always an ID mix-up: the bot stored the ID of its confirmation message, the interaction response, or a results summary instead of the message that actually carries the poll. It can also happen when a poll was sent as a follow-up and the original response ID was stored.

Store the ID returned when the poll message is created and use that one for expiring and for reading results. A poll that has already ended returns 520001 instead.

The fastest diagnosis is to fetch the message ID you are using and look at it: if it has no poll field, the stored ID is wrong.

What it looks like

{
  "message": "Cannot expire a non-poll message",
  "code": 520006
}

Why it happens

  • Stored ID points to a confirmation or summary message, not the poll
  • Interaction original response ID used when the poll was sent as a follow-up
  • Wrong channel and message ID pair
  • Poll message deleted and replaced, with the old ID still stored

How to fix Discord error 520006

  1. 1Fetch the message and confirm it has a poll field
  2. 2Store the message ID from the create call that sent the poll
  3. 3Correct the channel ID if the poll lives in a thread
  4. 4Retry the expire call with the poll message's ID
  5. 5Update stored IDs whenever a poll is re-sent

How to stop it recurring

Keep one record per poll containing the channel ID and the poll message ID returned by Discord, and use only that record for expire and results calls. Do not reuse IDs of related messages. Polls cannot be edited either; see 520003.

Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.

Related codes

Error 520006 - quick answers

What does Discord error 520006 mean?

You called POST /channels/{channel.id}/polls/{message.id}/expire with the ID of a message that has no poll. The expire endpoint only works on poll messages. This is almost always an ID mix-up: the bot stored the ID of its confirmation message, the interaction response, or a results summary instead of the message that actually carries the poll.

How do I fix Discord error 520006?

1. Fetch the message and confirm it has a poll field 2. Store the message ID from the create call that sent the poll 3. Correct the channel ID if the poll lives in a thread 4. Retry the expire call with the poll message's ID 5. Update stored IDs whenever a poll is re-sent

Should I retry after error 520006?

No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.

Stop debugging Discord by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.