ADDED THE UPTIME PLUGIN OF THE UNSTABLE TELEFRICABOT REPO

This commit is contained in:
Boris Daniel Martinez Millán 2021-03-09 00:55:43 -05:00
parent f5132bf119
commit 65fca5881b
2 changed files with 30 additions and 0 deletions

22
myservices_module.py Normal file
View File

@ -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))

8
uptime_module.py Normal file
View File

@ -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))