Hello! I would like to return the value of a modal to the command itself
For example I have a ban command, and the reason is provided through a sperate modal class,
now how can I use the results of modal inside the command?
class moderationReason(Modal):
def __init__(self):
super().__init__()
self.add_item(
InputText(
label="Reason",
placeholder="Add a reason for that instance",
style=discord.InputTextStyle.long,
)
)
async def callback(self, interaction: discord.Interaction):
code here
@commands.slash_command(description="Ban a user")
async def ban(ctx, member: discord.Member):
modal = moderationReason()
await ctx.send_modal(modal)
await member.ban('reason from modal')
All help is appreciated, please ping me on reply