Size: a a a

pyTelegramBotAPI.talks.ru

2020 November 18

Н

Никита in pyTelegramBotAPI.talks.ru
Aryn
Под хендлер с контент тайпс документ?
Да!
источник

A

Aryn in pyTelegramBotAPI.talks.ru
ダーリン (Darling)
А запись вообще как идёт
Нету в коде записи
источник

A

Aryn in pyTelegramBotAPI.talks.ru
Работает?
источник

Н

Никита in pyTelegramBotAPI.talks.ru
Traceback (most recent call last):
 File "py", line 16, in <module>
   file_info = bot.get_file(message.document.file_id)
NameError: name 'message' is not defined
источник

ダーリン (Darling)... in pyTelegramBotAPI.talks.ru
Aryn
Нету в коде записи
А как сделать!
источник

Н

Никита in pyTelegramBotAPI.talks.ru
Ошибка
источник

A

Aryn in pyTelegramBotAPI.talks.ru
Никита
Traceback (most recent call last):
 File "py", line 16, in <module>
   file_info = bot.get_file(message.document.file_id)
NameError: name 'message' is not defined
Пздц
источник

ダーリン (Darling)... in pyTelegramBotAPI.talks.ru
Aryn
Пздц
Ага
источник

A

Aryn in pyTelegramBotAPI.talks.ru
Никита
Traceback (most recent call last):
 File "py", line 16, in <module>
   file_info = bot.get_file(message.document.file_id)
NameError: name 'message' is not defined
Покажи хендлер
источник

A

Aryn in pyTelegramBotAPI.talks.ru
ダーリン (Darling)
А как сделать!
Ну downloaded_file это байты файла
источник

A

Aryn in pyTelegramBotAPI.talks.ru
Просто перекодировал в утф 8
источник

Н

Никита in pyTelegramBotAPI.talks.ru
@bot.message_handler(content_types=['document'])
def sms(message):
   bot.send_message(message.chat.id, 'отправьте файл с вопросами')

file_info = bot.get_file(message.document.file_id)
downloaded_file = bot.download_file(file_info.file_path)
texts = downloaded_file.decode('utf-8').split('\n')

t = ''
a = 1

for i in readed:
   t += i.replace(f'{a}) ', '')
   a += 1

bot.reply_to(message, t)        
         


bot.polling(none_stop=True)
источник

Н

Никита in pyTelegramBotAPI.talks.ru
Никита
@bot.message_handler(content_types=['document'])
def sms(message):
   bot.send_message(message.chat.id, 'отправьте файл с вопросами')

file_info = bot.get_file(message.document.file_id)
downloaded_file = bot.download_file(file_info.file_path)
texts = downloaded_file.decode('utf-8').split('\n')

t = ''
a = 1

for i in readed:
   t += i.replace(f'{a}) ', '')
   a += 1

bot.reply_to(message, t)        
         


bot.polling(none_stop=True)
Вот
источник

A

Aryn in pyTelegramBotAPI.talks.ru
Никита
@bot.message_handler(content_types=['document'])
def sms(message):
   bot.send_message(message.chat.id, 'отправьте файл с вопросами')

file_info = bot.get_file(message.document.file_id)
downloaded_file = bot.download_file(file_info.file_path)
texts = downloaded_file.decode('utf-8').split('\n')

t = ''
a = 1

for i in readed:
   t += i.replace(f'{a}) ', '')
   a += 1

bot.reply_to(message, t)        
         


bot.polling(none_stop=True)
Ты табы не поставил...
источник

ダーリン (Darling)... in pyTelegramBotAPI.talks.ru
Подвинуть вроде
источник

ダーリン (Darling)... in pyTelegramBotAPI.talks.ru
Надо тебе
источник

Н

Никита in pyTelegramBotAPI.talks.ru
Aryn
Ты табы не поставил...
Аааа
источник

A

Aryn in pyTelegramBotAPI.talks.ru
Никита
@bot.message_handler(content_types=['document'])
def sms(message):
   bot.send_message(message.chat.id, 'отправьте файл с вопросами')

file_info = bot.get_file(message.document.file_id)
downloaded_file = bot.download_file(file_info.file_path)
texts = downloaded_file.decode('utf-8').split('\n')

t = ''
a = 1

for i in readed:
   t += i.replace(f'{a}) ', '')
   a += 1

bot.reply_to(message, t)        
         


bot.polling(none_stop=True)
Убери строку где есть "отправьте файл с вопросами"
источник

Н

Никита in pyTelegramBotAPI.talks.ru
Пофиксите плиз
источник

A

Aryn in pyTelegramBotAPI.talks.ru
Никита
Аааа
Один таб на каждую строку
источник