help me pleaseee
CAUESPINDOLA

@client.command()
async def Rpose(ctx, imagen):
variavel = random.randit(
f'https://www.hypeness.com.br/1/2018/12/imagens-surreais.jpg',f'https://ciclovivo.com.br/wp-content/uploads/2018/10/iStock-536613027.jpg',
)
await ctx.send(f'Sua imagem ^^{variavel}')

this code you did for him to send a radom image along with a pre-named message but it doesn't work I don't know why can you help me? I'm using python language

You are viewing a single comment. View All
Answered by VulcanWM [earned 5 cycles]
View Answer
VulcanWM

first of all, randit is not a function
so to fix your error do random.choice([list_of_pictures]) instead of random.randit

VulcanWM

thats because you've made it in the function that you have to provide an argument as well.
try this code instead:

@CAUESPINDOLA

CAUESPINDOLA

@VulcanWM so how would i do? and thanks for the tip, i started programming the 4 lmao

VulcanWM

so to fix your error do random.choice([list_of_pictures]) instead of random.randit
@CAUESPINDOLA

VulcanWM

in your case, the whole code would be:

@CAUESPINDOLA

CAUESPINDOLA

@VulcanWM gave an error I don't know why, this message also appears on the console ; ;; ; ; ;; ; ;Ignoring exception in command Rpose:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 855, in invoke
await self.prepare(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 789, in prepare
await self._parse_arguments(ctx)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 697, in _parse_arguments
transformed = await self.transform(ctx, param)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 542, in transform
raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: imagen is a required argument that is missing.

CAUESPINDOLA

@VulcanWM Thanks

VulcanWM

if that helped, mark the comment as the answer @CAUESPINDOLA

CAUESPINDOLA
VulcanWM