olexnzarov / telegraf-session-mongodb

MongoDB session middleware for Telegraf
25 stars 14 forks source link

Support for pull answers #11

Closed acollazo25 closed 3 years ago

acollazo25 commented 3 years ago

Add support for poll answers. from is missing in response

https://github.com/alexnzarov/telegraf-session-mongodb/blob/d2de0bdeb6471a330cf48ac6bec53fb62111513f/index.js#L30

 {
  poll_id: '0000000000000000',
  user: {
    id: 0000000000,
    is_bot: false,
    first_name: 'Me',
    username: 'me',
    language_code: 'en'
  },
  option_ids: [ 2 ]
}
olexnzarov commented 3 years ago

Hey.

I just published a 2.0 version of this package. It includes breaking changes, a different interface, and Telegraf 4.0 support, but it also supports a custom key creation function that can be passed in the options object.

It should support poll answers by default, but currently, Telegraf isn't fully supporting them. I will make a pull request to fix this. In meantime, you can extend the default implementation of 'getSessionKey' function and pass it in the options object.