【发布时间】:2021-06-27 20:26:45
【问题描述】:
我试图在嵌入消息中发送带有用户提及的随机 gif,用户标签很好,但 gif 不会显示在嵌入消息中。这是消息的screenshot。
这里也是命令的代码
@client.command()
async def slap(ctx, user: discord.Member):
randomgifs = [
discord.Embed(title = "", description = f'{ctx.author.mention} has slapped {user.mention}\n\nhttps://i.imgur.com/8KfHd8m.gif', color = ctx.author.color),
discord.Embed(title = "", description = f'{ctx.author.mention} has slapped {user.mention}\n\nhttps://i.imgur.com/AAUukQd.gif', color = ctx.author.color),
discord.Embed(title = "", description = f'{ctx.author.mention} has slapped {user.mention}\n\nhttps://i.imgur.com/ZDiDDdc.gif', color = ctx.author.color),
discord.Embed(title = "", description = f'{ctx.author.mention} has slapped {user.mention}\n\nhttps://i.imgur.com/28BGRwI.gif', color = ctx.author.color),
discord.Embed(title = "", description = f'{ctx.author.mention} has slapped {user.mention}\n\nhttps://i.imgur.com/HqHljrw.gif', color = ctx.author.color)]
randomitem = random.choice(randomgifs)
await ctx.send(embed=randomitem)
我已经看到了很多与此类似的问题,但是对于随机消息没有一个答案,并且当我在这些问题中使用它们的固定代码时,该命令不起作用。谢谢。
【问题讨论】:
标签: discord.py