#In type Value must be one of {4, 5, 6, 7, 10}.

1 messages · Page 1 of 1 (latest)

gaunt anchor
#

Hey, i have a problem. my modal wasn't sent.
Error: ```py
await interaction.response.send_modal(modal)

discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In type: Value must be one of {4, 5, 6, 7, 10}.and the code:py
class EditModal(Modal):
def init(self, bot: discord.Bot, type: str, *args, **kwargs) -> None:
self.bot = bot
self.type = type

    super().__init__(*args, **kwargs)
    if type == "search":
        self.add_item(
            InputText(
                label = "1", 
                placeholder = "2"
            )
        )
    else:
        self.add_item(
            InputText(
                label = "3", 
                placeholder = "4"
            )
        )

async def callback(self, interaction: discord.Interaction):
    if self.type == "search":
            modal = EditModal(
                self.bot, 
                "edit",
                title = "Edit 2"
            )

            # In type: Value must be one of {4, 5, 6, 7, 10}.
            await interaction.response.send_modal(modal)```
fluid brook
#

type must be int maybe ?

gaunt anchor
#

no, unfortunately not

barren pike
#

Try something other than type. Type is a reserved word in python

gaunt anchor
scarlet sorrel
gaunt anchor
#

bruh

scarlet sorrel
# gaunt anchor bruh

discord limitation 🤷‍♂️
maybe send a message with a button that sends the 2nd modal

gaunt anchor
#

hm, okay, thanks

scarlet sorrel
#

?tag solved

worn horizonBOT
#

Done with your help thread?

Please close your own help thread using </close:882631512829329448> (/close) with @astral tulip.

scarlet sorrel
#

@gaunt anchor