diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f55e68a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: python -sudo: require -python: - - "3.6" - - "3.7" - - "3.8" -# command to install dependencies -install: - - pip install -r requirements.txt - - pip install coveralls - -# command to run tests -script: - - python -m compileall ./ - - coverage run --omit='*/virtualenv/*,*/site-packages/*,*/tests/*' -m unittest discover -s . -v -p "*_test.py" - -# create coverage for one python version -after_success: - - test $TRAVIS_PYTHON_VERSION == "3.8" && coveralls - -notifications: - email: false - -deploy: - provider: script - script: curl https://rico-j.de/travis/deploy-bj.sh - on: - branch: master diff --git a/blackjackbot/lang/custom_strings/README.md b/blackjackbot/lang/custom_strings/README.md new file mode 100644 index 0000000..cb39225 --- /dev/null +++ b/blackjackbot/lang/custom_strings/README.md @@ -0,0 +1,9 @@ +## custom_strings directory + +This directory was created to add translations on the fly, when the bot runs inside a docker container. + +``` +└───lang + ├───custom_strings // custom translations + └───strings // translations provided by the package maintainer +``` diff --git a/requirements.txt b/requirements.txt index 7b46adf..49e88a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -python-telegram-bot==13.1 +python-telegram-bot>=13.5 diff --git a/util/banneduserhandler.py b/util/banneduserhandler.py index 485aebe..64b4cac 100644 --- a/util/banneduserhandler.py +++ b/util/banneduserhandler.py @@ -1,13 +1,23 @@ # -*- coding: utf-8 -*- +import logging + from telegram.ext import TypeHandler import database class BannedUserHandler(TypeHandler): + logger = logging.getLogger() def check_update(self, update): db = database.Database() - if db.is_user_banned(update.effective_user.id): + user = update.effective_user + + if user is None: + self.logger.warning(f"User is None! Update: {update}") + return False + + if db.is_user_banned(user.id): return True + return False