I wanted short text to be callabe at the callback function
@modal_callback("my_modal")
async def on_modal_answer(ctx: ModalContext, short_text: str):
channel = await bot.fetch_channel(channel_id=1056842044376621086)
await ctx.send("Your nickname request has been submitted", ephemeral=True)
await channel.send(f"Nickname Request: {short_text}\nUser: {ctx.user.mention}")
button2: list[ActionRow] = [
ActionRow(
Button(
custom_id="approved",
style=ButtonStyle.GREEN,
label="Approved",
),
Button(
custom_id="decline",
style=ButtonStyle.RED,
label="Decline",
)
)
]
await channel.send(f"Nickname Request: {short_text}\nUser: {ctx.user.mention}", components=button2)
@component_callback("approved")
async def approved_callback(ctx: ComponentContext):
member = ctx.guild.members
await member.modify_current_user_nick(guild, nickname=short_text)
user = bot.get_user(ctx.user.id)
await user.send("Nickname Updated!")
how can i do that?