A
A
Aixmng2017-09-13 20:40:23
Python
Aixmng, 2017-09-13 20:40:23

How to save the id of the photos sent to the bot in the telegram?

It is necessary that when the user sends a photo to the bot, its id is assigned to a variable.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DENIS SHELESTOV, 2017-09-17
@djdeniro

photos = {}
#Ваш код
def add_photo(user_id, photo_id):
    global photos
    try:
        photos[user_id] += [photo_id]
    except:
        photos[user_id] = [photo_id]
add_photo(1, "asdasdasd123124")
print(photos)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question