#How i can get modal author?

1 messages · Page 1 of 1 (latest)

plain dock
#
class MyModal(disnake.ui.Modal):
    def __init__(self) -> None:
        components = [
            disnake.ui.TextInput(label="Ocena", placeholder="Ocena (1-10)", custom_id="ocena", style=disnake.TextInputStyle.short, min_length=1 , max_length=2),
            disnake.ui.TextInput(label="Treść Opinii", placeholder="Napisz treść swojej opinii", custom_id="tekst", style=disnake.TextInputStyle.paragraph, min_length=5, max_length=1024)
        ]
        
        super().__init__(title="Wystaw opinię", custom_id="create_tag", components = components)

    async def callback(self, inter: disnake.ModalInteraction) -> None:
        rate = inter.text_values["ocena"]
        textValue = inter.text_values["tekst"]
        embed = disnake.Embed(title = "NOWA OPINIA", description = f"nowa opinia")


    async def on_error(self, error: Exception, inter: disnake.ModalInteraction) -> None:
        await inter.response.send_message("Oops, something went wrong.", ephemeral=True)```
rain pecan
#

-d disnake.ui.Modal

fleet havenBOT
#

class disnake.ui.Modal(*, title, components, custom_id=..., timeout=600)```
Represents a UI Modal.

New in version 2.4.
stiff falcon
#

inter.author in your callback will be the user/member

rain pecan
#

Yes. Meant to lookup ModalInteraction and my brain told my fingers, "Nope. You want ui.Modal"

orchid perch
#

if this is solved please use /solved to mark as solved