User Class
extends BaseRepresents a Telegram user or bot.
Properties
addedToAttachmentMenu: boolean
client: Client
firstName: string
id: number
isBot: boolean
isPremium: boolean
languageCode: string
lastName: string
username: string
Methods
toJSON()
toString()
{ "id": 1888, "name": "User", "variant": "declaration", "kind": 128, "flags": {}, "comment": { "summary": [ { "kind": "text", "text": "Represents a Telegram user or bot." } ] }, "children": [ { "id": 1889, "name": "constructor", "variant": "declaration", "kind": 512, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 33, "character": 1 } ], "signatures": [ { "id": 1890, "name": "new User", "variant": "signature", "kind": 16384, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 33, "character": 1 } ], "parameters": [ { "id": 1891, "name": "client", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "reference", "target": 1, "name": "Client", "package": "tgkit", "qualifiedName": "default" } }, { "id": 1892, "name": "data", "variant": "param", "kind": 32768, "flags": {}, "type": { "type": "intrinsic", "name": "any" } } ], "type": { "type": "reference", "target": 1888, "name": "User", "package": "tgkit", "qualifiedName": "default" }, "overwrites": { "type": "reference", "target": -1, "name": "Base.constructor" } } ], "overwrites": { "type": "reference", "target": -1, "name": "Base.constructor" } }, { "id": 1900, "name": "addedToAttachmentMenu", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "*true*, if this user added the bot to the attachment menu" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 31, "character": 1 } ], "type": { "type": "intrinsic", "name": "boolean" } }, { "id": 1907, "name": "client", "variant": "declaration", "kind": 1024, "flags": { "isInherited": true }, "sources": [ { "fileName": "packages/tgkit/src/structures/Base.ts", "line": 4, "character": 1 } ], "type": { "type": "reference", "target": 1, "name": "Client", "package": "tgkit", "qualifiedName": "default" }, "inheritedFrom": { "type": "reference", "target": -1, "name": "Base.client" } }, { "id": 1895, "name": "firstName", "variant": "declaration", "kind": 1024, "flags": {}, "comment": { "summary": [ { "kind": "text", "text": "User's or bot's first name" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 13, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 1893, "name": "id", "variant": "declaration", "kind": 1024, "flags": {}, "comment": { "summary": [ { "kind": "text", "text": "Unique identifier for this user or bot" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 7, "character": 1 } ], "type": { "type": "intrinsic", "name": "number" } }, { "id": 1894, "name": "isBot", "variant": "declaration", "kind": 1024, "flags": {}, "comment": { "summary": [ { "kind": "text", "text": "*true*, if this user is a bot" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 10, "character": 1 } ], "type": { "type": "intrinsic", "name": "boolean" } }, { "id": 1899, "name": "isPremium", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "*true*, if this user is a Telegram Premium user" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 28, "character": 1 } ], "type": { "type": "intrinsic", "name": "boolean" } }, { "id": 1898, "name": "languageCode", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "IETF language tag of the user's language" } ], "blockTags": [ { "tag": "@see", "content": [ { "kind": "inline-tag", "tag": "@link", "text": "https://en.wikipedia.org/wiki/IETF_language_tag", "target": "https://en.wikipedia.org/wiki/IETF_language_tag" } ] } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 25, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 1896, "name": "lastName", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "User's or bot's last name" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 16, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 1897, "name": "username", "variant": "declaration", "kind": 1024, "flags": { "isOptional": true }, "comment": { "summary": [ { "kind": "text", "text": "User's or bot's username" } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 19, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } }, { "id": 1903, "name": "toJSON", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 50, "character": 1 } ], "signatures": [ { "id": 1904, "name": "toJSON", "variant": "signature", "kind": 4096, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 50, "character": 1 } ], "type": { "type": "reflection", "declaration": { "id": 1905, "name": "__type", "variant": "declaration", "kind": 65536, "flags": {}, "children": [ { "id": 1906, "name": "id", "variant": "declaration", "kind": 1024, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 52, "character": 3 } ], "type": { "type": "intrinsic", "name": "number" }, "defaultValue": "..." } ], "groups": [ { "title": "Properties", "children": [ 1906 ] } ], "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 51, "character": 9 } ] } } } ] }, { "id": 1901, "name": "toString", "variant": "declaration", "kind": 2048, "flags": {}, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 46, "character": 1 } ], "signatures": [ { "id": 1902, "name": "toString", "variant": "signature", "kind": 4096, "flags": {}, "comment": { "summary": [ { "kind": "text", "text": "Returns a string representation of an object." } ] }, "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 46, "character": 1 } ], "type": { "type": "intrinsic", "name": "string" } } ] } ], "groups": [ { "title": "Constructors", "children": [ 1889 ] }, { "title": "Properties", "children": [ 1900, 1907, 1895, 1893, 1894, 1899, 1898, 1896, 1897 ] }, { "title": "Methods", "children": [ 1903, 1901 ] } ], "sources": [ { "fileName": "packages/tgkit/src/structures/User.ts", "line": 5, "character": 21 } ], "extendedTypes": [ { "type": "reference", "target": { "sourceFileName": "packages/tgkit/src/structures/Base.ts", "qualifiedName": "default" }, "name": "default", "package": "tgkit" } ], "extendedBy": [ { "type": "reference", "target": 1231, "name": "ClientUser" } ] }