diff --git a/telebot/__init__.py b/telebot/__init__.py index 78cf29d07..32f7b1d64 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -208,6 +208,16 @@ def __init__( self.threaded = threaded if self.threaded: self.worker_pool = util.ThreadPool(num_threads=num_threads) + + @property + def user(self) -> types.User: + """ + The User object representing this bot. + Equivalent to bot.get_me() but the result is cached so only one API call is needed + """ + if not hasattr(self, "_user"): + self._user = types.User.de_json(self.get_me()) + return self._user def enable_save_next_step_handlers(self, delay=120, filename="./.handler-saves/step.save"): """