Answer the question
In order to leave comments, you need to log in
I created a telegram bot, it gives an error (see below), what should I do?
THE CODE:
from telegram.ext import Updater, MessageHandler, Filters, CommandHandler
from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove
def start(bot, update):
update.message.reply_text('Привет! Я информационный бот компании "бла бла бла".\n'
'Для получения информации можете воспользоваться подсказками ниже!',
reply_markup=markup)
def close_keyboard(bot, update):
update.message.reply_text('Ok', reply_markup=ReplyKeyboardRemove())
def echo(bot, update):
if update.message.text[-1] == '?':
update.message.reply_text('Конечно можно спросить! Только я культурно промолчу...')
else:
update.message.reply_text('Вполне возможно, кто ж знает?')
def работа(bot, update):
update.message.reply_text('Адрес: москва')
def подработка(bot, update):
update.message.reply_text('лалалалалалаалаллаалалалалюалюалаблаблаблабла')
def обратная_связь(bot, update):
update.message.reply_text('Телеграм: @(засекречено)')
def время_работы(bot, update):
update.message.reply_text('Время работы: 9:00 - 23:00')
updater = Updater('засекречено')
dp = updater.dispatcher
reply_keyboard =
markup = ReplyKeyboardMarkup(reply_keyboard, one_time_keyboard=False)
dp.add_handler(CommandHandler('start', start))
dp.add_handler(CommandHandler('close', close_keyboard))
dp.add_handler(CommandHandler('Работа', работа))
dp.add_handler(CommandHandler('Подработка', подработка))
dp.add_handler(CommandHandler('Обратная связь', обратная связь))
dp.add_handler(CommandHandler('Время работы', время работы))
text_handler = MessageHandler(Filters.text, echo)
dp.add_handler(text_handler)
updater.start_polling()
updater.idle()
Answer the question
In order to leave comments, you need to log in
https://core.telegram.org/bots#commands
A command must always start with the '/' symbol and may not be longer than 32 characters. Commands can use latin letters, numbers and underscores.
Russian words like yours as commands are not supported
if you really need to. Then these are no longer commands, but an independent analysis of the message itself from the user for the right words
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question