diff --git a/myservices_module.py b/myservices_module.py new file mode 100644 index 0000000..0585df0 --- /dev/null +++ b/myservices_module.py @@ -0,0 +1,22 @@ +from include import services +from telegram import Update +from telegram.ext import Updater, CallbackContext + +def return_string(lang): + try: + return services[lang] + except: + try: + return services['es'] + except: + return 'Error en modulo myservices' + +def my_services(update:Update, context: CallbackContext) -> None: + context.bot.send_chat_action(chat_id=update.message.chat_id, action=telegram.ChatAction.TYPING) + try: + lan=io.open(update.effective_user.username,"r") + lang=lan.read() + lan.close() + except: + lang="es" + update.message.reply_text(return_string(lang)) diff --git a/uptime_module.py b/uptime_module.py new file mode 100644 index 0000000..3c37b31 --- /dev/null +++ b/uptime_module.py @@ -0,0 +1,8 @@ +import subprocess +from telegram import Update +from telegram.ext import Updater, CallbackContext + +def uptime(update: Update,context: CallbackContext): + """Uptime es un modulo solo compatible con linux que permite ver el tiempo desde que se encendio la pc""" + update.message.reply_text(subprocess.check_output('uptime',shell=True,universal_newlines=True)) +