📜  如何使用 discord.py 检索以前的消息 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:34.290000             🧑  作者: Mango

代码示例1
@client.event
async def on_message(message):
    c_channel = discord.utils.get(message.guild.text_channels, name='counting channel')
    messages = await c_channel.history(limit=2).flatten()
    if message.channel == c_channel and int(messages[1].content) + 1 != int(message.content):
        await message.delete()