Delaying Responses

If you want your bot to feel a little more "human-like" in its responses to your users, you can add a small delay between the time your bot received a message and when it responds. Use the <delay> direction to do this and specify the number of seconds you want to delay, up to 120. Place the direction immediately before the response that you want to add a delay to:

+ hello
- <delay seconds=50> Oh... hey there! Sorry it took me a bit to respond, I'm totally a human.

<delay> also doubles as a <send> direction if you include it in the middle of a response. For instance this script:

+ knock knock
- Stop that banging! <delay seconds=3> ... but ok, who's there?

Will behave like:

Delay example

Delaying messages via <delay> is meant for small delays that add a bit of human-like flourish to your bot's responses. It is NOT meant to be used for wholesale message scheduling, which is better suited for Broadcasts.

Mixing Delays With Non-Delays

If you have a long <delay>, there is a risk of your user messaging your bot before that delay has finished. In this scenario, that new message cancels any delays in your message. So if we modify the script above:

+ knock knock
- Stop that banging! <delay seconds=3> ... but ok, who's there?
 
+ *
- Hey I was in the middle of something!

If a user interrupts the bot before it sends the message that is delayed, that message won't be sent:

Interrupted delay

If you don't want your <delay> to get canceled, you can add a nocancel option to the shortcode. So this script:

+ knock knock
- Stop that banging! <delay seconds=3 nodelay> ... but ok, who's there?
 
+ *
- Hey I was in the middle of something!

will behave like:

nocancel delay