mirror of
https://github.com/andwati/unsplash-bot.git
synced 2026-11-19 09:15:13 +00:00
setup basic bot
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import telebot
|
||||
from config import TELEGRAM_TOKEN
|
||||
|
||||
bot = telebot.TeleBot(TELEGRAM_TOKEN)
|
||||
|
||||
|
||||
@bot.message_handler(commands=["start", "hello"])
|
||||
def send_welcome(message):
|
||||
bot.reply_to(message, "Hello, I'm a bot!")
|
||||
|
||||
|
||||
@bot.message_handler(func=lambda msg: True)
|
||||
def echo_all(message):
|
||||
bot.reply_to(message, message.text)
|
||||
|
||||
|
||||
bot.infinity_polling()
|
||||
Reference in New Issue
Block a user