Discord.py message scraper

  bots, discord, discord.py, python, web-scraping

i am trying to do a message scrapper bot with discord.py and i have a problem. With the followign I am able to detect all the new messages that are recived on my account (groups and dm) but when i try to get the content of that messages it returs an empty str. It only returns the message content when I am tagged or when I am the author. Anyone knows what can I do?
The code:

import discord
from discord.ext import commands

bot= commands.Bot(command_prefix='')

@bot.event
async def on_ready():
    print("ready")

@bot.event
async def on_message(message):
    print(message)
    print(message.clean_content)
    print(message.system_content)   
    print(message.content)


bot.run(token,bot=False)

As you can see, I have tried to use the clean_content, the system_content and the content methods in order to get the message content.

Thx

Source: Python Questions

LEAVE A COMMENT