From 9501c284b8a5797189d826958275ed288f82c67f Mon Sep 17 00:00:00 2001 From: David Todd Date: Tue, 30 Oct 2018 01:41:46 -0500 Subject: [PATCH] Get started on server --- server/main.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 server/main.py diff --git a/server/main.py b/server/main.py new file mode 100644 index 0000000..202678d --- /dev/null +++ b/server/main.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +from bottle import route, run, template +from telegram.ext import Updater +import logging +import os + +updater = Updater(os.env.get('TGTOKEN')) +dispatcher = updater.dispatcher + +logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + level=logging.INFO) + +def start_tgbot(bot, update): + introtext = """Hello! My purpose is to control an IOT RGB LED matrix + + To get started I will need to establish a connection to your device. + Please send `/newdevice` to get started + """ + bot.send_message(chat_id=update.message.chat_id, + text=introtext)