Mastering Development

Using random.choice for within embed

I am not sure if this is the correct code, but I am trying to return a random rating when an user types the command "?rating". I have created a variable_list containing the rating numbers that the bot is supposed to return. But I am also using embed. And I am not able to get the random.choice working inside the embed.

async def rating(ctx, *):
    variable_list = [

    embed = discord.Embed(
        description=f"{} (random.choice(variable_list)) is your rating"
    embed.timestamp = datetime.datetime.utcnow()

    await ctx.send(embed=embed)

Leave a Reply

Your email address will not be published. Required fields are marked *