【问题标题】:Get content from emeded message?从嵌入式消息中获取内容?
【发布时间】:2021-05-24 06:29:08
【问题描述】:

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

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

@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!")

【问题讨论】:

标签: python discord.py embed


【解决方案1】:

您需要检查嵌入的描述

@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!")

【讨论】:

    猜你喜欢
    • 2020-09-05
    • 2021-12-13
    • 2021-07-03
    • 2013-04-02
    • 1970-01-01
    • 2014-10-25
    • 2019-01-12
    • 1970-01-01
    相关资源
    最近更新 更多