'Get image url from message in discord.py

i'm trying to get the url of image when i do the command +coin but I d'ont know if I do it right. if someone can help me i'll very appreciate it.

@Bot.command()
async def coin():
  print(message.attachments[0].url)
  await ctx.send("work")


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source