I'm making a dice roller bot for Discord and basically I want to make possible to someone choose what they want to do. If they want to add 6 with the dice result, if they want to half the dice result and things like that. I made the code, and it can sum, but can't do other operations.
@client.command(aliases=['r', 'dado', 'dice'])
async def roll(ctx, numero=20, conta='+', ficha=0):
rolagem = random.randint(1,int(numero))
total = (int(rolagem) + int(ficha))
await ctx.send(f'{ctx.author.mention} \n**Resultado**: D{numero} ({rolagem}) {conta} {ficha}\n**Total**: {total}')
Thats the code. In the total part, I want to use what they choose in the conta. Is there any way to do it? I already tried a lot, but nothing worked.