From 65fca5881bb00e68ea3832e0e7a237d4c75ddc7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Boris=20Daniel=20Martinez=20Mill=C3=A1n?= Date: Tue, 9 Mar 2021 00:55:43 -0500 Subject: [PATCH] ADDED THE UPTIME PLUGIN OF THE UNSTABLE TELEFRICABOT REPO --- myservices_module.py | 22 ++++++++++++++++++++++ uptime_module.py | 8 ++++++++ 2 files changed, 30 insertions(+) create mode 100644 myservices_module.py create mode 100644 uptime_module.py 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)) +