Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bot coding telegram.ext
#1
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)
Reply
#2
sorry, i have not used the command /caps before text input. thank you al.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Telegram bot python help! wolfdevs 0 770 Sep-07-2022, 11:34 AM
Last Post: wolfdevs
  Question about telegram bot Romank 0 2,243 Mar-29-2018, 09:36 PM
Last Post: Romank
  Telegram code help AaronJonk 0 9,530 Oct-05-2017, 02:44 PM
Last Post: AaronJonk

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020