how to retrieve previous messages with discord py

Solutions on MaxInterview for how to retrieve previous messages with discord py by the best coders in the world

showing results for - "how to retrieve previous messages with discord py"
Luigi
05 Jul 2017
1@client.event
2async def on_message(message):
3    c_channel = discord.utils.get(message.guild.text_channels, name='counting channel')
4    messages = await c_channel.history(limit=2).flatten()
5    if message.channel == c_channel and int(messages[1].content) + 1 != int(message.content):
6        await message.delete()
7
similar questions