Skip to content

Instantly share code, notes, and snippets.

@endofline
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save endofline/dd7f67adb4943d59c25d to your computer and use it in GitHub Desktop.
Save endofline/dd7f67adb4943d59c25d to your computer and use it in GitHub Desktop.
annotated structure
{
// bot.conversation_memory_set(<event.conv_id>, <keyname>)
// bot.conversation_memory_get(<event.conv_id>, <keyname>)
// <event.conv_id> can be CONVERSATION_ID_1, CONVERSATION_ID_2 etc
// <keyname> would be "somekey1", "somekey2", etc
// bot.memory.exists(["conv_data", "CONVERSATION_ID_1", "somekey1"]) returns true
// bot.memory.exists(["conv_data", "CONVERSATION_ID_1", "somekey5"]) returns false
"conv_data": {
"CONVERSATION_ID_1": {
"somekey1": "somevalue1",
"somekey2": "somevalue2",
"somekey3": "somevalue3"
},
"CONVERSATION_ID_2": {
... conversation keys ...
}
},
// bot.user_memory_set(<event.user.id_.chat_id>, <keyname>)
// bot.user_memory_get(<event.user.id_.chat_id>, <keyname>)
// <event.user.id_.chat_id> can be USER_ID_1, USER_ID_2 etc
// <keyname> would be "somekey1", "somekey2", etc
// bot.memory.exists(["user_data", "USER_ID_1", "somekey1"]) returns true
// bot.memory.exists(["user_data", "USER_ID_5", "somekey1"]) returns false
"user_data": {
"USER_ID_1": {
"somekey1": "somevalue1",
"somekey2": "somevalue2",
"somekey3": "somevalue3"
},
"USER_ID_2": {
... user keys ...
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment