S
S
shuzzixd2021-07-27 20:40:06
Python
shuzzixd, 2021-07-27 20:40:06

How to replace value?

I'm working on a telegram bot. For example, if the person does not have a username, then pytelegrambotapi displays the value "None". Is it possible to somehow replace it with, for example, "not available"?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Kotyashkin, 2021-07-28
@ErVinTract

Do it with instructions

@bot.message_handler(commands=['start']) 
def start(message):
    if message.from_user.username == ' ' 
       bot.send_message(message.chat.id, 'у вас нету Username')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question