Making a Basic Text Form

from discord.ext.forms import Form
from discord.ext import commands
bot = commands.Bot(command_prefix="!")

@bot.command()
async def testform(ctx):
    """Creates a basic form using discord.ext.forms!"""
    form = Form(ctx,'Title') # Let's initialize our Form object!

    form.add_question('Question 1') # Adding question 'Question 1'
    form.add_question('Question 2') # So on...
    form.add_question('Question 3')
    result = await form.start() # Let's start the form in the context's channel!
    """
    Result is a list of dictionaries containing each question and its answer.
    """
    return result

>> [{'Question 1','user input'},{'Question 2','user input'},{'Question 3','user input'}].

This results in a form with 3 questions, as shown below (The output is not sent to the channel in the code above):

https://mikey.has-no-bra.in/eWrLkN.gif

Making a Basic Reaction Form

@bot.command()
async def reactionform(ctx):
    embed=discord.Embed(title="Reaction Menu Test",description="Delete 20 messages?") # Let's make our embed here...
    message = await ctx.send(embed=embed) # And send it! But we want to capture it as a variable!
    form = ReactionForm(message,bot,ctx.author) # Initialize the reaction form...
    form.add_reaction("✅",True) # Add the ✅ reaction which will return True.
    form.add_reaction("❌",False) # Add the ❌ reaction which will return False.
    choice = await form.start() # Start the form! Choice will be True or False based on the input.
    if choice: # If choice is true:
        await ctx.channel.purge(limit=20) # delete 20 messages!