diff --git a/telebot/__init__.py b/telebot/__init__.py index 2f9d1c9..ce3963e 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -188,10 +188,10 @@ class TeleBot: if self.threaded: self.worker_pool = util.ThreadPool(num_threads=num_threads) - def enable_save_next_step_handlers(self, delay=120, filename="./handler-saves/step.save"): + def enable_save_next_step_handlers(self, delay=120, filename="./.handler-saves/step.save", del_file_after_loading=True): self.next_step_saver = Saver(self.next_step_handlers, filename, delay) - def enable_save_reply_handlers(self, delay=120, filename="./handler-saves/reply.save"): + def enable_save_reply_handlers(self, delay=120, filename="./.handler-saves/reply.save", del_file_after_loading=True): self.reply_saver = Saver(self.reply_handlers, filename, delay) def disable_save_next_step_handlers(self): @@ -200,10 +200,10 @@ class TeleBot: def disable_save_reply_handlers(self): self.reply_saver = None - def load_next_step_handlers(self, filename="./handler-saves/step.save"): + def load_next_step_handlers(self, filename="./.handler-saves/step.save"): self.next_step_saver.load_handlers(filename) - def load_reply_handlers(self, filename="./handler-saves/reply.save"): + def load_reply_handlers(self, filename="./.handler-saves/reply.save"): self.reply_saver.load_handlers(filename) def set_webhook(self, url=None, certificate=None, max_connections=None, allowed_updates=None): @@ -1474,12 +1474,12 @@ class AsyncTeleBot(TeleBot): TeleBot.__init__(self, *args, **kwargs) @util.async() - def enable_save_next_step_handlers(self, delay=120, filename="./handler-saves/step.save"): - return TeleBot.enable_save_next_step_handlers(self, delay, filename) + def enable_save_next_step_handlers(self, delay=120, filename="./.handler-saves/step.save", del_file_after_loading=True): + return TeleBot.enable_save_next_step_handlers(self, delay, filename, del_file_after_loading) @util.async() - def enable_save_reply_handlers(self, delay=120, filename="./handler-saves/reply.save"): - return TeleBot.enable_save_reply_handlers(self, delay, filename) + def enable_save_reply_handlers(self, delay=120, filename="./.handler-saves/reply.save", del_file_after_loading=True): + return TeleBot.enable_save_reply_handlers(self, delay, filename, del_file_after_loading) @util.async() def disable_save_next_step_handlers(self): @@ -1490,11 +1490,11 @@ class AsyncTeleBot(TeleBot): return TeleBot.enable_save_reply_handlers(self) @util.async() - def load_next_step_handlers(self, filename="./handler-saves/step.save"): + def load_next_step_handlers(self, filename="./.handler-saves/step.save"): return TeleBot.load_next_step_handlers(self, filename) @util.async() - def load_reply_handlers(self, filename="./handler-saves/reply.save"): + def load_reply_handlers(self, filename="./.handler-saves/reply.save"): return TeleBot.load_reply_handlers(self, filename) @util.async()