Skip to content

Instantly share code, notes, and snippets.

@dev4Fun
Last active May 17, 2018 00:48
Show Gist options
  • Save dev4Fun/bf02070f3a0dd867c0cfe2166141a926 to your computer and use it in GitHub Desktop.
Save dev4Fun/bf02070f3a0dd867c0cfe2166141a926 to your computer and use it in GitHub Desktop.
class TelegramBot:
class PrivateUserFiler(BaseFilter):
def __init__(self, user_id):
self.user_id = int(user_id)
def filter(self, message):
return message.from_user.id == self.user_id
def __init__(self, token: str, allowed_user_id, trade_executor: TradeExecutor):
self.updater = Updater(token=token)
self.dispatcher = self.updater.dispatcher
self.trade_executor = trade_executor
self.exchange = self.trade_executor.exchange
self.private_filter = self.PrivateUserFiler(allowed_user_id)
self._prepare()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment