Как я могу использовать идентификатор, который я получил через Telegram?Python

Программы на Python
Anonymous
Как я могу использовать идентификатор, который я получил через Telegram?

Сообщение Anonymous »


I am writing an application linked to telegrams, I wrote a bot that creates an entry in the telegram user database, after adding the apk to the bot database, how do I make the data that I created used in the application?

@dp.message_handler(commands=['send_apk']) async def send_apk(msg: types.Message): user_id = msg.from_user.id apk_file_path = "Dionis" with open(apk_file_path, 'rb') as apk_file: await bot.send_document(user_id, apk_file) @dp.message_handler(commands=['bind_apk']) async def bind_apk(msg: types.Message): apk_file_name = msg.text.split()[1] user_id = str(msg.from_user.id) apk_id = str(msg.from_user.id) apk_ref = fb.reference('/apkFiles/' + apk_id) apk_ref.child("telegramUserId").set(user_id) await msg.reply("Success") myRef.addValueEventListener(object: ValueEventListener { override fun onDataChange(snapshot: DataSnapshot) { val userId = snapshot.child("telegramUserId").getValue(String::class.java) if (userId != null) { tv.text=userId telegram.sendMessage(userId, userId) } } override fun onCancelled(error: DatabaseError) { } }) the code in question


Источник: https://stackoverflow.com/questions/780 ... a-telegram

Вернуться в «Python»