vendredi 11 novembre 2022

Discord.py Random Variabel Input / Ouput

I would like to expand my Discord Bot with a new randomizer function. I always want to enter the values/variables manually, for example:

Input: !random text1 text2 text3 Output: The result is "text2"

I need the whole thing in Discord.py (Python) and without slash (/) commands. I tried:

@bot.command()
async def r(ctx, str, name1: str, name2):
    list = [str(name1), str(name2)];
    embed = discord.Embed(
        colour=0xc81f9f,
        title="Rating",
        description=f"{ctx.author.mention} {random.choice(list)} is your rating"
    )
    await ctx.send(embed=embed)



Aucun commentaire:

Enregistrer un commentaire