Closed AliBahaari closed 4 years ago
It's not TeleBot issue https://docs.python.org/3/library/os.html#os.rename
I know it is not, But It is very good if TeleBot that has many advantages have this ability too, Because some frameworks has this ability to not to use os.rename ... And It is not related to os.rename, Because I don't want to rename source file, In this option in other frameworks will add a text to the end of the file & send it to user but source file name is not changed.
Adding text to the end of file will mess up file extention
Are you sure that you'r talking not about Caption?
you can use:
filename='Biology.pdf' extension=filename[-4:] string=' - @mychannel' filename=filename[0:-4]+string+extension
-> Biology - @mychannel.pdf
@Kylmakalle I'm sure, Please check python-telegram-bot ...
@alfilesnet Thanks, I will check it ...
I think the problem is in telegram bot api, by that reason filename 'document' was hardcoded see commit 151880f, line 688 in https://github.com/eternnoir/pyTelegramBotAPI/blob/master/telebot/__init__.py
Please answer these questions before submitting your issue. Thanks!
What version of pyTelegramBotAPI are you using? 3.10 - I think, Because Installed By PIP
What OS are you using? GNU/Linux - Ubuntu 16.04
What version of python are you using? 3
Hello, First thanks for your implementation ... I have a question, Is it possible to add a string to file name we send to user ? For example my file name is "Biology.pdf", So I want to add a channel name like " - @Test" to the end of it to be "Biology.pdf - @Test". I know I can add caption but I need this too.