'Python Telegram Bot check that user only gave a text message

I am trying to make a python telegram bot. Everything is well, except that I would like to send a message telling the user that the bot only accepts text messages and not others (eg. files, photos, stickers) if they do send such inputs to the bot. How should I go about doing so?

I tried using update.message.text but it seems to only contain the text message given by the user. I tried checking if update.message.text is null or empty string but it did not work too



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source