class Dice(discord.ui.View):
def __init__(self):
super().__init__(timeout=None)
@discord.ui.button(label='Roll', emoji='π²', custom_id='dice-btn', style=discord.ButtonStyle.green)
async def rollCalback(self, interaction: discord.Interaction, button: discord.Button):
roll_result = random.randint(1, 6)
await interaction.response.send_message(f"You rolled a {roll_result}!", ephemeral=False)
@bot.tree.command(name='roll', description='Rolls dice.')
async def roll(interaction: discord.Interaction):
await interaction.response.send_message(view=Dice())
TypeError: 'Dice' object is not callable