-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Telegram Passport support #468
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Do we want something that automatically fetches and then decrypts Passport-related files, maybe an extension to |
Yes, I think |
Btw guys, it's not fully related, but could be interesting for you sergeysova/telegram-typings#23 |
Will there be chances this issue get resolved in 2019? :wonder: |
@lifehome the only thing blocking this PR from being merged is tests. Unfortunately, I don't have the time to write them myself, but if someone else wants to contribute I would be glad to accept a PR into my own branch! |
@tjhorner thank you a lot for const Telegraf = require('telegraf')
const TelegramPassport = require('telegram-passport')
const bot = new Telegraf(process.env.BOT_TOKEN)
const passport = new TelegramPassport("PRIVATE_KEY_IN_PEM_FORMAT")
bot.on('passport_data', (ctx) => {
const decryptedPasswordData = passport.decrypt(ctx.passportData)
console.log(decryptedPasswordData)
return ctx.setPassportDataErrors([
{ source: 'selfie', type: 'driver_license', file_hash: 'file-hash', message: 'Selfie photo is too low quality'}
])
}) New version will be published shortly. |
Description
This pull request is a work in progress. Still needed:
getPassportFile
method for retrieving + decrypting Passport files all at onceThis pull request adds support for Telegram Passport and decryption of Telegram Passport data with the
telegram-passport
package.Type of change
How Has This Been Tested?
A simple way to test this change would be:
Test Configuration:
Checklist: