S
S
sashx2021-10-02 15:33:46
Bots
sashx, 2021-10-02 15:33:46

How can I handle this error with try/except?

When trying to write a message to a user who is not registered with the bot, such an error occurs. How can I handle this error with try/except? What type of error?

61585133172d7928314710.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuribtr, 2021-10-02
@sashx

You have written in the screenshot the type of error that must be written in the try except condition - this is ApiTelegramException
If you need to know exactly what the error is due to access rights, parse the error body and look for the 403 code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question