MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / send_welcome

Function send_welcome

examples/stars_payment.py:17–28  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

15# Handler for /start command - Then the bot will send amount stars to purchase
16@bot.message_handler(commands=['start'])
17def send_welcome(message):
18 # Create a custom keyboard with 2 buttons per row
19 markup = types.ReplyKeyboardMarkup(row_width=2)
20 # Generate buttons for each product in our PRICES dictionary
21 buttons = [types.KeyboardButton(product) for product in PRICES.keys()]
22 # Add all buttons to the markup
23 markup.add(*buttons)
24
25 # Send welcome message with the custom keyboard
26 bot.reply_to(message,
27 "Welcome to Stars Payment Bot!\nPlease select amount of stars to purchase:",
28 reply_markup=markup)
29
30# Handler for when user selects a product from the keyboard
31@bot.message_handler(func=lambda message: message.text in PRICES.keys())

Callers

nothing calls this directly

Calls 2

addMethod · 0.95
reply_toMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…