【问题标题】:Message author name without the hashtag in embed message嵌入消息中不带井号标签的消息作者姓名
【发布时间】:2020-12-25 19:44:46
【问题描述】:

当有人说某事时,我希望我的 bot 说出作者的名字,不带标签以及消息的内容。

但是这个 embedVar = discord.Embed(title='The', (message.author), 'posted', description=message.content, color=0x0000FF) 不起作用。

你能帮帮我吗

@client.event
async def on_message(message):
    if str(message.channel) in ['general']:
        if not message.author == client.user:
            embedVar = discord.Embed(title='The', (message.author), 'posted', description=message.content, color=0x0000FF)
            embedVar.set_author(name=message.author)
            embedVar.set_footer(text='Facebook-')
            await message.delete()
            await message.channel.send(embed=embedVar)```

【问题讨论】:

    标签: discord bots


    【解决方案1】:

    你可以这样做:

    async def on_message(message):
        if not message.author == client.user:
            await message.channel.send(message.content)
            await client.delete_message(message)
    

    【讨论】:

      猜你喜欢
      • 2020-12-08
      • 1970-01-01
      • 2021-11-23
      • 1970-01-01
      • 1970-01-01
      • 2022-08-04
      • 2021-09-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多