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?
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