【问题标题】:Discord with Python: Sending embeds to specific channels given by userDiscord with Python:将嵌入发送到用户指定的特定频道
【发布时间】:2021-11-19 03:34:39
【问题描述】:

请查看以下演示:

@bot.command()
@commands.has_permissions(manage_messages= True)
async def quickembed(ctx, *,msg):
    em = discord.Embed(description=f'{msg}', color=discord.Color.green())  
    await ctx.send(embed=em)

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: python discord discord.py embed


【解决方案1】:

只需将通道设为必需参数,然后将其发送到那里,如下所示:

@bot.command() 
@commands.has_permissions(manage_messages= True) 
async def quickembed(ctx, channel: discord.TextChannel, * , msg): 
    em = discord.Embed(description=f'{msg}', color=discord.Color.green())
    await channel.send(embed=em)

【讨论】:

  • 你能告诉我同样的颜色吗
  • 会是完全相同的东西,只是你最好为该输入使用十六进制颜色代码
猜你喜欢
  • 2022-07-16
  • 2019-03-18
  • 2021-10-28
  • 2020-07-29
  • 2020-05-18
  • 2020-10-01
  • 1970-01-01
  • 2021-07-06
  • 2023-03-27
相关资源
最近更新 更多