so I'm currently trying to make a command that watches over a channel and if there are no messages sent in the last x minutes it will send a message
my code is:
@client.command()
async def watch(ctx, time : int):
channel = ctx.channel
async for message in channel.history(limit = 1):
past_message = message.created_at
await asyncio.sleep(time)
async for message in channel.history(limit = 1):
new_message = message.created_at
if past_message == new_message:
if not new_message:
channel = client.get_channel(816741369682985012)
await channel.send("<@400349192125415436> bot is down")
i got the code from this post but this command will send me the message only if the there are no message sent after I use the command, if there is any messages the command will stop or after the warn message is sent the command stops watching, I want to make it so its always watching the the channel