Imgur链接未加载Discord机器人(Python)

时间:2020-08-13 11:45:23

标签: python discord discord.py

我想知道为什么当我从imgur发送消息或我的机器人这样做时,图像无法在聊天中加载。这是我的代码:

html_page = urlopen("https://imgur.com/r/puppers")
soup = BeautifulSoup(html_page)
dog_images = []
for img in soup.findAll('img'):
    dog_images.append(img.get('src'))

@client.command()
async def dog(ctx):
    dogs_command = random.choice(dog_images)
    await ctx.send("https:" + dogs_command)

(此代码从https://imgur.com/r/puppers输出到图像图像的随机链接。(例如:https://i.imgur.com/VkscjFqb.jpg

我的不和谐服务器有问题吗,因为我也无法发送imgur链接,或者我的代码有问题吗?如果您想自己测试发送图像,请发送邀请:https://discord.gg/pUGggb

任何帮助将不胜感激。 谢谢, 最高

0 个答案:

没有答案