Is it possible to somehow transfer the “value” to another function?
class Application(disnake.ui.Modal):
def __init__(self):
components = [
disnake.ui.TextInput(
label = "Your nickname",
placeholder = "nickname",
custom_id="Nick"
)
]
super().__init__(title="Application", components=components)
async def callback(self, inter: disnake.ModalInteraction):
embed = disnake.Embed(title="Your registration data")
for key, value in inter.text_values.items():
embed.add_field(name=key.capitalize(),
value=value[:1024],
inline=False
)
await inter.send("You have successfully submitted your application, please wait for a response", ephemeral=True)
#print(f"{selgcomponents.placeholder}")
print(Application.components(disnake.ui.TextInput(value)))
liv = d1()
await bot.get_channel(channel id).send(f"Nickname: {value}", view=liv)
I’m new to Python so I don’t know how to do this
New contributor
user25571131 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.