How to Build a Telegram Bot in Python (2026 Guide)
MoneyDeskTelegram bots are one of the most useful tools for automating notifications, monitoring prices, and managing communities. Here's how to build one in Python.
Step 1: Create a bot
Message @BotFather on Telegram. Send /newbot. Give it a name and username. You'll get an API token.
Step 2: Write the code
import telebot
bot = telebot.TeleBot('YOUR_TOKEN')
@bot.message_handler(commands=['start'])
def start(msg):
bot.reply_to(msg, 'Hello! I am your bot.')
bot.polling()Step 3: Run it
pip install pyTelegramBotAPI && python bot.py
That's the basic bot. For something more complex:
- Price alerts: Check an API every 5 minutesAuto-replies: Match keywords in messagesData delivery: Query a database and format results
Need a bot built for you? I write custom Telegram/Discord bots for BTC fixed price: https://mtg-arbitrage-desk.loca.lt/order?service=bot