-1

I had a code for making a telegram bot and I only want to print the numerical digit here, however I'm only getting the dict.value and my module which I'm using for this bot only allows the numerical number. My code:

def search(update,context):
    number=update.message.parse_entities(types=MessageEntity.PHONE_NUMBER) 
    context.bot.sendMessage(chat_id=update.effective_chat.id,text-("working on it..."))
    print(number.values())

And I am getting an output like this if someone enter his number into my bot.

Dict_values=['097477376']

I only want numerical digits from this output and nothing else.

How can I only take the number from this output?

Erik77
  • 109
  • 4
  • 12

1 Answers1

0
def search(update,context):
    number=update.message.parse_entities(types=MessageEntity.PHONE_NUMBER) 
    context.bot.sendMessage(chat_id=update.effective_chat.id,text-("working on 
    it..."))
    print(number.values()[0])

From your question i can't get what u are looking for but from your output i think these will work please share your review if its work also share if it don't.

Harsh Parekh
  • 103
  • 6