B
B
bubnaz2021-09-01 20:00:42
Python
bubnaz, 2021-09-01 20:00:42

How to make the bot output a random number after entering the command?

from random import randint

N=1
array=list()
for i in range (N):
    array.append (randint(0,100))

@bot.command()
async def random(ctx):
    embed = discord.Embed(
        title= f"Рандомное число - {array}",
    )
    await ctx.send(embed=embed)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-09-01
@bubnaz

Just paste a number into your string and submit, no need to create a list

from random import randint

@bot.command()
async def random(ctx):
    embed = discord.Embed(
        title= f"Рандомное число - {randint(0,100)}",
    )
    await ctx.send(embed=embed)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question