diff --git a/davtelepot/__init__.py b/davtelepot/__init__.py index 0a63125..a1dae00 100644 --- a/davtelepot/__init__.py +++ b/davtelepot/__init__.py @@ -11,7 +11,7 @@ __author__ = "Davide Testa" __email__ = "davide@davte.it" __credits__ = ["Marco Origlia", "Nick Lee @Nickoala"] __license__ = "GNU General Public License v3.0" -__version__ = "2.9.7" +__version__ = "2.9.8" __maintainer__ = "Davide Testa" __contact__ = "t.me/davte" diff --git a/davtelepot/utilities.py b/davtelepot/utilities.py index 99b8c20..86fe7bb 100644 --- a/davtelepot/utilities.py +++ b/davtelepot/utilities.py @@ -1666,7 +1666,8 @@ async def send_part_of_text_file(bot, chat_id, file_path, caption=None, file_name='File.txt', user_record=None, update=None, reversed_=True, - limit=None): + limit=None, + encoding='utf-8'): """Send `lines` lines of text file via `bot` in `chat_id`. If `reversed`, read the file from last line. @@ -1677,7 +1678,7 @@ async def send_part_of_text_file(bot, chat_id, file_path, caption=None, if update is None: update = dict() try: - with open(file_path, 'r') as log_file: + with open(file_path, 'r', encoding=encoding) as log_file: lines = log_file.readlines() if reversed_: lines = lines[::-1]