Skip to content

Instantly share code, notes, and snippets.

@pedromaironi
Created March 14, 2021 00:29
Show Gist options
  • Save pedromaironi/c6f684ceec3ff4d0b015daa4b742214b to your computer and use it in GitHub Desktop.
Save pedromaironi/c6f684ceec3ff4d0b015daa4b742214b to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} github.py importado.{/cyan}'))
@bot.message_handler(commands=['github'])
def command_github(m):
cid = m.chat.id
uid = m.from_user.id
try:
send_udp('github')
except Exception as e:
bot.send_message(52033876, send_exception(e), parse_mode="Markdown")
if not is_recent(m):
return None
if is_admin(uid):
pull_info = os.popen('git pull').read()
bot.send_message(cid, pull_info)
if not pull_info.startswith('Already'):
restart_process()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment