Discord Py,discord bot获取另一个bot / embed / webhook的消息内容

时间:2020-05-02 14:07:50

标签: python discord

当它从Webhook / bot / embed中获取消息内容时,总是会发送一个空白行/空白,我想知道我的不和谐bot是否有可能看到这些webhook / bot / embed的内容

import discord

client = discord.Client()

@client.event
async def on_ready():
    print('Logged in as {0.user}'.format(client))

@client.event
async def on_message(message):
    if message.author.bot == True:
        print(message.content)

1 个答案:

答案 0 :(得分:1)

获取嵌入

if len(message.embeds) > 0:
    embed = message.embeds[0] #you can do embed.title to get the title and other details of the embed now

获取另一条机器人消息

if message.author.bot and message.author != client.user:
    msg = message.content

获取网络钩子消息

if message.webhook_id:
    msg = message.content