从嵌入的消息中获取内容?

时间:2021-02-22 00:05:19

标签: python discord.py embed

所以我正在尝试制作一个“退出提醒机器人”

但是 disboard 发送了一条我不知道如何使用我的自定义机器人阅读的 emeded 消息... 这就是我所拥有的:但它仅用于纯文本..

@bot.event
async def on_message(message):
  if "Check it on DISBOARD:" in message.content: #and message.author.id == 302050872383242240:
    print("I see the bump!")
    await message.add_reaction(emoji='⏱️')
    print("counting now!")
    await asyncio.sleep(7200)
    print("sending reminder!")
    await message.channel.send("Remember to bump the server!")

1 个答案:

答案 0 :(得分:2)

您需要检查嵌入的描述

@bot.event
async def on_message(message):
  if message.author.bot and message.embeds:
    if "Check it on DISBOARD:" in message.embeds[0].description: #and message.author.id == 302050872383242240:
      print("I see the bump!")
      await message.add_reaction(emoji='⏱️')
      print("counting now!")
      await asyncio.sleep(7200)
      print("sending reminder!")
      await message.channel.send("Remember to bump the server!")