ADDED THE UPTIME PLUGIN OF THE UNSTABLE TELEFRICABOT REPO
This commit is contained in:
parent
f5132bf119
commit
65fca5881b
|
@ -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))
|
|
@ -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))
|
||||
|
Loading…
Reference in New Issue