【发布时间】:2023-03-09 11:05:02
【问题描述】:
我正在尝试在 discord.py 中发送嵌入,但每当我运行代码时,都没有发送任何内容。没有错误什么都没有。这是我的代码:
from variables.variables import client, token
import discord
@client.command()
async def test(ctx):
imageURL = "https://discordapp.com/assets/e4923594e694a21542a489471ecffa50.svg"
embed = discord.Embed()
embed.set_image(url=imageURL)
await ctx.send(embed=embed)
client.run(token)
这是使用上述代码嵌入的样子:
【问题讨论】:
-
您有
on_command_error事件吗?如果有,请在其中打印错误并发布错误。 -
不,没有错误,我只是没有得到任何图像,我编辑帖子以显示嵌入的样子
-
您确定支持 .svg 类型吗?
-
不,但这是我从另一个 stackoverflow 问题中使用的图像链接,询问如何在嵌入中发送图像,因为我不知道如何制作图像 http 或 https
-
你能尝试一些随机的 .png 图片作为 url 吗?所以你可以弄清楚问题是不是文件类型。
标签: python python-3.x discord discord.py