import telebot
import constant
bot = telebot.TeleBot(constant.token)
upd = bot.get_updates()
last_upd = upd[-1]
message_from_user = last_upd.message
@bot.message_handler(func=lambda message: message.document.mime_type == 'text/plain', content_types=['document'])
def handle_text_doc(message):
if message.text == 'Документ':
bot.send_text(message.from_user.id, constant.document)
#document.close
chat_id = message.chat.id
file_info = bot.get_file(message.document.file_id)
downloaded_file = bot.download_file(file_info.file_path)
src = u'C:\\Users\Hleb\\Python\\excel\\' + message.document.file_name
with open(src, 'wb') as new_file:
new_file.write(downloaded_file)
bot.reply_to(message, "Одну минутку...")
import tableTOtable
bot.send_document
bot.polling(none_stop=True, interval=0)
import telebot
import constant
bot = telebot.TeleBot(constant.token)
upd = bot.get_updates()
last_upd = upd[-1]
message_from_user = last_upd.message
@bot.message_handler(func=lambda message: message.document.mime_type == 'text/plain', content_types=['document'])
def handle_text_doc(message):
if message.text == 'Документ':
bot.send_text(message.from_user.id, constant.document)
#document.close
chat_id = message.chat.id
file_info = bot.get_file(message.document.file_id)
downloaded_file = bot.download_file(file_info.file_path)
src = u'C:\\Users\Hleb\\Python\\excel\\' + message.document.file_name
with open(src, 'wb') as new_file:
new_file.write(downloaded_file)
bot.reply_to(message, "Одну минутку...")
import tableTOtable
bot.send_document
bot.polling(none_stop=True, interval=0)
Я считываю значение в str, а в принте он выводит: -2146826259.