Search code examples
pythondiscorddiscord.py

Discord.py slash commands expect a number input


I would like to ask for a number in one of my slash commands. Thank you! :) Code:

@tree.command(guild = discord.Object(id=guild_id), name = 'leaderbord', description='Check leaderbord') 
async def slash3(interaction: discord.Interaction, number: #What is needed here?):

Solution

  • The answer was number: int Thanks to @furas! the right Code is:

    @tree.command(guild = discord.Object(id=guild_id), name = 'leaderbord', description='Check leaderbord') 
    async def slash3(interaction: discord.Interaction, number: int):