如何在嵌入消息中提及不和谐频道

时间:2021-02-14 02:12:43

标签: python discord discord.py

在我的嵌入的描述中,我希望将 #channel 写入的位置替换为提及频道。我想通过它的 id 获取这个通道对象;但是,我不知道该怎么做。

@bot.command() 
async def whois(ctx, member : discord.Member):  
  embed = discord.Embed(title = "**__Soporte general usando tickets__**",
  description= "**To create a ticket, run `!New` in #channel \nPara pedir ayuda deberías utilizar el siguiente formato:\n",
  color=discord.Color.blue())
  embed.set_footer(text="ADN Development")

1 个答案:

答案 0 :(得分:0)

您需要使用 bot.get_channel(id)。试试这个:

@bot.command() 
async def whois(ctx, member : discord.Member):
  channel = bot.get_channel(id)  
  embed = discord.Embed(title = "**__Soporte general usando tickets__**" , description= f"**To create a ticket, run `!New` in {channel.mention}\nPara pedir ayuda deberías utilizar el siguiente formato:\n", color=discord.Color.blue())
  embed.set_footer(text="ADN Development")
  await ctx.send(embed=embed)