When I am trying to post an Imgur link in my discord server, it is not working.
The main thing that I am trying to achieve here is to allow the user to search for a random image in a subcategory of Imgur, then have that image posted to them in an embed. Whenever I post a link, it is not showing up. This also does not work for the bot. To add, when I tried to use embedVar.set_image, the URL was not posted in the embed, and it just showed the title. Here is my code if it helps (without embedVar.set_image)
@client.command()
async def image(ctx, search):
html_page = urlopen("https://imgur.com/r/" + search)
soup = BeautifulSoup(html_page)
search_images = []
for img in soup.findAll('img'):
search_images.append(img.get('src'))
search_command = random.choice(search_images)
embedVar = discord.Embed(title = search)
search_url="https:" + search_command.translate({ord(i): None for i in "<>"})
embedVar.add_field(name = search, value = search_url)
await ctx.send(embed = embedVar)
There is also an image attached to explain my problem in further detail. Any form of help is appreciated. Thanks!