I'm in the process of learning how to create a telegram bot and I seem to have run into an issue haha.

I currently store the chat\_ids of all the users who chat with the bot, into an SQLite database. This is to allow the bot to be able send them a message at a later time, via their respective chat\_ids. However, I would also like to retrieve their telegram username, to use it as part of the message that the bot will be sending.

I know I could simply store the usernames as well when they initiate a chat with the bot, however this is probably not a good solution as users may change their username, making the usernames in the database no longer correct.

May I know if there is a way within python to retrieve the user's telegram username using their chat\_ids?

Thanks!!