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.