interactions-py / interactions.py

A highly extensible, easy to use, and feature complete bot framework for Discord
https://interactions-py.github.io/interactions.py/
MIT License
833 stars 185 forks source link

[BUG] Undocumented `MessageType` code on poll result messages #1731

Open retr0-init opened 1 month ago

retr0-init commented 1 month ago

Library Version

5.13.1

Describe the Bug

I was working on #1730 This yields another message:

Class `MessageType` received an invalid and unexpected value `46`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues

I think this is the poll_result message type. However, it is not shown on the official documentation on https://discord.com/developers/docs/resources/message#message-object-message-types

Re:

We usually don't add undocumented features.

Therefore, this is just to be kept in place and make changes as soon as there is an update on the official document.

Steps to Reproduce

  1. Create a poll and end it.
  2. Try to go through the message history with the minimal reproducible code with the fixes in #1730 .

Expected Results

It will generate the following error:

Class `MessageType` received an invalid and unexpected value `46`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues

Minimal Reproducible Code

@interactions.slash_command(
    "test", description="test command", scopes=[DEV_GUILD] if DEV_GUILD else None
)
async def test_cmd(self, ctx: interactions.SlashContext):
    """Register as an extension command"""
    async for msg in ctx.channel.history(10):
        ...

Traceback

Class `MessageType` received an invalid and unexpected value `46`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues

Checklist

Additional Information

No response

retr0-init commented 1 month ago

This was reported on https://github.com/discord/discord-api-docs/issues/7011#issue-2417240177 It's been 3 weeks but this has been forwarded to the related team. Hopefully this will get through soon.