skip to Main Content

Python telegram bot doesn't recognize text message – Telegram API

Here I have a code for making a simple echo bot for telegram. from telegram.ext import Updater, CommandHandler, MessageHandler, Filters import logging from data.constants import API_TOKEN, LOGGING_FORMAT logging.basicConfig(format=LOGGING_FORMAT, level=logging.DEBUG) updater = Updater(token=API_TOKEN) dispatcher = updater.dispatcher def start(update, context): context.bot.send_message(chat_id=update.effective_chat.id, text='Hello,…

VIEW QUESTION

telegram custom KeyboardButton doesn't work. After execution, no buttons apper in telegram, no erros occur – Telegram API

python version 3.8.3 import telegram #imorted methodts from telegram.ext import Updater, CommandHandler import requests from telegram import ReplyKeyboardMarkup, KeyboardButton from telegram.ext.messagehandler import MessageHandler import json # below is function defined the buttons to be return def start(bot, update): button1 =…

VIEW QUESTION

lamda funtion in @bot.message_handler() not working properly in telebot python – Telegram API

I tried to implement the following line of code in python script for a telegram bot building using telebot. @bot.message_handler(func=lambda msg:True if msg.text.startswith('/test')) def test_start(message): msg=bot.send_message(message.chat.id,'This feature is under developement') Above code gives me a syntax error. @bot.message_handler(func=lambda msg:True if…

VIEW QUESTION
Back To Top
Search