#Modal isn't being submitted without any error

1 messages · Page 1 of 1 (latest)

golden cradle
#

So I am trying to create message_command, that will open a modal, and it will reply to message (on which was it used). But they modal doesn't close (it throws error "Something failed, try again later.") and there is no error in console. I don't know what to try next.
Code:

class ReplyModal(disnake.ui.Modal):
    def __init__(self, message: disnake.Message):
        self.message = message 
        components = [
            disnake.ui.TextInput(
                label="Your reply",
                placeholder="Type your reply here",
                min_length=1,
                max_length=2000,  
                custom_id="reply_id"
            )
        ]
        super().__init__(title="Reply", components=components)

    async def on_submit(self, inter: disnake.ModalInteraction):
        reply = inter.text_values['reply_id']
        await self.message.reply(content=reply)  
        await inter.followup.send(embed=disnake.Embed(
            description=f"Hotovo!",
            color=disnake.Color.green()
        ),
        ephemeral=True) 

@bot.message_command(name="Reply", dm_permission=False)
async def reply_message(inter: disnake.ApplicationCommandInteraction, message: disnake.Message):
    modal = ReplyModal(message)
    await inter.response.send_modal(modal)

Thanks.

vestal hill
deft bronze
#

You're never responding to the interaction.

#

And yes.. callback is the corect name.

golden cradle
#

Works now, thanks guys.
I had callback, but it didn't work (maybe i have missed the error in console) so i tried renaming it onto on_submit 🤦‍♂️