Search code examples
pythondiscordpycord

have multiple input_type in Option?


I want to create a command that will show you every message from a member or all messages for every user with one role. my command looks like this at the moment

    @slash_command(name='messages', description='Get messages.', guild_ids = [933307298011562006])
    async def messages(self, ctx, user : Option(discord.Member, "Get the Messages from a User or a Role.", required = True)):

and I want that the user can enter either a member or a Role within this one Command. If that is Possible, how can I do this?


Solution

  • Ok, I just did it with this:

        @slash_command(name='messages', description='Get messages.', guild_ids = [933307298011562006])
        async def messages(self, ctx, user : Option(discord.Member, "type in the User", required = False), role : Option(discord.Role, "type in the Role.", required = False)):
    

    Not exactly what I wanted, but It works