import ... client = discord.Client() @client.event async def on_message(message): counter = 0 trigger = True while trigger: await asyncio.sleep(5) count