Chantelle
Chantelle

Reputation: 23

Discord Py, discord bot get message content of another bot/embed/webhook

When ever it picks up message content from a webhook/bot/embed it would always send a blank line/whitespace, I wanted to know if it was possible for my discord bot to see the content of these 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)

Upvotes: 1

Views: 1774

Answers (1)

DriftAsimov
DriftAsimov

Reputation: 413

To get the embed

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

To get another bot message

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

To get webhook message

if message.webhook_id:
    msg = message.content

Upvotes: 1

Related Questions