'get more input from one command (discord.py)

I'm trying to make an embed system that asks multiple questions and then put them together and send the embed with all the info given, but I can't figure out how to get multiple inputs in one command.

this image maybe can help understanding my question

thanks



Solution 1:[1]

Based on what I understand from your question, you're only checking for one possible input with m.content == "hello". You can either remove it or add an in statement. Do view the revised code below.

@commands.command()
async def greet(ctx):
    await ctx.send("Say hello!")

    def check(m):
        return m.channel == channel # only check the channel
        # alternatively,
        # return m.content.lower() in ["hello", "hey", "hi"] and m.channel == channel

    msg = await bot.wait_for("message", check=check)
    await ctx.send(f"Hello {msg.author}!")

Expected command output


In the case of the newly edited question, you can access the discord.Message class from the msg variable. For example, you can access the message.content. Do view the code snippet below.

@commands.command()
async def test(ctx):
    def check(m):
        return m.channel == ctx.channel and m.author == ctx.author
        # return message if sent in current channel and author is command author

    em = discord.Embed()

    await ctx.send("Title:")
    msg = await bot.wait_for("message",check=check)
    em.title = msg.content

    # in this case, you can continue to use the same check function
    await ctx.send("Description:")
    msg = await bot.wait_for("message",check=check)
    em.description = msg.content

    await ctx.send(embed=em)

above code in the works

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1