Hello, I have just tried this script posted on this forum https://www.helionet.org/index/topic/29129-python-script-behavior/?p=132451 But I get an internal error 500: Here is it: http://georgemo.heliohost.org/cgi-bin/loop.py My intention is to run this script in loop to handle bot messages. So I would also like to get
module telepot implemened
import telepot
import time
from telepot.loop import MessageLoop
def handle(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
if content_type == 'text':
text = msg['text']
print(text)
bot.sendMessage(chat_id = chat_id, text = "This message has been sent by heliohost")
#----------------MAIN---------------------------
bot = telepot.Bot("441478801:AAFlc7xxxxxxxSSzSEm0")
MessageLoop(bot, handle).run_as_thread()
print('Listening ...')
# Keep the program running.
while 1:
time.sleep(100)Thank you