MCPcopy Index your code
hub / github.com/InstaPy/InstaPy / _check_authorized

Method _check_authorized

instapy/plugins/telegram_util.py:241–258  ·  view source on GitHub ↗

check if a user is authorized to use this bot :param update: :param context: :return:

(self, update, context)

Source from the content-addressed store, hash-verified

239 )
240
241 def _check_authorized(self, update, context):
242 """
243 check if a user is authorized to use this bot
244 :param update:
245 :param context:
246 :return:
247 """
248 if update.message.from_user.username != self.telegram_username:
249 self.__logger.warning(
250 "unauthorized access from {}".format(update.message.from_user)
251 )
252 context.bot.send_message(
253 chat_id=update.message.chat_id,
254 text="You are not authorized to use this service \n",
255 )
256 return False
257 else:
258 return True
259
260 def _clean_web_hooks(self):
261 """

Callers 4

_startMethod · 0.95
_reportMethod · 0.95
_stopMethod · 0.95
_unknownMethod · 0.95

Calls 1

send_messageMethod · 0.80

Tested by

no test coverage detected