Ahora si un comando no esta documentado t

This commit is contained in:
Boris Daniel Martinez Millán 2021-03-09 08:26:30 -05:00
parent 860ba28049
commit 9970729ade
1 changed files with 5 additions and 2 deletions

5
bot.py
View File

@ -28,7 +28,11 @@ help1=''
def log_function(dispatcher,name,function1): def log_function(dispatcher,name,function1):
global help1 global help1
dispatcher.add_handler(CommandHandler(name,function1)) dispatcher.add_handler(CommandHandler(name,function1))
try:
help1=help1+str('/'+name)+' -> '+function1.__doc__+'\n\n' help1=help1+str('/'+name)+' -> '+function1.__doc__+'\n\n'
except:
help1=help1+str('/'+name)+' -> Not documented\n\n'
#Idioma español #Idioma español
es={'help':'''/start - Inicia el bot es={'help':'''/start - Inicia el bot
@ -137,7 +141,6 @@ def help(update:Update, context: CallbackContext) -> None:
def set(update:Update, context: CallbackContext) -> None: def set(update:Update, context: CallbackContext) -> None:
"""Establece alguna configuraciones"""
if update.message.text.replace("/set ","").split(" ")[0]=="language": if update.message.text.replace("/set ","").split(" ")[0]=="language":
if "en" in update.message.text.replace("/set ","").split(" "): if "en" in update.message.text.replace("/set ","").split(" "):
f=io.open(update.effective_user.username,"w") f=io.open(update.effective_user.username,"w")