NxCreateDocs

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.

User.saveData('name', 'Alex')
name = User.getData('name')
User.deleteData('temp_flag')

Reading another user

Pass user to act on a different chat id — useful for admin commands or notifying a specific user.

balance = User.getData('balance', user=other_chat_id, default=0)
User.saveData('banned', True, user=other_chat_id)

Method reference

MethodSignatureNotes
User.getDatagetData(key, user=None, default=None)Reads the current user unless `user` is given.
User.saveDatasaveData(key, value, user=None)Writes the current user unless `user` is given.
User.deleteDatadeleteData(key, user=None)Removes a stored value.
Last updated August 11, 2026
Was this page helpful?