loading
4Comments

Tell us about yourself!

Complete Your Profile
  • LuisR8 commented on NickL17's instructable Set up Telegram Bot on Raspberry Pi10 months ago
    Set up Telegram Bot on Raspberry Pi

    thank you so much, I've made some change in your code an added some new stuff that can help someone else.def handle(msg): chat_id = msg['chat']['id'] command = msg['text'] print 'Got command: %s' % command if command == '/roll': bot.sendMessage(chat_id, random.randint(1,6)) elif command == '/time': bot.sendMessage(chat_id, str(datetime.datetime.now())) elif command == '/kodirestart': print '0' subk0 = subprocess.check_output(['service','kodi','stop']) print 'subk0' bot.sendMessage(chat_id, 'KODI Stoped') time.sleep(5) subk1 = subprocess.check_output(['service','kodi','start']) print 'subk1' bot.sendMessage(chat_id, 'Starting KODI') elif command == '/ip': eip = subprocess.check_output(['python', '/home/pi/pyTelegramBotAPI/ip.py']) print '', eip bot.sendMess...see more »thank you so much, I've made some change in your code an added some new stuff that can help someone else.def handle(msg): chat_id = msg['chat']['id'] command = msg['text'] print 'Got command: %s' % command if command == '/roll': bot.sendMessage(chat_id, random.randint(1,6)) elif command == '/time': bot.sendMessage(chat_id, str(datetime.datetime.now())) elif command == '/kodirestart': print '0' subk0 = subprocess.check_output(['service','kodi','stop']) print 'subk0' bot.sendMessage(chat_id, 'KODI Stoped') time.sleep(5) subk1 = subprocess.check_output(['service','kodi','start']) print 'subk1' bot.sendMessage(chat_id, 'Starting KODI') elif command == '/ip': eip = subprocess.check_output(['python', '/home/pi/pyTelegramBotAPI/ip.py']) print '', eip bot.sendMessage(chat_id, str(eip)) elif command == '/uptime': uptime = subprocess.check_output(['uptime']) print '', uptime bot.sendMessage(chat_id, str(uptime)) elif command == '/reboot': bot.sendMessage(chat_id, 'Rebooting') time.sleep(10) reboot = subprocess.Popen(['reboot'])This is a useful project for me!....

    View Instructable »
  • LuisR8 commented on NickL17's instructable Set up Telegram Bot on Raspberry Pi10 months ago
    Set up Telegram Bot on Raspberry Pi

    How can I edit the script if i want for example to excecute O.S commands like "kodi service start", or to get the "uptime" info as a response. Thanks for this amazing tutorial.

    View Instructable »