D
D
Danya  2020-08-15 23:28:07
Python
Danya  , 2020-08-15 23:28:07

Unable to send TelegramBOT message?

Unable to send message.
Here is the message code:

def getRegData(user, title, name):
  t = Template('$title *$name* \n Город: *$userCity* \n ФИО: *$fullname* \n Телефон: *$phone* \n Почта: *$email* \n Viber: *$viber*')
  return t.substitute({
    'title': title,
    'name': name,
    'userCity': user.city,
    'fullname': user.fullname,
    'phone': user.phone,
    'email': user.email,
    'viber': user.viber,
  })


Here is the problem itself:
@bot.message_handler(content_types=['text']
def send_text(message)
    if message.text == 'Отправить!':
        bot.send_message(message.chat.id, getRegData(user, title, name)

How to modify (add, change) the code?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question