问题描述
我正在尝试在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)
使用上面的代码,这就是嵌入的样子:
解决方法
不支持
.svg
。这是.png
格式的同一张图片:
@client.command()
async def test(ctx):
imageURL = "https://cdn.discordapp.com/attachments/744631318578462740/755866713182044240/ezgif-4-6eba1fde99f2.png"
embed = discord.Embed()
embed.set_image(url=imageURL)
await ctx.send(embed=embed)