MozIta MyUserId Bot (@mozita_myuserid_bot) was a small utility for the Mozilla Italia community. It replied to /myuserid (or /start) with the sender's numeric Telegram user ID, in private chat or in a group where it was an admin. It also recorded the user IDs, usernames and group chat IDs it saw in JSON files and notified the developer about each new one. It was written in Python 3 with the telepot library.
The developer's notification about each new user ID now includes a clickable mention of the user.
The bot now saves each user's username along with the user ID, and no longer stores private chats as chat IDs.
Fixed the UTF-8 encoding of console output.
Fixed startup problems: f-strings were replaced with string concatenation and the earlier encoding change was reverted.
UTF-8 fix for console messages. The script was renamed to myuserid_mozita.py and now prints its version at startup.
The developer gets a notification for every new user ID and chat ID.
The bot token moved to a config.ini file, and the chat IDs where the command is used are now saved too.
First stable version: the bot replies to /myuserid (or /start) with the sender's Telegram user ID and saves it to userid_list.json.