Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Discord Py,Discord bot获取另一个bot/embed/webhook的消息内容_Python_Discord - Fatal编程技术网

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

Python Discord Py,Discord bot获取另一个bot/embed/webhook的消息内容,python,discord,Python,Discord,当它从webhook/bot/embed中获取消息内容时,它总是发送一个空行/空白,我想知道我的discord 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_messa

当它从webhook/bot/embed中获取消息内容时,它总是发送一个空行/空白,我想知道我的discord 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)
获得嵌入
如果len(message.embeddes)>0:
embed=message.embeds[0]#您可以立即执行embed.title以获取嵌入的标题和其他详细信息
获取另一个bot消息
如果message.author.bot和message.author!=client.user:
msg=message.content
获取webhook消息的步骤
if message.webhook\u id:
msg=message.content

你找到答案了吗?试图让webhook与我的机器人通信,但它根本无法接收。我认为机器人无法看到嵌入,可能您可以使用您自己帐户或第二个帐户的discord令牌,并使用该令牌查看嵌入的消息。这需要一些逆向工程,查看页面请求并尝试复制API。