added message handler for start command

This commit is contained in:
2022-05-08 00:33:13 +03:00
parent b3dec8fbf4
commit 3ca0f2c82f
3 changed files with 23 additions and 1 deletions
View File
+22
View File
@@ -0,0 +1,22 @@
from os import environ
import requests
import telebot
bot = telebot.TeleBot(environ["TELEGRAM_TOKEN"])
@bot.message_handler(commands=["start"])
def send_welcome(message):
"""
handle triggered by the /start command
"""
bot.reply_to(message, "hi there")
# configure the webhook for the bot
bot.set_webhook(
"https://{}.herokuapp.com/{}".format(
environ["PROJECT_NAME"], environ["TELEGRAM_TOKEN"]
)
)
+1 -1
View File
@@ -1,7 +1,7 @@
import flask
import telebot
from bot import bot
from .bot import bot
app = flask.Flask(__name__)