make sure no web_hooks are configured already otherwise telegram will respond 409 :return:
(self)
| 258 | return True |
| 259 | |
| 260 | def _clean_web_hooks(self): |
| 261 | """ |
| 262 | make sure no web_hooks are configured already otherwise telegram |
| 263 | will respond 409 |
| 264 | :return: |
| 265 | """ |
| 266 | r = requests.get( |
| 267 | "https://api.telegram.org/bot{}/deleteWebhook".format(self.token) |
| 268 | ) |
| 269 | |
| 270 | if r.json()["ok"] is not True: |
| 271 | self.__logger.warning("unable to remove webhook! Wrong token?") |
| 272 | |
| 273 | def _error_callback(self, update, error): |
| 274 | try: |