profile
viewpoint

Ask questionssending images

Hey, currently its not possible to send images or? Do you know if its possible with tdlib?

alexander-akhmetov/python-telegram

Answer questions alexander-akhmetov

Yes, it is possible with tdlib but is not implemented in the python-telegram yet.

I would not recommend using this, but photos and documents can be sent using the private method Telegram._send_data:

Document

data = {
    '@type': 'sendMessage',
    'chat_id': chat_id,
    'input_message_content': {
        '@type': 'inputMessageDocument',
        'document': {'@type': 'inputFileLocal', 'path': '/Users/iam/my_file.txt'},
    },
}

result = tg._send_data(data)

Photo

data = {
    '@type': 'sendMessage',
    'chat_id': chat_id,
    'input_message_content': {
        '@type': 'inputMessagePhoto',
        'photo': {'@type': 'inputFileLocal', 'path': '/Users/iam/my_photo.png'},
    },
}


result = tg._send_data(data)
useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List