#Why o dpnt can import InputTextStyle?

1 messages · Page 1 of 1 (latest)

ocean pewter
#

from discord.ui import Button, View, Modal, InputText, InputTextStyle

sharp warren
#

b!rtfm pyc Inputtextstyle

sharp warren
#

It's discord.InputTextStyle

#

not discord.ui.inputtextstyle

ocean pewter
#

b!rtfm pyc components

ocean pewter
#

How can i fix this how i import or is this code wrong

@bot.slash_command(name="send-modal", description="Send a modal", scope=925511055034187788)
async def send_modal(ctx):
    modal = Modal(
        custom_id="modal",
        title="Modal Title",
        components=[
            InputText(
                style=InputTextStyle.short,
                custom_id="text-input-1",
                label="Short text input",
            ),
            InputText(
                style=InputTextStyle.long,
                custom_id="text-input-2",
                label="Paragraph text input",
            ),
        ],
    )
    await ctx.popup(modal)```

Error
`: Application Command raised an exception: TypeError: Modal.__init__() got an unexpected keyword argument 'components'`
sharp warren