File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 11import os
2- from telegram .ext import Application
2+ from telegram .ext import Application , MessageHandler , filters
33from pycamp_bot .commands import auth
44from pycamp_bot .commands import voting
55from pycamp_bot .commands import manage_pycamp
1212from pycamp_bot .models import models_db_connection
1313from pycamp_bot .logger import logger
1414
15+ async def unknown_command (update , context ):
16+ text = "No reconozco el comando, para ver comandos válidos usá /ayuda"
17+ await context .bot .send_message (chat_id = update .message .chat_id , text = text )
18+
1519
1620def set_handlers (application ):
1721 base .set_handlers (application )
@@ -23,6 +27,7 @@ def set_handlers(application):
2327 raffle .set_handlers (application )
2428 schedule .set_handlers (application )
2529 announcements .set_handlers (application )
30+ application .add_handler (MessageHandler (filters .COMMAND , unknown_command ))
2631
2732
2833if __name__ == '__main__' :
Original file line number Diff line number Diff line change @@ -86,18 +86,17 @@ async def revoke_admin(update, context):
8686 user .admin = False
8787 user .save ()
8888 await context .bot .send_message (chat_id = chat_id ,
89- text = 'Un admin a caido --{}--.' .format (fallen_admin ))
89+ text = 'Un admin ha caido --{}--.' .format (fallen_admin ))
9090
9191
9292async def list_admins (update , context ):
9393 chat_id = update .message .chat_id
9494
9595 admins = get_admins_username ()
96- rply_msg = 'Los administradores son:\n '
96+ rply_msg = 'Lxs administradorxs son:\n '
9797
9898 for admin in admins :
99- rply_msg += admin
100- rply_msg += '\n '
99+ rply_msg += '@' + admin + '\n '
101100
102101 await context .bot .send_message (chat_id = chat_id , text = rply_msg )
103102
Original file line number Diff line number Diff line change @@ -45,3 +45,4 @@ def set_handlers(application):
4545
4646 application .add_handler (CommandHandler ('start' , start ))
4747 application .add_handler (CommandHandler ('ayuda' , help ))
48+ application .add_handler (CommandHandler ('help' , help ))
You can’t perform that action at this time.
0 commit comments