Bot coding telegram.ext - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Bot coding telegram.ext (/thread-27186.html) |
Bot coding telegram.ext - Kumarkv - May-28-2020 Dear All, Excuse me if my post is in not proper forum. I am trying bot library from telegram.ext. Used the same code from python telegram bot. The echo function is working as expected. But the caps function is not producing capital text . Could throw some light. def echo(update, context): context.bot.send_message(chat_id=update.effective_chat.id, text=update.message.text) from telegram.ext import MessageHandler, Filters echo_handler = MessageHandler(Filters.text & (~Filters.command), echo) dispatcher.add_handler(echo_handler) def caps(update, context): text_caps = ' '.join(context.args).upper() context.bot.send_message(chat_id=update.effective_chat.id, text=text_caps) caps_handler = CommandHandler('caps', caps) dispatcher.add_handler(caps_handler) RE: Bot coding telegram.ext - Kumarkv - May-29-2020 sorry, i have not used the command /caps before text input. thank you al. |