I know how to use the time.sleep() command to create a delay in a script, but I'm developing a chatango bot and I want to prevent it from flooding the chat by putting a 3 second delay after each command. However, I'm not sure how to make that happen exactly, and my current attempt just makes the script itself delay for 3 seconds. This is what I have as an example:
s = message.body
if 'test' in s:
print(room.message("This is a sample."))
import time
time.sleep(3)
I'm not quite sure what to do from here, so any help would be appreciated, thank you.
NOTE: This is NOT the same question as "How can I make a time delay in Python?" No answers on that question helped me in any way, it's a different thing I'm asking for.
NOTE AGAIN: People keep implying it's the same question as another one and IT IS NOT. It is a DIFFERENT QUESTION. Why is that so hard for you people to grasp?