#modal

1 messages · Page 1 of 1 (latest)

clever dagger
#

What to do? After sending the embed, the modal window does not close, why?

Что делать? После отправки эмбеда модальное окно не закрывается, почему?

class MyModal(disnake.ui.Modal):
    def __init__(self):...
        
    async def callback(self, inter: disnake.ModalInteraction):
        embed = disnake.Embed(title=f"Заявка на жителя")
        for key, value in inter.text_values.items():
            embed.add_field(
                name=key.capitalize(),
                value=value[:1024],
                inline=False,
            )
        member = inter.author
        embed.set_author(name=member, icon_url=member.avatar)
        name = f"Житель {inter.author}"
        channel = await inter.guild.create_text_channel(name=name, category=bot.get_channel(1212826091513847868))
        await channel.send(embed=embed)
keen meadow
#

You have to respond to interactions.

#

All day every day.

clever dagger
keen meadow
#

How about trying to respond properly and then if it still doesn't work as expected, report back

clever dagger
keen meadow
#

It's just like any other interaction.

clever dagger
keen meadow
#

You need to respond to the interaction.

#

Just like all other interactions.

late raptorBOT
#
interactions/modal.py

An example demonstrating two methods of sending modals and handling modal responses.

keen meadow
#

The amount of guides and examples that are available should make this rather simple.

clever dagger
#

yellow color

keen meadow
#

Read the example.

clever dagger
#

He still swears at the color yellow

#

If I put inter, then everything is fine

keen meadow
#

Well yeah..

#

becuase channel.response doeesn't exist.

#

inter.response does

#

The example also does not say channel.response

clever dagger
keen meadow
#

You've been given ample instruction and resources.

royal thicket
royal thicket
keen meadow
#

You're not helping. Giving someone the direct answer is not helping.

#

You're just allowing them to continue to rely on everyone else to solve their problems instead of putting forth a miniscule amount of personal effort.

royal thicket
#

mhm

glossy moon
keen meadow