S
S
Shisha2022-02-21 18:54:21
Python
Shisha, 2022-02-21 18:54:21

How to put different pictures in emb.set_image so that the bot would throw random ones?

My code
@client.command( pass_context = True)
@commands.has_permissions( administrator = True )
async def bong( ctx ):
emb = discord.Embed(description = f"{ctx.author.mention} *" )
emb.set_image(url=" https://i.gifer.com/75Uv.gif ")
await ctx.send( embed = emb)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JiMoon, 2022-02-21
@zale4y

you can see right away, I wrote off the fsoka

@client.command()
@commands.has_permissions( administrator = True )
async def bong( ctx ):
    images = ['ссылка1', 'ссылка2', 'ссылка3'] # можно хоть бесконечно
    emb = discord.Embed(description = f"{ctx.author.mention} **Жестко затянулся     бонгом**")
    url = random.choice(images)
    emb.set_image(url)
    await ctx.send(emb)

PS you can not write pass_context = True at the beginning (and you don’t need to) and you can
also insteadawait ctx.send(embed=emb)await ctx.send(emb)

V
Vindicar, 2022-02-21
@Vindicar

random.choice()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question