Period of inactivity

Hello team!

I have a question how can I make that after a period of inactivity of 5 minutes in the bot, I send a message from the bot to the user of “Hey, are you there”?

thk

Hi @ismael.romero,

This can be achieved by enabling bot kit sdk. There we have to put some code by configuring Redis to listen keypress events with some TTL.

Algorithm:

  1. Need to subscribe to keypress event for redis and save/replace ‘data’ object into redis as value against userid as key.
  2. Keypress event should set to desired TTL.
  3. Whenever this ‘saving to redis per user id’ will not happen for said time, then it evicts out such that we can display desired message to the user.

Regards,
Karthik

hello where I can see documentation on how to do what you say

Yes you can refer to following for installing/ configuring botkit:

https://developer.kore.ai/docs/bots/sdks/installing-the-botkit-sdk/
https://developer.kore.ai/docs/bots/sdks/sdk-events/
https://developer.kore.ai/docs/bots/sdks/using-the-botkit-sdk/
https://developer.kore.ai/docs/bots/sdks/functions-for-the-botkit-sdk/

You should subscribe to redis key press event like : (“SET”, “notify-keyspace-events”, “KExA”);

Reference: https://medium.com/@sauravomar01/redis-keyspace-notifications-for-expired-keys-f38c18484a89

However, I do not have working code snippet for this use case

Hey @ismael.romero, are you able to implement this feature in your bot?