'(discord.py) How to make a loop stop when a message is sent

I'll use this as a simple example. I want a loop like this for example to stop counting when a user types a message.

  if lower_user_message.startswith('count'):
    for number in range(100):
        x += 1
        await message.channel.send(x)
        if lower_user_message == 'stop':
            break


Solution 1:[1]

%H is for 24 hour times which is not compatible with am/pm. Try using %h

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 NickW