send document by FILEID

Viewed 220

Im new to python and i want to send document by file_id and i dont know what wrong about this, And this is what i did :)

import telebot

tb = telebot.TeleBot('bot-token')

@tb.message_handler(commands=['r'])
def send_document(message):
        tb.send_document(message.chat.id,document = "file_id")
tb.polling()

And this is the error i get

TypeError: send_document() got an unexpected keyword argument 'document'

I hope for a response

1 Answers

Just put your "fileid" without the "document="

So do this

import telebot

tb = telebot.TeleBot('bot-token')

@tb.message_handler(commands=['r'])
def send_document(message):
        tb.send_document(message.chat.id,"file_id")
tb.polling()
Related