Skip to content

Commit a1d674a

Browse files
committed
Refactor, dev tools.
1 parent 90a84af commit a1d674a

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

bin/run_bot.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ def set_handlers(application):
3737
raffle.set_handlers(application)
3838
schedule.set_handlers(application)
3939
announcements.set_handlers(application)
40-
#devtools.set_handlers(application)
40+
devtools.set_handlers(application)
4141
application.add_handler(MessageHandler(filters.COMMAND, unknown_command))
4242

4343

4444
if __name__ == '__main__':
4545
logger.info('Starting PyCamp Bot')
46-
# escribo environ para pruebas por no poder pasar kargs en consola windows
47-
os.environ['TOKEN'] = '5265755654:AAGhJKGgIoaKAjxnq9pn113ec9CURGVGG2k'
4846

4947
if 'TOKEN' in os.environ.keys():
5048
models_db_connection()

src/pycamp_bot/commands/auth.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pycamp_bot.logger import logger
55
from pycamp_bot.utils import escape_markdown
66

7-
PSW = '123456'
7+
88
def get_admins_username():
99
admins = []
1010
pycampistas = Pycampista.select()
@@ -54,10 +54,8 @@ async def grant_admin(update, context):
5454
passwrd = parameters[1]
5555

5656
user = Pycampista.get_or_create(username=username, chat_id=chat_id)[0]
57-
#if 'PYCAMP_BOT_MASTER_KEY' in os.environ.keys():
58-
if True:
59-
#if passwrd == os.environ['PYCAMP_BOT_MASTER_KEY']:
60-
if passwrd == PSW:
57+
if 'PYCAMP_BOT_MASTER_KEY' in os.environ.keys():
58+
if passwrd == os.environ['PYCAMP_BOT_MASTER_KEY']:
6159
user.admin = True
6260
user.save()
6361
rply_msg = 'Ahora tenes el poder. Cuidado!'

0 commit comments

Comments
 (0)