discord python get content of message code example
Example 1: python discord know message from bot
def on_message(self, message):
if (message.author.bot):
return
Example 2: discord.py get message text
When getting a message, you're going to need an abc.Messageable object - essentially an object where you can send a message in, for example a text channel, a DM etc.
Example:
@bot.command()
async def getmsg(ctx, msgID: int):
msg = await ctx.fetch_message(msgID)
@bot.command()
async def getmsg(ctx, channel: discord.TextChannel, member: discord.Member):
msg = discord.utils.get(await channel.history(limit=100).flatten(), author=member)