MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / close

Method close

telebot/async_telebot.py:2871–2883  ·  view source on GitHub ↗

Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 m

(self)

Source from the content-addressed store, hash-verified

2869 return await asyncio_helper.log_out(self.token)
2870
2871 async def close(self) -> bool:
2872 """
2873 Use this method to close the bot instance before moving it from one local server to another.
2874 You need to delete the webhook before calling this method to ensure that the bot isn't launched again
2875 after server restart.
2876 The method will return error 429 in the first 10 minutes after the bot is launched.
2877 Returns True on success.
2878
2879 Telegram documentation: https://core.telegram.org/bots/api#close
2880
2881 :return: :obj:`bool`
2882 """
2883 return await asyncio_helper.close(self.token)
2884
2885 def enable_saving_states(self, filename="./.state-save/states.pkl"):
2886 """

Callers 2

close_sessionMethod · 0.45
run_webhooksMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected