mirror of
https://github.com/andwati/unsplash-bot.git
synced 2026-11-26 20:48:45 +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 flask
|
||||||
import telebot
|
import telebot
|
||||||
|
|
||||||
from bot import bot
|
from .bot import bot
|
||||||
|
|
||||||
app = flask.Flask(__name__)
|
app = flask.Flask(__name__)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user