Python: User Object
The User global — per-user data storage keyed by chat id.
Use User to store data scoped to a single user, such as a profile, balance, or preference.
Storing user data
By default, every call applies to the user who triggered the current command.
Reading another user
Pass user to act on a different chat id — useful for admin commands or notifying a specific user.
Method reference
| Method | Signature | Notes |
|---|---|---|
User.getData | getData(key, user=None, default=None) | Reads the current user unless `user` is given. |
User.saveData | saveData(key, value, user=None) | Writes the current user unless `user` is given. |
User.deleteData | deleteData(key, user=None) | Removes a stored value. |
Last updated August 11, 2026
Was this page helpful?