IntelligentTrading / telegram-bot

Intelligent Trading Technologies | Telegram Bot
MIT License
3 stars 2 forks source link

save session chat id in google cloud datastore #2

Closed tomcounsell closed 6 years ago

tomcounsell commented 6 years ago

User Story Link: https://trello.com/c/5SSO9XEX/6-start

Description and Context

When a new user begins using the bot, we need to save their chat session id. This will be saved in our database similar to how a typical application would save a username. All personal settings to this user will be associated to them via this chat session id as the "user". Saving this and noting their subscription will also allow us to push messages to the user in the future.

Possible Implementation

Input

Whenever a user begins using the bot via a text message or the /start command, the Telegram API will provide a chat session id in the incoming data.

Process

Docs for Read and Write to Google Cloud Datastore: https://cloud.google.com/nodejs/getting-started/using-cloud-datastore

Output

We want to save something like this in the datastore

{
  'interface': "telegram",
  'id': "abc1234",
  'setting': "{}"
}

Environment

Brbb commented 6 years ago

Estimate: 2h for Google Cloud Set up and Datastore test (understand index.yaml and docs in general, but it could be on me) 1h implementation