import telebot
token = "8xxxxxxx7:AAElU-XhG1of3VaZMexdDIE-M2aY71CRIFk"
bot = telebot.TeleBot(token)
bot.send_document(5xxxxxxx4, open(file.txt, 'rb'))
TypeError: send_document() takes 1 positional argument but 3 were given
send_document is not implemented in the base Telebot class:
def send_document(self): raise NotImplemented("send_document needs work")
So if you want to use it, you should create the derived class and implement it manually.
def send_document(self): raise NotImplemented("send_document needs work")send_message or write the new class that is derived from TeleBot
.send_documentonly takesselfas an argument. Therefore, to pass arguments correctly, you'd need to justbot.send_document()(botisself, that is exactly 1 argument). But as @vurmux says in their answer, it will break again because the method is not implemented in the base class, you need to inherit from it and implement it yourself.