discord.py get a message using id code example
Example 1: discord.py message user
if message.content == "dm":
await message.channel.send("Dming user")
dm = await message.author.create_dm()
await dm.send("What you want to send")
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)