mirror of
https://github.com/andwati/unsplash-bot.git
synced 2026-10-24 21:42:15 +00:00
added message handler for start command
This commit is contained in:
+22
@@ -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
@@ -1,7 +1,7 @@
|
||||
import flask
|
||||
import telebot
|
||||
|
||||
from bot import bot
|
||||
from .bot import bot
|
||||
|
||||
app = flask.Flask(__name__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user