баг какой то с ботом тг

лимаров

Участник
Автор темы
100
3
запускаю, показывает одну проблему, не понимаю, я новичок в этом
1713547235109.png
1713547199987.png
 

лимаров

Участник
Автор темы
100
3
asd:
import telebot

botTimeWeb = telebot.TeleBot('6830548762:AAEwhwDqk4DPskbXCHgp8fI_FuhGbKbwPFI')

from telebot import types

@botTimeWeb.message_handler(commands=['start'])
def startBot(message):
  first_mess = f"<b>{message.from_user.first_name} {message.from_user.last_name}</b>, привет!Хочешь расскажу немного о нашей компании?"
  markup = types.InlineKeyboardMarkup()
  button_yes = types.InlineKeyboardButton(text = 'Да', callback_data='yes')
  markup.add(button_yes)
  botTimeWeb.send_message(message.chat.id, first_mess, parse_mode='html', reply_markup=markup)

  @botTimeWeb.callback_query_handler(func=lambda call:True)
  def response(function_call):
     if function_call.message:
      if function_call.data == "yes":
        second_mess = "Мы облачная платформа для разработчиков и бизнеса. Более детально можешь ознакомиться с нами на нашем сайте!"
        markup = types.InlineKeyboardMarkup()
        markup.add(types.InlineKeyboardButton("Перейти в наш оффициальный телеграм канал", url="https://t.me/brandshopnsk"))
        botTimeWeb.send_message(function_call.message.chat.id, second_mess, reply_markup=markup)
        botTimeWeb.answer_callback_query(function_call.id)

botTimeWeb.infinity_polling()
 

vlaDICK2288

Активный
144
42
asd:
import telebot

botTimeWeb = telebot.TeleBot('6830548762:AAEwhwDqk4DPskbXCHgp8fI_FuhGbKbwPFI')

from telebot import types

@botTimeWeb.message_handler(commands=['start'])
def startBot(message):
  first_mess = f"<b>{message.from_user.first_name} {message.from_user.last_name}</b>, привет!Хочешь расскажу немного о нашей компании?"
  markup = types.InlineKeyboardMarkup()
  button_yes = types.InlineKeyboardButton(text = 'Да', callback_data='yes')
  markup.add(button_yes)
  botTimeWeb.send_message(message.chat.id, first_mess, parse_mode='html', reply_markup=markup)

  @botTimeWeb.callback_query_handler(func=lambda call:True)
  def response(function_call):
     if function_call.message:
      if function_call.data == "yes":
        second_mess = "Мы облачная платформа для разработчиков и бизнеса. Более детально можешь ознакомиться с нами на нашем сайте!"
        markup = types.InlineKeyboardMarkup()
        markup.add(types.InlineKeyboardButton("Перейти в наш оффициальный телеграм канал", url="https://t.me/brandshopnsk"))
        botTimeWeb.send_message(function_call.message.chat.id, second_mess, reply_markup=markup)
        botTimeWeb.answer_callback_query(function_call.id)

botTimeWeb.infinity_polling()
тебе нужно юзернейм? или имя и фамилию?
 

Fott

Простреленный
3,434
2,279
Python:
components = [message.from_user.first_name, message.from_user.last_name]
form = "".join(component for component in components if component)
form += ", привет! Хочешь расскажу немного о нашей компании?"

print(form)
1713548700503.png



Токен поменяй, ибо твоему боту сломают жопу