diff --git a/examples/go.mod b/examples/go.mod index c947890778..76da217867 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -14,7 +14,7 @@ require ( go.uber.org/atomic v1.11.0 go.uber.org/zap v1.27.0 golang.org/x/sync v0.17.0 - golang.org/x/term v0.35.0 + golang.org/x/term v0.36.0 golang.org/x/time v0.8.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) @@ -42,13 +42,13 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/gotd/ige v0.2.2 // indirect github.com/gotd/neo v0.1.5 // indirect - github.com/klauspost/compress v1.18.0 // indirect + github.com/klauspost/compress v1.18.1 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/ogen-go/ogen v1.15.0 // indirect + github.com/ogen-go/ogen v1.15.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -60,13 +60,13 @@ require ( go.opentelemetry.io/otel/metric v1.38.0 // indirect go.opentelemetry.io/otel/trace v1.38.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.42.0 // indirect + golang.org/x/crypto v0.43.0 // indirect golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 // indirect - golang.org/x/mod v0.28.0 // indirect - golang.org/x/net v0.44.0 // indirect - golang.org/x/sys v0.36.0 // indirect - golang.org/x/text v0.29.0 // indirect - golang.org/x/tools v0.37.0 // indirect + golang.org/x/mod v0.29.0 // indirect + golang.org/x/net v0.46.0 // indirect + golang.org/x/sys v0.37.0 // indirect + golang.org/x/text v0.30.0 // indirect + golang.org/x/tools v0.38.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect rsc.io/qr v0.2.0 // indirect diff --git a/examples/go.sum b/examples/go.sum index ac60192f28..92a09d7739 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -68,6 +68,7 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -80,6 +81,7 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/ogen-go/ogen v1.15.0 h1:AuSLghM88ijLy8eIFr5d5kHYRU1i3Ewk1tGArpvDDTY= github.com/ogen-go/ogen v1.15.0/go.mod h1:bS+BP2cV7+IGjOM24znBmh+PrpZvYFXA7o3BNF4Hj2E= +github.com/ogen-go/ogen v1.15.2/go.mod h1:bS+BP2cV7+IGjOM24znBmh+PrpZvYFXA7o3BNF4Hj2E= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -127,18 +129,21 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI= golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8= +golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY= golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U= golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI= +golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= +golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -151,12 +156,15 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ= golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA= +golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= +golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -165,6 +173,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= +golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go.mod b/go.mod index f666fb13c8..f770b76b2c 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/go-faster/xor v1.0.0 github.com/go-openapi/inflect v0.21.3 github.com/google/uuid v1.6.0 - github.com/gotd/getdoc v0.50.0 + github.com/gotd/getdoc v0.51.0 github.com/gotd/ige v0.2.2 github.com/gotd/neo v0.1.5 github.com/gotd/tl v0.4.0 diff --git a/go.sum b/go.sum index 24eadc1a51..80884dea3d 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gotd/getdoc v0.50.0 h1:Uejklrp9rrLkU8YlIyaBCDBqHbqAqoHYzVkDrciFpzU= -github.com/gotd/getdoc v0.50.0/go.mod h1:7z7IrsCH+c0OEqVd127PV/Fy3jOej7Nlq+QrcUCQ8MQ= +github.com/gotd/getdoc v0.51.0 h1:69sHC34TnRCizsL/2fGWkbs88GYmEHbRHmHQxF8+umM= +github.com/gotd/getdoc v0.51.0/go.mod h1:yGFagVr+5jxhUkVTQGOqiBG4Pty0slsLGBqEYhNrGIU= github.com/gotd/ige v0.2.2 h1:XQ9dJZwBfDnOGSTxKXBGP4gMud3Qku2ekScRjDWWfEk= github.com/gotd/ige v0.2.2/go.mod h1:tuCRb+Y5Y3eNTo3ypIfNpQ4MFjrnONiL2jN2AKZXmb0= github.com/gotd/neo v0.1.5 h1:oj0iQfMbGClP8xI59x7fE/uHoTJD7NZH9oV1WNuPukQ= diff --git a/tg/tl_account_chat_themes_gen.go b/tg/tl_account_chat_themes_gen.go index 179615abe9..e5fff9313d 100644 --- a/tg/tl_account_chat_themes_gen.go +++ b/tg/tl_account_chat_themes_gen.go @@ -32,6 +32,7 @@ var ( ) // AccountChatThemesNotModified represents TL type `account.chatThemesNotModified#e011e1c4`. +// The available chat themes were not modified // // See https://core.telegram.org/constructor/account.chatThemesNotModified for reference. type AccountChatThemesNotModified struct { @@ -133,20 +134,28 @@ func (c *AccountChatThemesNotModified) DecodeBare(b *bin.Buffer) error { } // AccountChatThemes represents TL type `account.chatThemes#be098173`. +// Available chat themes¹ +// +// Links: +// 1. https://core.telegram.org/api/themes#chat-themes // // See https://core.telegram.org/constructor/account.chatThemes for reference. type AccountChatThemes struct { - // Flags field of AccountChatThemes. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Hash field of AccountChatThemes. + // Hash to pass to the method that returned this constructor, to avoid refetching the + // result if it hasn't changed. Hash int64 - // Themes field of AccountChatThemes. + // Themes. Themes []ChatThemeClass - // Chats field of AccountChatThemes. + // Chats mentioned in the themes field. Chats []ChatClass - // Users field of AccountChatThemes. + // Users mentioned in the themes field. Users []UserClass - // NextOffset field of AccountChatThemes. + // Next offset for pagination. // // Use SetNextOffset and GetNextOffset helpers. NextOffset string diff --git a/tg/tl_account_connected_bots_gen.go b/tg/tl_account_connected_bots_gen.go index 65a042bfe4..2493db9151 100644 --- a/tg/tl_account_connected_bots_gen.go +++ b/tg/tl_account_connected_bots_gen.go @@ -35,7 +35,7 @@ var ( // Info about currently connected business bots¹. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/constructor/account.connectedBots for reference. type AccountConnectedBots struct { diff --git a/tg/tl_account_disable_peer_connected_bot_gen.go b/tg/tl_account_disable_peer_connected_bot_gen.go index 5fb5da7205..c9fe4654b3 100644 --- a/tg/tl_account_disable_peer_connected_bot_gen.go +++ b/tg/tl_account_disable_peer_connected_bot_gen.go @@ -38,7 +38,7 @@ var ( // user must reconnect the entire bot by invoking account.updateConnectedBot »³. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // 2. https://core.telegram.org/method/account.updateConnectedBot // 3. https://core.telegram.org/method/account.updateConnectedBot // @@ -181,7 +181,7 @@ func (d *AccountDisablePeerConnectedBotRequest) GetPeer() (value InputPeerClass) // user must reconnect the entire bot by invoking account.updateConnectedBot »³. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // 2. https://core.telegram.org/method/account.updateConnectedBot // 3. https://core.telegram.org/method/account.updateConnectedBot // diff --git a/tg/tl_account_get_bot_business_connection_gen.go b/tg/tl_account_get_bot_business_connection_gen.go index ace93c4da3..81a8df758f 100644 --- a/tg/tl_account_get_bot_business_connection_gen.go +++ b/tg/tl_account_get_bot_business_connection_gen.go @@ -49,7 +49,7 @@ var ( // // Links: // 1. https://core.telegram.org/constructor/updateBotBusinessConnect -// 2. https://core.telegram.org/api/business#connected-bots +// 2. https://core.telegram.org/api/bots/connected-business-bots // 3. https://core.telegram.org/constructor/updateBotNewBusinessMessage // 4. https://core.telegram.org/constructor/updateBotBusinessConnect // 5. https://core.telegram.org/constructor/updateBotBusinessConnect @@ -60,7 +60,7 @@ type AccountGetBotBusinessConnectionRequest struct { // Business connection ID »¹. // // Links: - // 1) https://core.telegram.org/api/business#connected-bots + // 1) https://core.telegram.org/api/bots/connected-business-bots ConnectionID string } @@ -203,7 +203,7 @@ func (g *AccountGetBotBusinessConnectionRequest) GetConnectionID() (value string // // Links: // 1. https://core.telegram.org/constructor/updateBotBusinessConnect -// 2. https://core.telegram.org/api/business#connected-bots +// 2. https://core.telegram.org/api/bots/connected-business-bots // 3. https://core.telegram.org/constructor/updateBotNewBusinessMessage // 4. https://core.telegram.org/constructor/updateBotBusinessConnect // 5. https://core.telegram.org/constructor/updateBotBusinessConnect @@ -214,7 +214,6 @@ func (g *AccountGetBotBusinessConnectionRequest) GetConnectionID() (value string // 400 CONNECTION_ID_INVALID: The specified connection ID is invalid. // // See https://core.telegram.org/method/account.getBotBusinessConnection for reference. -// Can be used by bots. func (c *Client) AccountGetBotBusinessConnection(ctx context.Context, connectionid string) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_account_get_collectible_emoji_statuses_gen.go b/tg/tl_account_get_collectible_emoji_statuses_gen.go index c8f95e1b51..983198f6ec 100644 --- a/tg/tl_account_get_collectible_emoji_statuses_gen.go +++ b/tg/tl_account_get_collectible_emoji_statuses_gen.go @@ -32,10 +32,18 @@ var ( ) // AccountGetCollectibleEmojiStatusesRequest represents TL type `account.getCollectibleEmojiStatuses#2e7b4543`. +// Obtain a list of emoji statuses »¹ for owned collectible gifts². +// +// Links: +// 1. https://core.telegram.org/api/emoji-status +// 2. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/method/account.getCollectibleEmojiStatuses for reference. type AccountGetCollectibleEmojiStatusesRequest struct { - // Hash field of AccountGetCollectibleEmojiStatusesRequest. + // Hash for pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Hash int64 } @@ -161,9 +169,13 @@ func (g *AccountGetCollectibleEmojiStatusesRequest) GetHash() (value int64) { } // AccountGetCollectibleEmojiStatuses invokes method account.getCollectibleEmojiStatuses#2e7b4543 returning error if any. +// Obtain a list of emoji statuses »¹ for owned collectible gifts². +// +// Links: +// 1. https://core.telegram.org/api/emoji-status +// 2. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/method/account.getCollectibleEmojiStatuses for reference. -// Can be used by bots. func (c *Client) AccountGetCollectibleEmojiStatuses(ctx context.Context, hash int64) (AccountEmojiStatusesClass, error) { var result AccountEmojiStatusesBox diff --git a/tg/tl_account_get_connected_bots_gen.go b/tg/tl_account_get_connected_bots_gen.go index 8053d49ccd..7cd3cc4434 100644 --- a/tg/tl_account_get_connected_bots_gen.go +++ b/tg/tl_account_get_connected_bots_gen.go @@ -35,7 +35,7 @@ var ( // List all currently connected business bots »¹ // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/method/account.getConnectedBots for reference. type AccountGetConnectedBotsRequest struct { @@ -135,7 +135,7 @@ func (g *AccountGetConnectedBotsRequest) DecodeBare(b *bin.Buffer) error { // List all currently connected business bots »¹ // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/method/account.getConnectedBots for reference. func (c *Client) AccountGetConnectedBots(ctx context.Context) (*AccountConnectedBots, error) { diff --git a/tg/tl_account_get_paid_messages_revenue_gen.go b/tg/tl_account_get_paid_messages_revenue_gen.go index 864eedd18c..22c54a4475 100644 --- a/tg/tl_account_get_paid_messages_revenue_gen.go +++ b/tg/tl_account_get_paid_messages_revenue_gen.go @@ -32,6 +32,13 @@ var ( ) // AccountGetPaidMessagesRevenueRequest represents TL type `account.getPaidMessagesRevenue#19ba4a67`. +// Get the number of stars we have received from the specified user thanks to paid +// messages »¹; the received amount will be equal to the sent amount multiplied by +// stars_paid_message_commission_permille² divided by 1000. +// +// Links: +// 1. https://core.telegram.org/api/paid-messages +// 2. https://core.telegram.org/api/config#stars-paid-message-commission-permille // // See https://core.telegram.org/method/account.getPaidMessagesRevenue for reference. type AccountGetPaidMessagesRevenueRequest struct { @@ -40,11 +47,15 @@ type AccountGetPaidMessagesRevenueRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ParentPeer field of AccountGetPaidMessagesRevenueRequest. + // If set, can contain the ID of a monoforum (channel direct messages)¹ to obtain the + // number of stars the user has spent to send us direct messages via the channel. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetParentPeer and GetParentPeer helpers. ParentPeer InputPeerClass - // UserID field of AccountGetPaidMessagesRevenueRequest. + // The user that paid to send us messages. UserID InputUserClass } @@ -240,9 +251,20 @@ func (g *AccountGetPaidMessagesRevenueRequest) GetUserID() (value InputUserClass } // AccountGetPaidMessagesRevenue invokes method account.getPaidMessagesRevenue#19ba4a67 returning error if any. +// Get the number of stars we have received from the specified user thanks to paid +// messages »¹; the received amount will be equal to the sent amount multiplied by +// stars_paid_message_commission_permille² divided by 1000. +// +// Links: +// 1. https://core.telegram.org/api/paid-messages +// 2. https://core.telegram.org/api/config#stars-paid-message-commission-permille +// +// Possible errors: +// +// 400 PARENT_PEER_INVALID: The specified parent_peer is invalid. +// 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/account.getPaidMessagesRevenue for reference. -// Can be used by bots. func (c *Client) AccountGetPaidMessagesRevenue(ctx context.Context, request *AccountGetPaidMessagesRevenueRequest) (*AccountPaidMessagesRevenue, error) { var result AccountPaidMessagesRevenue diff --git a/tg/tl_account_get_saved_music_ids_gen.go b/tg/tl_account_get_saved_music_ids_gen.go index cbbf54622b..e540aedbef 100644 --- a/tg/tl_account_get_saved_music_ids_gen.go +++ b/tg/tl_account_get_saved_music_ids_gen.go @@ -32,10 +32,18 @@ var ( ) // AccountGetSavedMusicIDsRequest represents TL type `account.getSavedMusicIds#e09d5faf`. +// Fetch the full list of only the IDs of songs currently added to the profile, see here +// »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#music // // See https://core.telegram.org/method/account.getSavedMusicIds for reference. type AccountGetSavedMusicIDsRequest struct { - // Hash field of AccountGetSavedMusicIDsRequest. + // Hash generated »¹ from the previously returned list of IDs. + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } @@ -161,6 +169,11 @@ func (g *AccountGetSavedMusicIDsRequest) GetHash() (value int64) { } // AccountGetSavedMusicIDs invokes method account.getSavedMusicIds#e09d5faf returning error if any. +// Fetch the full list of only the IDs of songs currently added to the profile, see here +// »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#music // // See https://core.telegram.org/method/account.getSavedMusicIds for reference. func (c *Client) AccountGetSavedMusicIDs(ctx context.Context, hash int64) (AccountSavedMusicIDsClass, error) { diff --git a/tg/tl_account_get_theme_gen.go b/tg/tl_account_get_theme_gen.go index 1ba8b55d11..1a25809120 100644 --- a/tg/tl_account_get_theme_gen.go +++ b/tg/tl_account_get_theme_gen.go @@ -200,6 +200,7 @@ func (g *AccountGetThemeRequest) GetTheme() (value InputThemeClass) { // // 400 THEME_FORMAT_INVALID: Invalid theme format provided. // 400 THEME_INVALID: Invalid theme provided. +// 400 THEME_SLUG_INVALID: The specified theme slug is invalid. // // See https://core.telegram.org/method/account.getTheme for reference. func (c *Client) AccountGetTheme(ctx context.Context, request *AccountGetThemeRequest) (*Theme, error) { diff --git a/tg/tl_account_get_unique_gift_chat_themes_gen.go b/tg/tl_account_get_unique_gift_chat_themes_gen.go index b16cad3ec3..6547efb9da 100644 --- a/tg/tl_account_get_unique_gift_chat_themes_gen.go +++ b/tg/tl_account_get_unique_gift_chat_themes_gen.go @@ -32,14 +32,29 @@ var ( ) // AccountGetUniqueGiftChatThemesRequest represents TL type `account.getUniqueGiftChatThemes#e42ce9c9`. +// Obtain all chat themes »¹ associated to owned collectible gifts »². +// +// Links: +// 1. https://core.telegram.org/api/themes#chat-themes +// 2. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/method/account.getUniqueGiftChatThemes for reference. type AccountGetUniqueGiftChatThemesRequest struct { - // Offset field of AccountGetUniqueGiftChatThemesRequest. + // Offset for pagination¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets Offset string - // Limit field of AccountGetUniqueGiftChatThemesRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int - // Hash field of AccountGetUniqueGiftChatThemesRequest. + // Hash from a previously returned account.chatThemes¹ constructor, to avoid returning + // any result if the theme list hasn't changed. + // + // Links: + // 1) https://core.telegram.org/constructor/account.chatThemes Hash int64 } @@ -215,6 +230,11 @@ func (g *AccountGetUniqueGiftChatThemesRequest) GetHash() (value int64) { } // AccountGetUniqueGiftChatThemes invokes method account.getUniqueGiftChatThemes#e42ce9c9 returning error if any. +// Obtain all chat themes »¹ associated to owned collectible gifts »². +// +// Links: +// 1. https://core.telegram.org/api/themes#chat-themes +// 2. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/method/account.getUniqueGiftChatThemes for reference. func (c *Client) AccountGetUniqueGiftChatThemes(ctx context.Context, request *AccountGetUniqueGiftChatThemesRequest) (AccountChatThemesClass, error) { diff --git a/tg/tl_account_paid_messages_revenue_gen.go b/tg/tl_account_paid_messages_revenue_gen.go index 9155470149..1a23aa4b4b 100644 --- a/tg/tl_account_paid_messages_revenue_gen.go +++ b/tg/tl_account_paid_messages_revenue_gen.go @@ -32,10 +32,19 @@ var ( ) // AccountPaidMessagesRevenue represents TL type `account.paidMessagesRevenue#1e109708`. +// Total number of non-refunded Telegram Stars¹ a user has spent on sending us messages +// either directly or through a channel, see here »² for more info on paid messages. +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/api/paid-messages // // See https://core.telegram.org/constructor/account.paidMessagesRevenue for reference. type AccountPaidMessagesRevenue struct { - // StarsAmount field of AccountPaidMessagesRevenue. + // Amount in Stars¹. + // + // Links: + // 1) https://core.telegram.org/api/stars StarsAmount int64 } diff --git a/tg/tl_account_save_music_gen.go b/tg/tl_account_save_music_gen.go index 76bad42683..ad5429e796 100644 --- a/tg/tl_account_save_music_gen.go +++ b/tg/tl_account_save_music_gen.go @@ -32,16 +32,27 @@ var ( ) // AccountSaveMusicRequest represents TL type `account.saveMusic#b26732a9`. +// Adds or removes a song from the current user's profile see here »¹ for more info on +// the music tab of the profile page. +// +// Links: +// 1. https://core.telegram.org/api/profile#music // // See https://core.telegram.org/method/account.saveMusic for reference. type AccountSaveMusicRequest struct { - // Flags field of AccountSaveMusicRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Unsave field of AccountSaveMusicRequest. + // If set, removes the song. Unsave bool - // ID field of AccountSaveMusicRequest. + // The song to add or remove; can be an already added song when reordering songs with + // after_id. Adding an already added song will never re-add it, only move it to the top + // of the song list (or after the song passed in after_id). ID InputDocumentClass - // AfterID field of AccountSaveMusicRequest. + // If set, the song will be added after the passed song (must be already pinned on the + // profile). // // Use SetAfterID and GetAfterID helpers. AfterID InputDocumentClass @@ -286,6 +297,15 @@ func (s *AccountSaveMusicRequest) GetAfterIDAsNotEmpty() (*InputDocument, bool) } // AccountSaveMusic invokes method account.saveMusic#b26732a9 returning error if any. +// Adds or removes a song from the current user's profile see here »¹ for more info on +// the music tab of the profile page. +// +// Links: +// 1. https://core.telegram.org/api/profile#music +// +// Possible errors: +// +// 400 DOCUMENT_INVALID: The specified document is invalid. // // See https://core.telegram.org/method/account.saveMusic for reference. func (c *Client) AccountSaveMusic(ctx context.Context, request *AccountSaveMusicRequest) (bool, error) { diff --git a/tg/tl_account_saved_music_ids_gen.go b/tg/tl_account_saved_music_ids_gen.go index 553157280e..eb80d99458 100644 --- a/tg/tl_account_saved_music_ids_gen.go +++ b/tg/tl_account_saved_music_ids_gen.go @@ -32,6 +32,11 @@ var ( ) // AccountSavedMusicIDsNotModified represents TL type `account.savedMusicIdsNotModified#4fc81d6e`. +// The list of IDs of songs (document¹.ids) currently pinned on our profile hasn't +// changed. +// +// Links: +// 1. https://core.telegram.org/constructor/document // // See https://core.telegram.org/constructor/account.savedMusicIdsNotModified for reference. type AccountSavedMusicIDsNotModified struct { @@ -133,10 +138,19 @@ func (s *AccountSavedMusicIDsNotModified) DecodeBare(b *bin.Buffer) error { } // AccountSavedMusicIDs represents TL type `account.savedMusicIds#998d6636`. +// List of IDs of songs (document¹.ids) currently pinned on our profile, see here »² +// for more info. +// +// Links: +// 1. https://core.telegram.org/constructor/document +// 2. https://core.telegram.org/api/profile#music // // See https://core.telegram.org/constructor/account.savedMusicIds for reference. type AccountSavedMusicIDs struct { - // IDs field of AccountSavedMusicIDs. + // Full list of document¹.ids + // + // Links: + // 1) https://core.telegram.org/constructor/document IDs []int64 } diff --git a/tg/tl_account_set_global_privacy_settings_gen.go b/tg/tl_account_set_global_privacy_settings_gen.go index 7305c46f8f..5b9a01f6a9 100644 --- a/tg/tl_account_set_global_privacy_settings_gen.go +++ b/tg/tl_account_set_global_privacy_settings_gen.go @@ -167,6 +167,8 @@ func (s *AccountSetGlobalPrivacySettingsRequest) GetSettings() (value GlobalPriv // Possible errors: // // 400 AUTOARCHIVE_NOT_AVAILABLE: The autoarchive setting is not available at this time: please check the value of the autoarchive_setting_available field in client config » before calling this method. +// 403 BOT_ACCESS_FORBIDDEN: The specified method can be used over a business connection for some operations, but the specified query attempted an operation that is not allowed over a business connection. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/account.setGlobalPrivacySettings for reference. diff --git a/tg/tl_account_set_main_profile_tab_gen.go b/tg/tl_account_set_main_profile_tab_gen.go index 783592b1e5..78d8cbc632 100644 --- a/tg/tl_account_set_main_profile_tab_gen.go +++ b/tg/tl_account_set_main_profile_tab_gen.go @@ -32,10 +32,14 @@ var ( ) // AccountSetMainProfileTabRequest represents TL type `account.setMainProfileTab#5dee78b0`. +// Changes the main profile tab of the current user, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#tabs // // See https://core.telegram.org/method/account.setMainProfileTab for reference. type AccountSetMainProfileTabRequest struct { - // Tab field of AccountSetMainProfileTabRequest. + // The tab to set as main tab. Tab ProfileTabClass } @@ -166,6 +170,10 @@ func (s *AccountSetMainProfileTabRequest) GetTab() (value ProfileTabClass) { } // AccountSetMainProfileTab invokes method account.setMainProfileTab#5dee78b0 returning error if any. +// Changes the main profile tab of the current user, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#tabs // // See https://core.telegram.org/method/account.setMainProfileTab for reference. func (c *Client) AccountSetMainProfileTab(ctx context.Context, tab ProfileTabClass) (bool, error) { diff --git a/tg/tl_account_toggle_connected_bot_paused_gen.go b/tg/tl_account_toggle_connected_bot_paused_gen.go index 32464665c0..6a136e53eb 100644 --- a/tg/tl_account_toggle_connected_bot_paused_gen.go +++ b/tg/tl_account_toggle_connected_bot_paused_gen.go @@ -36,7 +36,7 @@ var ( // »¹. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/method/account.toggleConnectedBotPaused for reference. type AccountToggleConnectedBotPausedRequest struct { @@ -202,7 +202,7 @@ func (t *AccountToggleConnectedBotPausedRequest) GetPaused() (value bool) { // »¹. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // Possible errors: // diff --git a/tg/tl_account_toggle_no_paid_messages_exception_gen.go b/tg/tl_account_toggle_no_paid_messages_exception_gen.go index 7cf6b7240a..ad69ec1f0a 100644 --- a/tg/tl_account_toggle_no_paid_messages_exception_gen.go +++ b/tg/tl_account_toggle_no_paid_messages_exception_gen.go @@ -32,6 +32,10 @@ var ( ) // AccountToggleNoPaidMessagesExceptionRequest represents TL type `account.toggleNoPaidMessagesException#fe2eda76`. +// Allow a user to send us messages without paying if paid messages »¹ are enabled. +// +// Links: +// 1. https://core.telegram.org/api/paid-messages // // See https://core.telegram.org/method/account.toggleNoPaidMessagesException for reference. type AccountToggleNoPaidMessagesExceptionRequest struct { @@ -40,15 +44,27 @@ type AccountToggleNoPaidMessagesExceptionRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // RefundCharged field of AccountToggleNoPaidMessagesExceptionRequest. + // If set and require_payment is not set, refunds the amounts the user has already paid + // us to send us messages (directly or via a monoforum). RefundCharged bool - // RequirePayment field of AccountToggleNoPaidMessagesExceptionRequest. + // If set, requires the user to pay in order to send us messages. Can only be set by + // monoforums, not users, i.e. parent_peer must be set if this flag is set; users must + // instead use the inputPrivacyKeyNoPaidMessages¹ privacy setting to remove a previously + // added exemption. If not set, allows the user to send us messages without paying (can + // be unset by both monoforums and users). + // + // Links: + // 1) https://core.telegram.org/constructor/inputPrivacyKeyNoPaidMessages RequirePayment bool - // ParentPeer field of AccountToggleNoPaidMessagesExceptionRequest. + // If set, applies the setting within the monoforum aka direct messages »¹ (pass the ID + // of the monoforum, not the ID of the associated channel). + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetParentPeer and GetParentPeer helpers. ParentPeer InputPeerClass - // UserID field of AccountToggleNoPaidMessagesExceptionRequest. + // The user to exempt or unexempt. UserID InputUserClass } @@ -310,9 +326,18 @@ func (t *AccountToggleNoPaidMessagesExceptionRequest) GetUserID() (value InputUs } // AccountToggleNoPaidMessagesException invokes method account.toggleNoPaidMessagesException#fe2eda76 returning error if any. +// Allow a user to send us messages without paying if paid messages »¹ are enabled. +// +// Links: +// 1. https://core.telegram.org/api/paid-messages +// +// Possible errors: +// +// 400 PARENT_PEER_INVALID: The specified parent_peer is invalid. +// 400 UNSUPPORTED: require_payment cannot be set by users, only by monoforums: users must instead use the inputPrivacyKeyNoPaidMessages privacy setting to remove a previously added exemption. +// 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/account.toggleNoPaidMessagesException for reference. -// Can be used by bots. func (c *Client) AccountToggleNoPaidMessagesException(ctx context.Context, request *AccountToggleNoPaidMessagesExceptionRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_account_update_color_gen.go b/tg/tl_account_update_color_gen.go index 8a552871cc..926bcdb8fa 100644 --- a/tg/tl_account_update_color_gen.go +++ b/tg/tl_account_update_color_gen.go @@ -260,6 +260,7 @@ func (u *AccountUpdateColorRequest) GetColor() (value PeerColorClass, ok bool) { // Possible errors: // // 400 COLOR_INVALID: The specified color palette ID was invalid. +// 400 DOCUMENT_INVALID: The specified document is invalid. // 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // // See https://core.telegram.org/method/account.updateColor for reference. diff --git a/tg/tl_account_update_connected_bot_gen.go b/tg/tl_account_update_connected_bot_gen.go index b62fb75b9c..3fedeb24df 100644 --- a/tg/tl_account_update_connected_bot_gen.go +++ b/tg/tl_account_update_connected_bot_gen.go @@ -36,7 +36,7 @@ var ( // connection settings. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/method/account.updateConnectedBot for reference. type AccountUpdateConnectedBotRequest struct { @@ -47,7 +47,7 @@ type AccountUpdateConnectedBotRequest struct { Flags bin.Fields // Whether to fully disconnect the bot from the current account. Deleted bool - // Rights field of AccountUpdateConnectedBotRequest. + // Business bot rights. // // Use SetRights and GetRights helpers. Rights BusinessBotRights @@ -306,7 +306,7 @@ func (u *AccountUpdateConnectedBotRequest) GetRecipients() (value InputBusinessB // connection settings. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // Possible errors: // diff --git a/tg/tl_account_update_emoji_status_gen.go b/tg/tl_account_update_emoji_status_gen.go index 425b106b04..3f291b9176 100644 --- a/tg/tl_account_update_emoji_status_gen.go +++ b/tg/tl_account_update_emoji_status_gen.go @@ -185,6 +185,7 @@ func (u *AccountUpdateEmojiStatusRequest) GetEmojiStatusAsNotEmpty() (NotEmptyEm // // Possible errors: // +// 400 COLLECTIBLE_INVALID: The specified collectible is invalid. // 400 DOCUMENT_INVALID: The specified document is invalid. // // See https://core.telegram.org/method/account.updateEmojiStatus for reference. diff --git a/tg/tl_account_update_profile_gen.go b/tg/tl_account_update_profile_gen.go index bc7968e19d..db3da749d5 100644 --- a/tg/tl_account_update_profile_gen.go +++ b/tg/tl_account_update_profile_gen.go @@ -305,6 +305,7 @@ func (u *AccountUpdateProfileRequest) GetAbout() (value string, ok bool) { // Possible errors: // // 400 ABOUT_TOO_LONG: About string too long. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 FIRSTNAME_INVALID: The first name is invalid. // // See https://core.telegram.org/method/account.updateProfile for reference. diff --git a/tg/tl_auth_authorization_gen.go b/tg/tl_auth_authorization_gen.go index e6ba4754da..cb875281ee 100644 --- a/tg/tl_auth_authorization_gen.go +++ b/tg/tl_auth_authorization_gen.go @@ -43,9 +43,9 @@ type AuthAuthorization struct { Flags bin.Fields // Suggests the user to set up a 2-step verification password to be able to log in again SetupPasswordRequired bool - // Iff setup_password_required is set and the user declines to set a 2-step verification - // password, they will be able to log into their account via SMS again only after this - // many days pass. + // If and only if setup_password_required is set and the user declines to set a 2-step + // verification password, they will be able to log into their account via SMS again only + // after this many days pass. // // Use SetOtherwiseReloginDays and GetOtherwiseReloginDays helpers. OtherwiseReloginDays int diff --git a/tg/tl_auth_bind_temp_auth_key_gen.go b/tg/tl_auth_bind_temp_auth_key_gen.go index 8858b07fd7..99392fb915 100644 --- a/tg/tl_auth_bind_temp_auth_key_gen.go +++ b/tg/tl_auth_bind_temp_auth_key_gen.go @@ -269,11 +269,11 @@ func (b *AuthBindTempAuthKeyRequest) GetEncryptedMessage() (value []byte) { // Possible errors: // // 400 ENCRYPTED_MESSAGE_INVALID: Encrypted message invalid. +// 400 EXPIRES_AT_INVALID: The specified expires_at timestamp is invalid. // 400 TEMP_AUTH_KEY_ALREADY_BOUND: The passed temporary key is already bound to another perm_auth_key_id. // 400 TEMP_AUTH_KEY_EMPTY: No temporary auth key provided. // // See https://core.telegram.org/method/auth.bindTempAuthKey for reference. -// Can be used by bots. func (c *Client) AuthBindTempAuthKey(ctx context.Context, request *AuthBindTempAuthKeyRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_auth_drop_temp_auth_keys_gen.go b/tg/tl_auth_drop_temp_auth_keys_gen.go index 183d74d837..eca17039ec 100644 --- a/tg/tl_auth_drop_temp_auth_keys_gen.go +++ b/tg/tl_auth_drop_temp_auth_keys_gen.go @@ -178,7 +178,6 @@ func (d *AuthDropTempAuthKeysRequest) GetExceptAuthKeys() (value []int64) { // Delete all temporary authorization keys except for the ones specified // // See https://core.telegram.org/method/auth.dropTempAuthKeys for reference. -// Can be used by bots. func (c *Client) AuthDropTempAuthKeys(ctx context.Context, exceptauthkeys []int64) (bool, error) { var result BoolBox diff --git a/tg/tl_auth_export_authorization_gen.go b/tg/tl_auth_export_authorization_gen.go index 64a0bb1a3a..9a0e722809 100644 --- a/tg/tl_auth_export_authorization_gen.go +++ b/tg/tl_auth_export_authorization_gen.go @@ -169,7 +169,6 @@ func (e *AuthExportAuthorizationRequest) GetDCID() (value int) { // 400 DC_ID_INVALID: The provided DC ID is invalid. // // See https://core.telegram.org/method/auth.exportAuthorization for reference. -// Can be used by bots. func (c *Client) AuthExportAuthorization(ctx context.Context, dcid int) (*AuthExportedAuthorization, error) { var result AuthExportedAuthorization diff --git a/tg/tl_auth_import_authorization_gen.go b/tg/tl_auth_import_authorization_gen.go index b5861f8387..310b061467 100644 --- a/tg/tl_auth_import_authorization_gen.go +++ b/tg/tl_auth_import_authorization_gen.go @@ -197,7 +197,6 @@ func (i *AuthImportAuthorizationRequest) GetBytes() (value []byte) { // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/auth.importAuthorization for reference. -// Can be used by bots. func (c *Client) AuthImportAuthorization(ctx context.Context, request *AuthImportAuthorizationRequest) (AuthAuthorizationClass, error) { var result AuthAuthorizationBox diff --git a/tg/tl_auth_import_bot_authorization_gen.go b/tg/tl_auth_import_bot_authorization_gen.go index d04ba3f1ef..7e75bb29a6 100644 --- a/tg/tl_auth_import_bot_authorization_gen.go +++ b/tg/tl_auth_import_bot_authorization_gen.go @@ -262,7 +262,6 @@ func (i *AuthImportBotAuthorizationRequest) GetBotAuthToken() (value string) { // 400 API_ID_PUBLISHED_FLOOD: This API id was published somewhere, you can't use it now. // // See https://core.telegram.org/method/auth.importBotAuthorization for reference. -// Can be used by bots. func (c *Client) AuthImportBotAuthorization(ctx context.Context, request *AuthImportBotAuthorizationRequest) (AuthAuthorizationClass, error) { var result AuthAuthorizationBox diff --git a/tg/tl_auth_log_out_gen.go b/tg/tl_auth_log_out_gen.go index 6c6f49a30a..32fe9760ff 100644 --- a/tg/tl_auth_log_out_gen.go +++ b/tg/tl_auth_log_out_gen.go @@ -132,7 +132,6 @@ func (l *AuthLogOutRequest) DecodeBare(b *bin.Buffer) error { // Logs out the user. // // See https://core.telegram.org/method/auth.logOut for reference. -// Can be used by bots. func (c *Client) AuthLogOut(ctx context.Context) (*AuthLoggedOut, error) { var result AuthLoggedOut diff --git a/tg/tl_auth_sent_code_gen.go b/tg/tl_auth_sent_code_gen.go index d486d60d49..0d84e11c5d 100644 --- a/tg/tl_auth_sent_code_gen.go +++ b/tg/tl_auth_sent_code_gen.go @@ -471,16 +471,25 @@ func (s *AuthSentCodeSuccess) GetAuthorization() (value AuthAuthorizationClass) } // AuthSentCodePaymentRequired represents TL type `auth.sentCodePaymentRequired#e0955a3c`. +// Official apps may receive this constructor, indicating that due to the high cost of +// SMS verification codes for the user's country/provider, the user must purchase a +// Telegram Premium¹ subscription in order to proceed with the login/signup. +// +// Links: +// 1. https://core.telegram.org/api/premium // // See https://core.telegram.org/constructor/auth.sentCodePaymentRequired for reference. type AuthSentCodePaymentRequired struct { - // StoreProduct field of AuthSentCodePaymentRequired. + // Store identifier of the Telegram Premium subscription. StoreProduct string - // PhoneCodeHash field of AuthSentCodePaymentRequired. + // Phone code hash, to be stored and later re-used with auth.signIn¹ + // + // Links: + // 1) https://core.telegram.org/method/auth.signIn PhoneCodeHash string - // SupportEmailAddress field of AuthSentCodePaymentRequired. + // An email address that can be contacted for more information about this request. SupportEmailAddress string - // SupportEmailSubject field of AuthSentCodePaymentRequired. + // The mandatory subject for the email. SupportEmailSubject string // Currency field of AuthSentCodePaymentRequired. Currency string diff --git a/tg/tl_bot_business_connection_gen.go b/tg/tl_bot_business_connection_gen.go index e55d554a9e..75051ea40c 100644 --- a/tg/tl_bot_business_connection_gen.go +++ b/tg/tl_bot_business_connection_gen.go @@ -35,7 +35,7 @@ var ( // Contains info about a bot business connection¹. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/constructor/botBusinessConnection for reference. type BotBusinessConnection struct { @@ -50,7 +50,7 @@ type BotBusinessConnection struct { // reply to them as specified here »¹. // // Links: - // 1) https://core.telegram.org/api/business#connected-bots + // 1) https://core.telegram.org/api/bots/connected-business-bots ConnectionID string // ID of the user that the bot is connected to via this connection. UserID int64 @@ -59,11 +59,11 @@ type BotBusinessConnection struct { // // Links: // 1) https://core.telegram.org/method/invokeWithBusinessConnection - // 2) https://core.telegram.org/api/business#connected-bots + // 2) https://core.telegram.org/api/bots/connected-business-bots DCID int // When was the connection created. Date int - // Rights field of BotBusinessConnection. + // Business bot rights. // // Use SetRights and GetRights helpers. Rights BusinessBotRights diff --git a/tg/tl_bot_info_gen.go b/tg/tl_bot_info_gen.go index ac8b66702b..29872919cc 100644 --- a/tg/tl_bot_info_gen.go +++ b/tg/tl_bot_info_gen.go @@ -87,7 +87,11 @@ type BotInfo struct { // // Use SetAppSettings and GetAppSettings helpers. AppSettings BotAppSettings - // VerifierSettings field of BotInfo. + // This bot can verify peers¹: this field contains more info about the verification the + // bot can assign to peers. + // + // Links: + // 1) https://core.telegram.org/api/bots/verification // // Use SetVerifierSettings and GetVerifierSettings helpers. VerifierSettings BotVerifierSettings diff --git a/tg/tl_bot_verification_gen.go b/tg/tl_bot_verification_gen.go index 06cdc7882d..55f4b4ccd0 100644 --- a/tg/tl_bot_verification_gen.go +++ b/tg/tl_bot_verification_gen.go @@ -32,14 +32,18 @@ var ( ) // BotVerification represents TL type `botVerification#f93cd45c`. +// Describes a bot verification icon »¹. +// +// Links: +// 1. https://core.telegram.org/api/bots/verification // // See https://core.telegram.org/constructor/botVerification for reference. type BotVerification struct { - // BotID field of BotVerification. + // ID of the bot that verified this peer BotID int64 - // Icon field of BotVerification. + // Verification icon Icon int64 - // Description field of BotVerification. + // Verification description Description string } diff --git a/tg/tl_bot_verifier_settings_gen.go b/tg/tl_bot_verifier_settings_gen.go index 7a0f5537d5..edbbdd4ab4 100644 --- a/tg/tl_bot_verifier_settings_gen.go +++ b/tg/tl_bot_verifier_settings_gen.go @@ -32,6 +32,10 @@ var ( ) // BotVerifierSettings represents TL type `botVerifierSettings#b0cd6617`. +// Info about the current verifier bot »¹. +// +// Links: +// 1. https://core.telegram.org/api/bots/verification // // See https://core.telegram.org/constructor/botVerifierSettings for reference. type BotVerifierSettings struct { @@ -40,13 +44,14 @@ type BotVerifierSettings struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // CanModifyCustomDescription field of BotVerifierSettings. + // Indicates whether the bot is allowed to set a custom description field for individual + // verified peers, different from the custom_description provided here. CanModifyCustomDescription bool - // Icon field of BotVerifierSettings. + // Verification icon Icon int64 - // Company field of BotVerifierSettings. + // The name of the organization that provides the verification Company string - // CustomDescription field of BotVerifierSettings. + // An optional default description for the verification // // Use SetCustomDescription and GetCustomDescription helpers. CustomDescription string diff --git a/tg/tl_bots_answer_webhook_json_query_gen.go b/tg/tl_bots_answer_webhook_json_query_gen.go index 08ea73b26e..c6f520ea18 100644 --- a/tg/tl_bots_answer_webhook_json_query_gen.go +++ b/tg/tl_bots_answer_webhook_json_query_gen.go @@ -195,11 +195,9 @@ func (a *BotsAnswerWebhookJSONQueryRequest) GetData() (value DataJSON) { // // 400 DATA_JSON_INVALID: The provided JSON data is invalid. // 400 QUERY_ID_INVALID: The query ID is invalid. -// 403 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.answerWebhookJSONQuery for reference. -// Can be used by bots. func (c *Client) BotsAnswerWebhookJSONQuery(ctx context.Context, request *BotsAnswerWebhookJSONQueryRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_bots_get_bot_commands_gen.go b/tg/tl_bots_get_bot_commands_gen.go index c6064a615b..aca19378e9 100644 --- a/tg/tl_bots_get_bot_commands_gen.go +++ b/tg/tl_bots_get_bot_commands_gen.go @@ -198,11 +198,9 @@ func (g *BotsGetBotCommandsRequest) GetLangCode() (value string) { // // Possible errors: // -// 400 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.getBotCommands for reference. -// Can be used by bots. func (c *Client) BotsGetBotCommands(ctx context.Context, request *BotsGetBotCommandsRequest) ([]BotCommand, error) { var result BotCommandVector diff --git a/tg/tl_bots_get_bot_info_gen.go b/tg/tl_bots_get_bot_info_gen.go index bf848d61ce..65011c45a9 100644 --- a/tg/tl_bots_get_bot_info_gen.go +++ b/tg/tl_bots_get_bot_info_gen.go @@ -248,7 +248,6 @@ func (g *BotsGetBotInfoRequest) GetLangCode() (value string) { // 400 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. // // See https://core.telegram.org/method/bots.getBotInfo for reference. -// Can be used by bots. func (c *Client) BotsGetBotInfo(ctx context.Context, request *BotsGetBotInfoRequest) (*BotsBotInfo, error) { var result BotsBotInfo diff --git a/tg/tl_bots_get_bot_menu_button_gen.go b/tg/tl_bots_get_bot_menu_button_gen.go index 66be294d85..14a1820a18 100644 --- a/tg/tl_bots_get_bot_menu_button_gen.go +++ b/tg/tl_bots_get_bot_menu_button_gen.go @@ -184,7 +184,6 @@ func (g *BotsGetBotMenuButtonRequest) GetUserID() (value InputUserClass) { // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.getBotMenuButton for reference. -// Can be used by bots. func (c *Client) BotsGetBotMenuButton(ctx context.Context, userid InputUserClass) (BotMenuButtonClass, error) { var result BotMenuButtonBox diff --git a/tg/tl_bots_get_bot_recommendations_gen.go b/tg/tl_bots_get_bot_recommendations_gen.go index 7550bd4b62..52bc7d4ca8 100644 --- a/tg/tl_bots_get_bot_recommendations_gen.go +++ b/tg/tl_bots_get_bot_recommendations_gen.go @@ -32,10 +32,15 @@ var ( ) // BotsGetBotRecommendationsRequest represents TL type `bots.getBotRecommendations#a1b70815`. +// Obtain a list of similarly themed bots, selected based on similarities in their +// subscriber bases, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/recommend // // See https://core.telegram.org/method/bots.getBotRecommendations for reference. type BotsGetBotRecommendationsRequest struct { - // Bot field of BotsGetBotRecommendationsRequest. + // The method will return bots related to the passed bot. Bot InputUserClass } @@ -166,6 +171,11 @@ func (g *BotsGetBotRecommendationsRequest) GetBot() (value InputUserClass) { } // BotsGetBotRecommendations invokes method bots.getBotRecommendations#a1b70815 returning error if any. +// Obtain a list of similarly themed bots, selected based on similarities in their +// subscriber bases, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/recommend // // Possible errors: // diff --git a/tg/tl_bots_reset_bot_commands_gen.go b/tg/tl_bots_reset_bot_commands_gen.go index 07cec2fe59..e57f5177bc 100644 --- a/tg/tl_bots_reset_bot_commands_gen.go +++ b/tg/tl_bots_reset_bot_commands_gen.go @@ -202,7 +202,6 @@ func (r *BotsResetBotCommandsRequest) GetLangCode() (value string) { // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.resetBotCommands for reference. -// Can be used by bots. func (c *Client) BotsResetBotCommands(ctx context.Context, request *BotsResetBotCommandsRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_bots_send_custom_request_gen.go b/tg/tl_bots_send_custom_request_gen.go index 55c78d04f1..cc0ce6b379 100644 --- a/tg/tl_bots_send_custom_request_gen.go +++ b/tg/tl_bots_send_custom_request_gen.go @@ -195,11 +195,9 @@ func (s *BotsSendCustomRequestRequest) GetParams() (value DataJSON) { // // 400 DATA_JSON_INVALID: The provided JSON data is invalid. // 400 METHOD_INVALID: The specified method is invalid. -// 403 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.sendCustomRequest for reference. -// Can be used by bots. func (c *Client) BotsSendCustomRequest(ctx context.Context, request *BotsSendCustomRequestRequest) (*DataJSON, error) { var result DataJSON diff --git a/tg/tl_bots_set_bot_broadcast_default_admin_rights_gen.go b/tg/tl_bots_set_bot_broadcast_default_admin_rights_gen.go index 1dcf7a354f..fa50752cd8 100644 --- a/tg/tl_bots_set_bot_broadcast_default_admin_rights_gen.go +++ b/tg/tl_bots_set_bot_broadcast_default_admin_rights_gen.go @@ -180,7 +180,6 @@ func (s *BotsSetBotBroadcastDefaultAdminRightsRequest) GetAdminRights() (value C // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.setBotBroadcastDefaultAdminRights for reference. -// Can be used by bots. func (c *Client) BotsSetBotBroadcastDefaultAdminRights(ctx context.Context, adminrights ChatAdminRights) (bool, error) { var result BoolBox diff --git a/tg/tl_bots_set_bot_commands_gen.go b/tg/tl_bots_set_bot_commands_gen.go index e125cf0971..dca670bc62 100644 --- a/tg/tl_bots_set_bot_commands_gen.go +++ b/tg/tl_bots_set_bot_commands_gen.go @@ -248,7 +248,6 @@ func (s *BotsSetBotCommandsRequest) GetCommands() (value []BotCommand) { // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/bots.setBotCommands for reference. -// Can be used by bots. func (c *Client) BotsSetBotCommands(ctx context.Context, request *BotsSetBotCommandsRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_bots_set_bot_group_default_admin_rights_gen.go b/tg/tl_bots_set_bot_group_default_admin_rights_gen.go index 30a6f5d7a3..61c26596f8 100644 --- a/tg/tl_bots_set_bot_group_default_admin_rights_gen.go +++ b/tg/tl_bots_set_bot_group_default_admin_rights_gen.go @@ -180,7 +180,6 @@ func (s *BotsSetBotGroupDefaultAdminRightsRequest) GetAdminRights() (value ChatA // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.setBotGroupDefaultAdminRights for reference. -// Can be used by bots. func (c *Client) BotsSetBotGroupDefaultAdminRights(ctx context.Context, adminrights ChatAdminRights) (bool, error) { var result BoolBox diff --git a/tg/tl_bots_set_bot_info_gen.go b/tg/tl_bots_set_bot_info_gen.go index c1b6f63c0a..612ca14d16 100644 --- a/tg/tl_bots_set_bot_info_gen.go +++ b/tg/tl_bots_set_bot_info_gen.go @@ -390,7 +390,6 @@ func (s *BotsSetBotInfoRequest) GetDescription() (value string, ok bool) { // 400 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. // // See https://core.telegram.org/method/bots.setBotInfo for reference. -// Can be used by bots. func (c *Client) BotsSetBotInfo(ctx context.Context, request *BotsSetBotInfoRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_bots_set_bot_menu_button_gen.go b/tg/tl_bots_set_bot_menu_button_gen.go index 283e03483f..cef0c15931 100644 --- a/tg/tl_bots_set_bot_menu_button_gen.go +++ b/tg/tl_bots_set_bot_menu_button_gen.go @@ -209,12 +209,12 @@ func (s *BotsSetBotMenuButtonRequest) GetButton() (value BotMenuButtonClass) { // // Possible errors: // +// 400 BUTTON_INVALID: The specified button is invalid. // 400 BUTTON_TEXT_INVALID: The specified button text is invalid. // 400 BUTTON_URL_INVALID: Button URL invalid. // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/bots.setBotMenuButton for reference. -// Can be used by bots. func (c *Client) BotsSetBotMenuButton(ctx context.Context, request *BotsSetBotMenuButtonRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_bots_set_custom_verification_gen.go b/tg/tl_bots_set_custom_verification_gen.go index de4e618eee..f992c3e614 100644 --- a/tg/tl_bots_set_custom_verification_gen.go +++ b/tg/tl_bots_set_custom_verification_gen.go @@ -32,6 +32,10 @@ var ( ) // BotsSetCustomVerificationRequest represents TL type `bots.setCustomVerification#8b89dfbd`. +// Verify a user or chat on behalf of an organization »¹. +// +// Links: +// 1. https://core.telegram.org/api/bots/verification // // See https://core.telegram.org/method/bots.setCustomVerification for reference. type BotsSetCustomVerificationRequest struct { @@ -40,15 +44,21 @@ type BotsSetCustomVerificationRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Enabled field of BotsSetCustomVerificationRequest. + // If set, adds the verification; otherwise removes verification. Enabled bool - // Bot field of BotsSetCustomVerificationRequest. + // Must not be set if invoked by a bot, must be set to the ID of an owned bot if invoked + // by a user. // // Use SetBot and GetBot helpers. Bot InputUserClass - // Peer field of BotsSetCustomVerificationRequest. + // The peer to verify Peer InputPeerClass - // CustomDescription field of BotsSetCustomVerificationRequest. + // Custom description for the verification, the UTF-8 length limit for this field is + // contained in bot_verification_description_length_limit »¹. If not set, Was verified + // by organization "organization_name" will be used as description. + // + // Links: + // 1) https://core.telegram.org/api/config#bot-verification-description-length-limit // // Use SetCustomDescription and GetCustomDescription helpers. CustomDescription string @@ -323,14 +333,18 @@ func (s *BotsSetCustomVerificationRequest) GetCustomDescription() (value string, } // BotsSetCustomVerification invokes method bots.setCustomVerification#8b89dfbd returning error if any. +// Verify a user or chat on behalf of an organization »¹. +// +// Links: +// 1. https://core.telegram.org/api/bots/verification // // Possible errors: // // 400 BOT_INVALID: This is not a valid bot. +// 403 BOT_VERIFIER_FORBIDDEN: This bot cannot assign verification icons. // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/bots.setCustomVerification for reference. -// Can be used by bots. func (c *Client) BotsSetCustomVerification(ctx context.Context, request *BotsSetCustomVerificationRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_bots_update_user_emoji_status_gen.go b/tg/tl_bots_update_user_emoji_status_gen.go index 6992925daf..30c2cbb8a2 100644 --- a/tg/tl_bots_update_user_emoji_status_gen.go +++ b/tg/tl_bots_update_user_emoji_status_gen.go @@ -218,9 +218,9 @@ func (u *BotsUpdateUserEmojiStatusRequest) GetEmojiStatusAsNotEmpty() (NotEmptyE // // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // 400 USER_ID_INVALID: The provided user ID is invalid. +// 403 USER_PERMISSION_DENIED: The user hasn't granted or has revoked the bot's access to change their emoji status using bots.toggleUserEmojiStatusPermission. // // See https://core.telegram.org/method/bots.updateUserEmojiStatus for reference. -// Can be used by bots. func (c *Client) BotsUpdateUserEmojiStatus(ctx context.Context, request *BotsUpdateUserEmojiStatusRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_business_bot_recipients_gen.go b/tg/tl_business_bot_recipients_gen.go index e4fa891752..1c45f78eff 100644 --- a/tg/tl_business_bot_recipients_gen.go +++ b/tg/tl_business_bot_recipients_gen.go @@ -36,7 +36,7 @@ var ( // and interact with. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/constructor/businessBotRecipients for reference. type BusinessBotRecipients struct { diff --git a/tg/tl_business_bot_rights_gen.go b/tg/tl_business_bot_rights_gen.go index d9d422bde0..285e19058b 100644 --- a/tg/tl_business_bot_rights_gen.go +++ b/tg/tl_business_bot_rights_gen.go @@ -32,6 +32,10 @@ var ( ) // BusinessBotRights represents TL type `businessBotRights#a0624cf7`. +// Business bot rights¹. +// +// Links: +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/constructor/businessBotRights for reference. type BusinessBotRights struct { @@ -40,33 +44,38 @@ type BusinessBotRights struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Reply field of BusinessBotRights. + // Whether the bot can send and edit messages in private chats that had incoming messages + // in the last 24 hours. Reply bool - // ReadMessages field of BusinessBotRights. + // Whether the bot can mark incoming private messages as read. ReadMessages bool - // DeleteSentMessages field of BusinessBotRights. + // Whether the bot can delete messages sent by the bot. DeleteSentMessages bool - // DeleteReceivedMessages field of BusinessBotRights. + // Whether the bot can delete received private messages in managed chats. DeleteReceivedMessages bool - // EditName field of BusinessBotRights. + // Whether the bot can edit the first and last name of the business account. EditName bool - // EditBio field of BusinessBotRights. + // Whether the bot can edit the bio of the business account. EditBio bool - // EditProfilePhoto field of BusinessBotRights. + // Whether the bot can edit the profile photo of the business account. EditProfilePhoto bool - // EditUsername field of BusinessBotRights. + // Whether the bot can edit the username of the business account. EditUsername bool - // ViewGifts field of BusinessBotRights. + // Whether the bot can view gifts and the amount of Telegram Stars owned by the business + // account. ViewGifts bool - // SellGifts field of BusinessBotRights. + // Whether the bot can convert regular gifts owned by the business account to Telegram + // Stars. SellGifts bool - // ChangeGiftSettings field of BusinessBotRights. + // Whether the bot can change the privacy settings pertaining to gifts for the business + // account. ChangeGiftSettings bool - // TransferAndUpgradeGifts field of BusinessBotRights. + // Whether the bot can transfer and upgrade gifts owned by the business account. TransferAndUpgradeGifts bool - // TransferStars field of BusinessBotRights. + // Whether the bot can transfer Telegram Stars received by the business account to its + // own account, or use them to upgrade and transfer gifts. TransferStars bool - // ManageStories field of BusinessBotRights. + // Whether the bot can post, edit and delete stories on behalf of the business account. ManageStories bool } diff --git a/tg/tl_channel_admin_log_event_action_gen.go b/tg/tl_channel_admin_log_event_action_gen.go index 910d4e322e..030b0bfe4b 100644 --- a/tg/tl_channel_admin_log_event_action_gen.go +++ b/tg/tl_channel_admin_log_event_action_gen.go @@ -7917,10 +7917,14 @@ func (c *ChannelAdminLogEventActionParticipantSubExtend) GetNewParticipant() (va } // ChannelAdminLogEventActionToggleAutotranslation represents TL type `channelAdminLogEventActionToggleAutotranslation#c517f77e`. +// Channel autotranslation was toggled »¹. +// +// Links: +// 1. https://core.telegram.org/api/translation#autotranslation-for-channels // // See https://core.telegram.org/constructor/channelAdminLogEventActionToggleAutotranslation for reference. type ChannelAdminLogEventActionToggleAutotranslation struct { - // NewValue field of ChannelAdminLogEventActionToggleAutotranslation. + // New value of the toggle NewValue bool } diff --git a/tg/tl_channels_check_search_posts_flood_gen.go b/tg/tl_channels_check_search_posts_flood_gen.go index 03a342d558..91a0ca110c 100644 --- a/tg/tl_channels_check_search_posts_flood_gen.go +++ b/tg/tl_channels_check_search_posts_flood_gen.go @@ -32,12 +32,19 @@ var ( ) // ChannelsCheckSearchPostsFloodRequest represents TL type `channels.checkSearchPostsFlood#22567115`. +// Check if the specified global post search »¹ requires payment. +// +// Links: +// 1. https://core.telegram.org/api/search#posts-tab // // See https://core.telegram.org/method/channels.checkSearchPostsFlood for reference. type ChannelsCheckSearchPostsFloodRequest struct { - // Flags field of ChannelsCheckSearchPostsFloodRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Query field of ChannelsCheckSearchPostsFloodRequest. + // The query. // // Use SetQuery and GetQuery helpers. Query string @@ -200,6 +207,10 @@ func (c *ChannelsCheckSearchPostsFloodRequest) GetQuery() (value string, ok bool } // ChannelsCheckSearchPostsFlood invokes method channels.checkSearchPostsFlood#22567115 returning error if any. +// Check if the specified global post search »¹ requires payment. +// +// Links: +// 1. https://core.telegram.org/api/search#posts-tab // // See https://core.telegram.org/method/channels.checkSearchPostsFlood for reference. func (c *Client) ChannelsCheckSearchPostsFlood(ctx context.Context, request *ChannelsCheckSearchPostsFloodRequest) (*SearchPostsFlood, error) { diff --git a/tg/tl_channels_create_channel_gen.go b/tg/tl_channels_create_channel_gen.go index 55a8246b50..685e20b85c 100644 --- a/tg/tl_channels_create_channel_gen.go +++ b/tg/tl_channels_create_channel_gen.go @@ -550,7 +550,7 @@ func (c *ChannelsCreateChannelRequest) GetGeoPointAsNotEmpty() (*InputGeoPoint, // 500 CHAT_INVALID: Invalid chat. // 400 CHAT_TITLE_EMPTY: No chat title provided. // 400 TTL_PERIOD_INVALID: The specified TTL period is invalid. -// 406 USER_RESTRICTED: You're spamreported, you can't create channels or chats. +// 403 USER_RESTRICTED: You're spamreported, you can't create channels or chats. // // See https://core.telegram.org/method/channels.createChannel for reference. func (c *Client) ChannelsCreateChannel(ctx context.Context, request *ChannelsCreateChannelRequest) (UpdatesClass, error) { diff --git a/tg/tl_channels_delete_messages_gen.go b/tg/tl_channels_delete_messages_gen.go index ce4f1411cc..6d76402fba 100644 --- a/tg/tl_channels_delete_messages_gen.go +++ b/tg/tl_channels_delete_messages_gen.go @@ -227,11 +227,11 @@ func (d *ChannelsDeleteMessagesRequest) GetChannelAsNotEmpty() (NotEmptyInputCha // // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. +// 420 FROZEN_METHOD_INVALID: The current account is frozen, and thus cannot execute the specified action. // 403 MESSAGE_DELETE_FORBIDDEN: You can't delete one of the messages you tried to delete, most likely because it is a service message. // 400 MSG_ID_INVALID: Invalid message ID provided. // // See https://core.telegram.org/method/channels.deleteMessages for reference. -// Can be used by bots. func (c *Client) ChannelsDeleteMessages(ctx context.Context, request *ChannelsDeleteMessagesRequest) (*MessagesAffectedMessages, error) { var result MessagesAffectedMessages diff --git a/tg/tl_channels_edit_admin_gen.go b/tg/tl_channels_edit_admin_gen.go index 23d957cd3e..5d22643b81 100644 --- a/tg/tl_channels_edit_admin_gen.go +++ b/tg/tl_channels_edit_admin_gen.go @@ -278,12 +278,14 @@ func (e *ChannelsEditAdminRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel, // 400 BOT_CHANNELS_NA: Bots can't edit admin privileges. // 400 BOT_GROUPS_BLOCKED: This bot can't be added to groups. // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_MONOFORUM_UNSUPPORTED: Monoforums do not support this feature. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_INVITE_REQUIRED: You do not have the rights to do this. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 406 FRESH_CHANGE_ADMINS_FORBIDDEN: You were just elected admin, you can't add or modify other admins yet. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. +// 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 403 RIGHT_FORBIDDEN: Your admin rights do not allow you to do this. // 400 USERS_TOO_MUCH: The maximum number of users has been exceeded (to create a chat, for example). @@ -296,7 +298,6 @@ func (e *ChannelsEditAdminRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel, // 403 USER_RESTRICTED: You're spamreported, you can't create channels or chats. // // See https://core.telegram.org/method/channels.editAdmin for reference. -// Can be used by bots. func (c *Client) ChannelsEditAdmin(ctx context.Context, request *ChannelsEditAdminRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_edit_banned_gen.go b/tg/tl_channels_edit_banned_gen.go index d03d4422fe..4232a8d4a5 100644 --- a/tg/tl_channels_edit_banned_gen.go +++ b/tg/tl_channels_edit_banned_gen.go @@ -257,7 +257,6 @@ func (e *ChannelsEditBannedRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/channels.editBanned for reference. -// Can be used by bots. func (c *Client) ChannelsEditBanned(ctx context.Context, request *ChannelsEditBannedRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_edit_creator_gen.go b/tg/tl_channels_edit_creator_gen.go index ad7c189746..3d7aea0826 100644 --- a/tg/tl_channels_edit_creator_gen.go +++ b/tg/tl_channels_edit_creator_gen.go @@ -249,8 +249,10 @@ func (e *ChannelsEditCreatorRequest) GetPasswordAsNotEmpty() (*InputCheckPasswor // Possible errors: // // 400 CHANNELS_ADMIN_PUBLIC_TOO_MUCH: You're admin of too many public channels, make some channels private to change the username of this channel. +// 400 CHANNEL_MONOFORUM_UNSUPPORTED: Monoforums do not support this feature. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 CHAT_MEMBER_ADD_FAILED: Could not add participants. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 PASSWORD_HASH_INVALID: The provided password hash is invalid. @@ -259,6 +261,7 @@ func (e *ChannelsEditCreatorRequest) GetPasswordAsNotEmpty() (*InputCheckPasswor // 400 SESSION_TOO_FRESH_%d: This session was created less than 24 hours ago, try again in %d seconds. // 400 SRP_ID_INVALID: Invalid SRP ID provided. // 400 USER_ID_INVALID: The provided user ID is invalid. +// 403 USER_PRIVACY_RESTRICTED: The user's privacy settings do not allow you to do this. // // See https://core.telegram.org/method/channels.editCreator for reference. func (c *Client) ChannelsEditCreator(ctx context.Context, request *ChannelsEditCreatorRequest) (UpdatesClass, error) { diff --git a/tg/tl_channels_edit_photo_gen.go b/tg/tl_channels_edit_photo_gen.go index e8872555f7..fc3f509d61 100644 --- a/tg/tl_channels_edit_photo_gen.go +++ b/tg/tl_channels_edit_photo_gen.go @@ -229,7 +229,6 @@ func (e *ChannelsEditPhotoRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel, // 400 STICKER_MIME_INVALID: The specified sticker MIME type is invalid. // // See https://core.telegram.org/method/channels.editPhoto for reference. -// Can be used by bots. func (c *Client) ChannelsEditPhoto(ctx context.Context, request *ChannelsEditPhotoRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_edit_title_gen.go b/tg/tl_channels_edit_title_gen.go index a1eea1602f..62455efbb1 100644 --- a/tg/tl_channels_edit_title_gen.go +++ b/tg/tl_channels_edit_title_gen.go @@ -212,12 +212,12 @@ func (e *ChannelsEditTitleRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel, // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 CHAT_INVALID: Invalid chat. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 400 CHAT_TITLE_EMPTY: No chat title provided. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // // See https://core.telegram.org/method/channels.editTitle for reference. -// Can be used by bots. func (c *Client) ChannelsEditTitle(ctx context.Context, request *ChannelsEditTitleRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_get_channel_recommendations_gen.go b/tg/tl_channels_get_channel_recommendations_gen.go index c0986d5b6d..e2d4aeae87 100644 --- a/tg/tl_channels_get_channel_recommendations_gen.go +++ b/tg/tl_channels_get_channel_recommendations_gen.go @@ -227,6 +227,7 @@ func (g *ChannelsGetChannelRecommendationsRequest) GetChannelAsNotEmpty() (NotEm // // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // // See https://core.telegram.org/method/channels.getChannelRecommendations for reference. func (c *Client) ChannelsGetChannelRecommendations(ctx context.Context, request *ChannelsGetChannelRecommendationsRequest) (MessagesChatsClass, error) { diff --git a/tg/tl_channels_get_channels_gen.go b/tg/tl_channels_get_channels_gen.go index 7139b750d2..bf41738980 100644 --- a/tg/tl_channels_get_channels_gen.go +++ b/tg/tl_channels_get_channels_gen.go @@ -201,7 +201,6 @@ func (g *ChannelsGetChannelsRequest) MapID() (value InputChannelClassArray) { // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // // See https://core.telegram.org/method/channels.getChannels for reference. -// Can be used by bots. func (c *Client) ChannelsGetChannels(ctx context.Context, id []InputChannelClass) (MessagesChatsClass, error) { var result MessagesChatsBox diff --git a/tg/tl_channels_get_full_channel_gen.go b/tg/tl_channels_get_full_channel_gen.go index 2d5790a1e1..18173fd840 100644 --- a/tg/tl_channels_get_full_channel_gen.go +++ b/tg/tl_channels_get_full_channel_gen.go @@ -198,7 +198,6 @@ func (g *ChannelsGetFullChannelRequest) GetChannelAsNotEmpty() (NotEmptyInputCha // 400 MSG_ID_INVALID: Invalid message ID provided. // // See https://core.telegram.org/method/channels.getFullChannel for reference. -// Can be used by bots. func (c *Client) ChannelsGetFullChannel(ctx context.Context, channel InputChannelClass) (*MessagesChatFull, error) { var result MessagesChatFull diff --git a/tg/tl_channels_get_left_channels_gen.go b/tg/tl_channels_get_left_channels_gen.go index 5cdc1359f4..8940adef61 100644 --- a/tg/tl_channels_get_left_channels_gen.go +++ b/tg/tl_channels_get_left_channels_gen.go @@ -179,6 +179,7 @@ func (g *ChannelsGetLeftChannelsRequest) GetOffset() (value int) { // // Possible errors: // +// 400 TAKEOUT_INVALID: The specified takeout ID is invalid. // 403 TAKEOUT_REQUIRED: A takeout session needs to be initialized first, see here » for more info. // // See https://core.telegram.org/method/channels.getLeftChannels for reference. diff --git a/tg/tl_channels_get_message_author_gen.go b/tg/tl_channels_get_message_author_gen.go index 10d917be55..d9732e5dc2 100644 --- a/tg/tl_channels_get_message_author_gen.go +++ b/tg/tl_channels_get_message_author_gen.go @@ -32,12 +32,18 @@ var ( ) // ChannelsGetMessageAuthorRequest represents TL type `channels.getMessageAuthor#ece2a0e6`. +// Can only be invoked by non-bot admins of a monoforum »¹, obtains the original sender +// of a message sent by other monoforum admins to the monoforum, on behalf of the channel +// associated to the monoforum. +// +// Links: +// 1. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/method/channels.getMessageAuthor for reference. type ChannelsGetMessageAuthorRequest struct { - // Channel field of ChannelsGetMessageAuthorRequest. + // ID of the monoforum. Channel InputChannelClass - // ID field of ChannelsGetMessageAuthorRequest. + // ID of the message sent by a monoforum admin. ID int } @@ -198,9 +204,18 @@ func (g *ChannelsGetMessageAuthorRequest) GetChannelAsNotEmpty() (NotEmptyInputC } // ChannelsGetMessageAuthor invokes method channels.getMessageAuthor#ece2a0e6 returning error if any. +// Can only be invoked by non-bot admins of a monoforum »¹, obtains the original sender +// of a message sent by other monoforum admins to the monoforum, on behalf of the channel +// associated to the monoforum. +// +// Links: +// 1. https://core.telegram.org/api/monoforum +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. // // See https://core.telegram.org/method/channels.getMessageAuthor for reference. -// Can be used by bots. func (c *Client) ChannelsGetMessageAuthor(ctx context.Context, request *ChannelsGetMessageAuthorRequest) (UserClass, error) { var result UserBox diff --git a/tg/tl_channels_get_messages_gen.go b/tg/tl_channels_get_messages_gen.go index dc5d8845e1..b34137f1ba 100644 --- a/tg/tl_channels_get_messages_gen.go +++ b/tg/tl_channels_get_messages_gen.go @@ -234,12 +234,13 @@ func (g *ChannelsGetMessagesRequest) MapID() (value InputMessageClassArray) { // // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// 400 FROZEN_PARTICIPANT_MISSING: The current account is frozen, and cannot access the specified peer. // 400 MESSAGE_IDS_EMPTY: No message ids were provided. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // // See https://core.telegram.org/method/channels.getMessages for reference. -// Can be used by bots. func (c *Client) ChannelsGetMessages(ctx context.Context, request *ChannelsGetMessagesRequest) (MessagesMessagesClass, error) { var result MessagesMessagesBox diff --git a/tg/tl_channels_get_participant_gen.go b/tg/tl_channels_get_participant_gen.go index 2c37bce1a8..e3e61e335c 100644 --- a/tg/tl_channels_get_participant_gen.go +++ b/tg/tl_channels_get_participant_gen.go @@ -223,7 +223,6 @@ func (g *ChannelsGetParticipantRequest) GetChannelAsNotEmpty() (NotEmptyInputCha // 400 USER_NOT_PARTICIPANT: You're not a member of this supergroup/channel. // // See https://core.telegram.org/method/channels.getParticipant for reference. -// Can be used by bots. func (c *Client) ChannelsGetParticipant(ctx context.Context, request *ChannelsGetParticipantRequest) (*ChannelsChannelParticipant, error) { var result ChannelsChannelParticipant diff --git a/tg/tl_channels_get_participants_gen.go b/tg/tl_channels_get_participants_gen.go index 249bb72650..482fd3b533 100644 --- a/tg/tl_channels_get_participants_gen.go +++ b/tg/tl_channels_get_participants_gen.go @@ -305,12 +305,12 @@ func (g *ChannelsGetParticipantsRequest) GetChannelAsNotEmpty() (NotEmptyInputCh // Possible errors: // // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_MONOFORUM_UNSUPPORTED: Monoforums do not support this feature. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 MSG_ID_INVALID: Invalid message ID provided. // // See https://core.telegram.org/method/channels.getParticipants for reference. -// Can be used by bots. func (c *Client) ChannelsGetParticipants(ctx context.Context, request *ChannelsGetParticipantsRequest) (ChannelsChannelParticipantsClass, error) { var result ChannelsChannelParticipantsBox diff --git a/tg/tl_channels_get_send_as_gen.go b/tg/tl_channels_get_send_as_gen.go index b3504e71e7..b4568905a4 100644 --- a/tg/tl_channels_get_send_as_gen.go +++ b/tg/tl_channels_get_send_as_gen.go @@ -41,7 +41,11 @@ type ChannelsGetSendAsRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ForPaidReactions field of ChannelsGetSendAsRequest. + // If set, fetches the list of peers that can be used to send paid reactions¹ to + // messages of a specific peer. + // + // Links: + // 1) https://core.telegram.org/api/reactions#paid-reactions ForPaidReactions bool // The group where we intend to send messages Peer InputPeerClass diff --git a/tg/tl_channels_invite_to_channel_gen.go b/tg/tl_channels_invite_to_channel_gen.go index 690cb15fba..608ba4a472 100644 --- a/tg/tl_channels_invite_to_channel_gen.go +++ b/tg/tl_channels_invite_to_channel_gen.go @@ -229,6 +229,7 @@ func (i *ChannelsInviteToChannelRequest) MapUsers() (value InputUserClassArray) // 400 BOTS_TOO_MUCH: There are too many bots in this chat/channel. // 400 BOT_GROUPS_BLOCKED: This bot can't be added to groups. // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_MONOFORUM_UNSUPPORTED: Monoforums do not support this feature. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_INVALID: Invalid chat. diff --git a/tg/tl_channels_join_channel_gen.go b/tg/tl_channels_join_channel_gen.go index e0f08bc098..0c87fde906 100644 --- a/tg/tl_channels_join_channel_gen.go +++ b/tg/tl_channels_join_channel_gen.go @@ -178,8 +178,10 @@ func (j *ChannelsJoinChannelRequest) GetChannelAsNotEmpty() (NotEmptyInputChanne // // 400 CHANNELS_TOO_MUCH: You have joined too many channels/supergroups. // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_MONOFORUM_UNSUPPORTED: Monoforums do not support this feature. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_INVALID: Invalid chat. +// 420 FROZEN_METHOD_INVALID: The current account is frozen, and thus cannot execute the specified action. // 400 INVITE_HASH_EMPTY: The invite hash is empty. // 406 INVITE_HASH_EXPIRED: The invite link has expired. // 400 INVITE_HASH_INVALID: The invite hash is invalid. diff --git a/tg/tl_channels_leave_channel_gen.go b/tg/tl_channels_leave_channel_gen.go index ccd05df15d..38f372e667 100644 --- a/tg/tl_channels_leave_channel_gen.go +++ b/tg/tl_channels_leave_channel_gen.go @@ -195,7 +195,6 @@ func (l *ChannelsLeaveChannelRequest) GetChannelAsNotEmpty() (NotEmptyInputChann // 400 USER_NOT_PARTICIPANT: You're not a member of this supergroup/channel. // // See https://core.telegram.org/method/channels.leaveChannel for reference. -// Can be used by bots. func (c *Client) ChannelsLeaveChannel(ctx context.Context, channel InputChannelClass) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_read_message_contents_gen.go b/tg/tl_channels_read_message_contents_gen.go index f512b9b364..ed04eead5d 100644 --- a/tg/tl_channels_read_message_contents_gen.go +++ b/tg/tl_channels_read_message_contents_gen.go @@ -32,10 +32,12 @@ var ( ) // ChannelsReadMessageContentsRequest represents TL type `channels.readMessageContents#eab5dc38`. -// Mark channel/supergroup¹ message contents as read +// Mark channel/supergroup¹ message contents as read, emitting an +// updateChannelReadMessagesContents². // // Links: // 1. https://core.telegram.org/api/channel +// 2. https://core.telegram.org/constructor/updateChannelReadMessagesContents // // See https://core.telegram.org/method/channels.readMessageContents for reference. type ChannelsReadMessageContentsRequest struct { @@ -218,10 +220,12 @@ func (r *ChannelsReadMessageContentsRequest) GetChannelAsNotEmpty() (NotEmptyInp } // ChannelsReadMessageContents invokes method channels.readMessageContents#eab5dc38 returning error if any. -// Mark channel/supergroup¹ message contents as read +// Mark channel/supergroup¹ message contents as read, emitting an +// updateChannelReadMessagesContents². // // Links: // 1. https://core.telegram.org/api/channel +// 2. https://core.telegram.org/constructor/updateChannelReadMessagesContents // // Possible errors: // diff --git a/tg/tl_channels_search_posts_gen.go b/tg/tl_channels_search_posts_gen.go index 5ecdbc5b2c..3967e27cc1 100644 --- a/tg/tl_channels_search_posts_gen.go +++ b/tg/tl_channels_search_posts_gen.go @@ -33,24 +33,33 @@ var ( // ChannelsSearchPostsRequest represents TL type `channels.searchPosts#f2c4f24d`. // Globally search for posts from public channels »¹ (including those we aren't a -// member of) containing a specific hashtag. +// member of) containing either a specific hashtag, or a full text query. +// Exactly one of query and hashtag must be set. // // Links: // 1. https://core.telegram.org/api/channel // // See https://core.telegram.org/method/channels.searchPosts for reference. type ChannelsSearchPostsRequest struct { - // Flags field of ChannelsSearchPostsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // The hashtag to search, without the # character. // // Use SetHashtag and GetHashtag helpers. Hashtag string - // Query field of ChannelsSearchPostsRequest. + // The full text query: each user has a limited amount of free full text search slots, + // after which payment is required, see here »¹ for more info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/search#posts-tab // // Use SetQuery and GetQuery helpers. Query string - // Initially 0, then set to the next_rate parameter of messages.messagesSlice¹ + // Initially 0, then set to the next_rate parameter of messages.messagesSlice¹, or if + // that is absent, the date of the last returned message. // // Links: // 1) https://core.telegram.org/constructor/messages.messagesSlice @@ -70,7 +79,11 @@ type ChannelsSearchPostsRequest struct { // Links: // 1) https://core.telegram.org/api/offsets Limit int - // AllowPaidStars field of ChannelsSearchPostsRequest. + // For full text post searches (query), allows payment of the specified amount of Stars + // for the search, see here »¹ for more info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/search#posts-tab // // Use SetAllowPaidStars and GetAllowPaidStars helpers. AllowPaidStars int64 @@ -427,11 +440,16 @@ func (s *ChannelsSearchPostsRequest) GetAllowPaidStars() (value int64, ok bool) // ChannelsSearchPosts invokes method channels.searchPosts#f2c4f24d returning error if any. // Globally search for posts from public channels »¹ (including those we aren't a -// member of) containing a specific hashtag. +// member of) containing either a specific hashtag, or a full text query. +// Exactly one of query and hashtag must be set. // // Links: // 1. https://core.telegram.org/api/channel // +// Possible errors: +// +// 420 FROZEN_METHOD_INVALID: The current account is frozen, and thus cannot execute the specified action. +// // See https://core.telegram.org/method/channels.searchPosts for reference. func (c *Client) ChannelsSearchPosts(ctx context.Context, request *ChannelsSearchPostsRequest) (MessagesMessagesClass, error) { var result MessagesMessagesBox diff --git a/tg/tl_channels_set_main_profile_tab_gen.go b/tg/tl_channels_set_main_profile_tab_gen.go index 6dc6397db2..7708577c27 100644 --- a/tg/tl_channels_set_main_profile_tab_gen.go +++ b/tg/tl_channels_set_main_profile_tab_gen.go @@ -32,12 +32,16 @@ var ( ) // ChannelsSetMainProfileTabRequest represents TL type `channels.setMainProfileTab#3583fcb1`. +// Changes the main profile tab of a channel, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#tabs // // See https://core.telegram.org/method/channels.setMainProfileTab for reference. type ChannelsSetMainProfileTabRequest struct { - // Channel field of ChannelsSetMainProfileTabRequest. + // The channel. Channel InputChannelClass - // Tab field of ChannelsSetMainProfileTabRequest. + // The tab to set as main tab. Tab ProfileTabClass } @@ -203,6 +207,14 @@ func (s *ChannelsSetMainProfileTabRequest) GetChannelAsNotEmpty() (NotEmptyInput } // ChannelsSetMainProfileTab invokes method channels.setMainProfileTab#3583fcb1 returning error if any. +// Changes the main profile tab of a channel, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#tabs +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. // // See https://core.telegram.org/method/channels.setMainProfileTab for reference. func (c *Client) ChannelsSetMainProfileTab(ctx context.Context, request *ChannelsSetMainProfileTabRequest) (bool, error) { diff --git a/tg/tl_channels_set_stickers_gen.go b/tg/tl_channels_set_stickers_gen.go index 03ee4900aa..b3a2bddf93 100644 --- a/tg/tl_channels_set_stickers_gen.go +++ b/tg/tl_channels_set_stickers_gen.go @@ -214,7 +214,6 @@ func (s *ChannelsSetStickersRequest) GetChannelAsNotEmpty() (NotEmptyInputChanne // 406 STICKERSET_OWNER_ANONYMOUS: Provided stickerset can't be installed as group stickerset to prevent admin deanonymization. // // See https://core.telegram.org/method/channels.setStickers for reference. -// Can be used by bots. func (c *Client) ChannelsSetStickers(ctx context.Context, request *ChannelsSetStickersRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_channels_toggle_autotranslation_gen.go b/tg/tl_channels_toggle_autotranslation_gen.go index ae23c49b9c..11c3b02998 100644 --- a/tg/tl_channels_toggle_autotranslation_gen.go +++ b/tg/tl_channels_toggle_autotranslation_gen.go @@ -32,12 +32,16 @@ var ( ) // ChannelsToggleAutotranslationRequest represents TL type `channels.toggleAutotranslation#167fc0a1`. +// Toggle autotranslation in a channel, for all users: see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/translation#autotranslation-for-channels // // See https://core.telegram.org/method/channels.toggleAutotranslation for reference. type ChannelsToggleAutotranslationRequest struct { - // Channel field of ChannelsToggleAutotranslationRequest. + // The channel where to toggle autotranslation. Channel InputChannelClass - // Enabled field of ChannelsToggleAutotranslationRequest. + // Whether to enable or disable autotranslation. Enabled bool } @@ -198,9 +202,16 @@ func (t *ChannelsToggleAutotranslationRequest) GetChannelAsNotEmpty() (NotEmptyI } // ChannelsToggleAutotranslation invokes method channels.toggleAutotranslation#167fc0a1 returning error if any. +// Toggle autotranslation in a channel, for all users: see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/translation#autotranslation-for-channels +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. // // See https://core.telegram.org/method/channels.toggleAutotranslation for reference. -// Can be used by bots. func (c *Client) ChannelsToggleAutotranslation(ctx context.Context, request *ChannelsToggleAutotranslationRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_toggle_forum_gen.go b/tg/tl_channels_toggle_forum_gen.go index ddded82c2e..f4584207ac 100644 --- a/tg/tl_channels_toggle_forum_gen.go +++ b/tg/tl_channels_toggle_forum_gen.go @@ -43,7 +43,7 @@ type ChannelsToggleForumRequest struct { Channel InputChannelClass // Enable or disable forum functionality Enabled bool - // Tabs field of ChannelsToggleForumRequest. + // If true enables the tabbed forum UI, otherwise enables the list-based forum UI. Tabs bool } diff --git a/tg/tl_channels_update_paid_messages_price_gen.go b/tg/tl_channels_update_paid_messages_price_gen.go index ea35510c88..42dd9c3ef8 100644 --- a/tg/tl_channels_update_paid_messages_price_gen.go +++ b/tg/tl_channels_update_paid_messages_price_gen.go @@ -32,6 +32,17 @@ var ( ) // ChannelsUpdatePaidMessagesPriceRequest represents TL type `channels.updatePaidMessagesPrice#4b12327b`. +// Enable or disable paid messages »¹ in this supergroup² or monoforum³. +// Also used to enable or disable monoforums aka direct messages in a channel¹. +// Note that passing the ID of the monoforum itself to channel will return a +// CHANNEL_MONOFORUM_UNSUPPORTED error: pass the ID of the associated channel to edit the +// settings of the associated monoforum, instead. +// +// Links: +// 1. https://core.telegram.org/api/paid-messages +// 2. https://core.telegram.org/api/channel +// 3. https://core.telegram.org/api/monoforum +// 4. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/method/channels.updatePaidMessagesPrice for reference. type ChannelsUpdatePaidMessagesPriceRequest struct { @@ -40,11 +51,23 @@ type ChannelsUpdatePaidMessagesPriceRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // BroadcastMessagesAllowed field of ChannelsUpdatePaidMessagesPriceRequest. + // Only usable for channels, enables or disables the associated monoforum aka direct + // messages¹. + // + // Links: + // 1) https://core.telegram.org/api/monoforum BroadcastMessagesAllowed bool - // Channel field of ChannelsUpdatePaidMessagesPriceRequest. + // Pass the supergroup ID for supergroups and the ID of the channel¹ to modify the + // setting in the associated monoforum. + // + // Links: + // 1) https://core.telegram.org/api/channel Channel InputChannelClass - // SendPaidMessagesStars field of ChannelsUpdatePaidMessagesPriceRequest. + // Specifies the required amount of Telegram Stars¹ users must pay to send messages to + // the supergroup or monoforum. + // + // Links: + // 1) https://core.telegram.org/api/stars SendPaidMessagesStars int64 } @@ -254,9 +277,26 @@ func (u *ChannelsUpdatePaidMessagesPriceRequest) GetChannelAsNotEmpty() (NotEmpt } // ChannelsUpdatePaidMessagesPrice invokes method channels.updatePaidMessagesPrice#4b12327b returning error if any. +// Enable or disable paid messages »¹ in this supergroup² or monoforum³. +// Also used to enable or disable monoforums aka direct messages in a channel¹. +// Note that passing the ID of the monoforum itself to channel will return a +// CHANNEL_MONOFORUM_UNSUPPORTED error: pass the ID of the associated channel to edit the +// settings of the associated monoforum, instead. +// +// Links: +// 1. https://core.telegram.org/api/paid-messages +// 2. https://core.telegram.org/api/channel +// 3. https://core.telegram.org/api/monoforum +// 4. https://core.telegram.org/api/monoforum +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_MONOFORUM_UNSUPPORTED: Monoforums do not support this feature. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// 400 STARS_AMOUNT_INVALID: The specified amount in stars is invalid. // // See https://core.telegram.org/method/channels.updatePaidMessagesPrice for reference. -// Can be used by bots. func (c *Client) ChannelsUpdatePaidMessagesPrice(ctx context.Context, request *ChannelsUpdatePaidMessagesPriceRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_chat_admin_rights_gen.go b/tg/tl_chat_admin_rights_gen.go index af762adc5a..11554dfdcc 100644 --- a/tg/tl_chat_admin_rights_gen.go +++ b/tg/tl_chat_admin_rights_gen.go @@ -123,7 +123,12 @@ type ChatAdminRights struct { // 1) https://core.telegram.org/api/stories // 2) https://core.telegram.org/api/channel DeleteStories bool - // ManageDirectMessages field of ChatAdminRights. + // If set, allows the admin to manage the direct messages monoforum »¹ and decline + // suggested posts »². + // + // Links: + // 1) https://core.telegram.org/api/monoforum + // 2) https://core.telegram.org/api/suggested-posts ManageDirectMessages bool } diff --git a/tg/tl_chat_full_gen.go b/tg/tl_chat_full_gen.go index 8f308cee51..872ec57b22 100644 --- a/tg/tl_chat_full_gen.go +++ b/tg/tl_chat_full_gen.go @@ -1193,9 +1193,15 @@ type ChannelFull struct { // Links: // 1) https://core.telegram.org/api/reactions#paid-reactions PaidReactionsAvailable bool - // StargiftsAvailable field of ChannelFull. + // If set, users may send Gifts »¹ to this channel. + // + // Links: + // 1) https://core.telegram.org/api/gifts StargiftsAvailable bool - // PaidMessagesAvailable field of ChannelFull. + // If set, admins may enable enable paid messages »¹ in this supergroup. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages PaidMessagesAvailable bool // ID of the channel ID int64 @@ -1409,19 +1415,42 @@ type ChannelFull struct { // // Use SetEmojiset and GetEmojiset helpers. Emojiset StickerSet - // BotVerification field of ChannelFull. + // Bot verification icon¹ + // + // Links: + // 1) https://core.telegram.org/api/bots/verification // // Use SetBotVerification and GetBotVerification helpers. BotVerification BotVerification - // StargiftsCount field of ChannelFull. + // Admins with chatAdminRights¹.post_messages rights will see the total number of + // received gifts, everyone else will see the number of gifts added to the channel's + // profile. + // + // Links: + // 1) https://core.telegram.org/constructor/chatAdminRights // // Use SetStargiftsCount and GetStargiftsCount helpers. StargiftsCount int - // SendPaidMessagesStars field of ChannelFull. + // If set and bigger than 0, this supergroup, monoforum¹ or the monoforum associated to + // this channel has enabled paid messages »² and we must pay the specified amount of + // Stars³ to send messages to it, see here »⁴ for the full flow. This flag will be + // set both for the monoforum and for channelFull⁵ of the associated channel). If set + // and equal to 0, the monoforum requires payment in general but we were exempted from + // paying. + // + // Links: + // 1) https://core.telegram.org/api/monoforum + // 2) https://core.telegram.org/api/paid-messages + // 3) https://core.telegram.org/api/stars + // 4) https://core.telegram.org/api/paid-messages + // 5) https://core.telegram.org/constructor/channelFull // // Use SetSendPaidMessagesStars and GetSendPaidMessagesStars helpers. SendPaidMessagesStars int64 - // MainTab field of ChannelFull. + // The main tab for the channel's profile, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/profile#tabs // // Use SetMainTab and GetMainTab helpers. MainTab ProfileTabClass diff --git a/tg/tl_chat_gen.go b/tg/tl_chat_gen.go index 6969b20049..cb9daf83c0 100644 --- a/tg/tl_chat_gen.go +++ b/tg/tl_chat_gen.go @@ -204,7 +204,7 @@ type Chat struct { // Links: // 1) https://telegram.org/blog/protected-content-delete-by-date-and-more Noforwards bool - // ID of the group, see here »¹ for more info + // ID of the group, see here »¹ for more info and the available ID range. // // Links: // 1) https://core.telegram.org/api/peers#peer-id @@ -1164,15 +1164,31 @@ type Channel struct { // If set, messages sent by admins to this channel will link to the admin's profile (just // like with groups). SignatureProfiles bool - // Autotranslation field of Channel. + // If set, autotranslation¹ was enabled for all users by the admin of the channel, as + // specified here »². + // + // Links: + // 1) https://core.telegram.org/api/translation#autotranslation-for-channels + // 2) https://core.telegram.org/api/translation#autotranslation-for-channels Autotranslation bool - // BroadcastMessagesAllowed field of Channel. + // If set, this channel has an associated monoforum »¹, and its ID is specified in the + // linked_monoforum_id flag. + // + // Links: + // 1) https://core.telegram.org/api/monoforum BroadcastMessagesAllowed bool - // Monoforum field of Channel. + // If set, this is a monoforum »¹, and the ID of the associated channel is specified in + // the linked_monoforum_id. + // + // Links: + // 1) https://core.telegram.org/api/monoforum Monoforum bool - // ForumTabs field of Channel. + // If set, enables the tabbed forum UI »¹. + // + // Links: + // 1) https://core.telegram.org/api/forum#tabbed-or-list-based-forum-ui ForumTabs bool - // ID of the channel, see here »¹ for more info + // ID of the channel, see here »¹ for more info and the available ID range. // // Links: // 1) https://core.telegram.org/api/peers#peer-id @@ -1280,15 +1296,35 @@ type Channel struct { // // Use SetSubscriptionUntilDate and GetSubscriptionUntilDate helpers. SubscriptionUntilDate int - // BotVerificationIcon field of Channel. + // Describes a bot verification icon »¹. + // + // Links: + // 1) https://core.telegram.org/api/bots/verification // // Use SetBotVerificationIcon and GetBotVerificationIcon helpers. BotVerificationIcon int64 - // SendPaidMessagesStars field of Channel. + // If set, this supergroup or monoforum¹ has enabled paid messages »², we might need + // to pay the specified amount of Stars³ to send messages to it, depending on the + // configured exceptions: check channelFull⁴.send_paid_messages_stars to see if the + // currently logged in user actually has to pay or not, see here »⁵ for the full flow + // (only set for the monoforum, not the associated channel). + // + // Links: + // 1) https://core.telegram.org/api/monoforum + // 2) https://core.telegram.org/api/paid-messages + // 3) https://core.telegram.org/api/stars + // 4) https://core.telegram.org/constructor/channelFull + // 5) https://core.telegram.org/api/paid-messages // // Use SetSendPaidMessagesStars and GetSendPaidMessagesStars helpers. SendPaidMessagesStars int64 - // LinkedMonoforumID field of Channel. + // For channels with associated monoforums¹, the monoforum² ID. For Monoforums³, the + // ID of the associated channel. + // + // Links: + // 1) https://core.telegram.org/api/monoforum + // 2) https://core.telegram.org/api/monoforum + // 3) https://core.telegram.org/api/monoforum // // Use SetLinkedMonoforumID and GetLinkedMonoforumID helpers. LinkedMonoforumID int64 @@ -3679,7 +3715,7 @@ type NotEmptyChat interface { // Zero returns true if current object has a zero value. Zero() bool - // ID of the group, see here »¹ for more info + // ID of the group, see here »¹ for more info and the available ID range. // // Links: // 1) https://core.telegram.org/api/peers#peer-id @@ -3809,7 +3845,7 @@ type FullChat interface { // 1) https://telegram.org/blog/protected-content-delete-by-date-and-more GetNoforwards() (value bool) - // ID of the group, see here »¹ for more info + // ID of the group, see here »¹ for more info and the available ID range. // // Links: // 1) https://core.telegram.org/api/peers#peer-id diff --git a/tg/tl_chat_invite_gen.go b/tg/tl_chat_invite_gen.go index 4b922b8303..8e4e5aa47a 100644 --- a/tg/tl_chat_invite_gen.go +++ b/tg/tl_chat_invite_gen.go @@ -256,7 +256,10 @@ type ChatInvite struct { // // Use SetSubscriptionFormID and GetSubscriptionFormID helpers. SubscriptionFormID int64 - // BotVerification field of ChatInvite. + // Describes a bot verification icon »¹. + // + // Links: + // 1) https://core.telegram.org/api/bots/verification // // Use SetBotVerification and GetBotVerification helpers. BotVerification BotVerification diff --git a/tg/tl_chat_theme_gen.go b/tg/tl_chat_theme_gen.go index 159daa2d8a..1d1c724a62 100644 --- a/tg/tl_chat_theme_gen.go +++ b/tg/tl_chat_theme_gen.go @@ -32,10 +32,11 @@ var ( ) // ChatTheme represents TL type `chatTheme#c3dffc04`. +// A chat theme // // See https://core.telegram.org/constructor/chatTheme for reference. type ChatTheme struct { - // Emoticon field of ChatTheme. + // The emoji identifying the chat theme. Emoticon string } @@ -166,12 +167,20 @@ func (c *ChatTheme) GetEmoticon() (value string) { } // ChatThemeUniqueGift represents TL type `chatThemeUniqueGift#3458f9c8`. +// A chat theme based on a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/chatThemeUniqueGift for reference. type ChatThemeUniqueGift struct { - // Gift field of ChatThemeUniqueGift. + // The owned collectible gift on which this theme is based, as a starGiftUnique¹ + // constructor. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftUnique Gift StarGiftClass - // ThemeSettings field of ChatThemeUniqueGift. + // Theme settings. ThemeSettings []ThemeSettings } diff --git a/tg/tl_chatlists_chatlist_invite_gen.go b/tg/tl_chatlists_chatlist_invite_gen.go index 122ad3afe1..228ea18218 100644 --- a/tg/tl_chatlists_chatlist_invite_gen.go +++ b/tg/tl_chatlists_chatlist_invite_gen.go @@ -382,7 +382,8 @@ type ChatlistsChatlistInvite struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // TitleNoanimate field of ChatlistsChatlistInvite. + // If set, any animated emojis present in title should not be animated and should be + // instead frozen on the first frame. TitleNoanimate bool // Name of the link Title TextWithEntities diff --git a/tg/tl_chatlists_join_chatlist_invite_gen.go b/tg/tl_chatlists_join_chatlist_invite_gen.go index 53bd39116b..f229145bfb 100644 --- a/tg/tl_chatlists_join_chatlist_invite_gen.go +++ b/tg/tl_chatlists_join_chatlist_invite_gen.go @@ -230,6 +230,8 @@ func (j *ChatlistsJoinChatlistInviteRequest) MapPeers() (value InputPeerClassArr // // Possible errors: // +// 400 CHANNELS_TOO_MUCH: You have joined too many channels/supergroups. +// 400 CHATLISTS_TOO_MUCH: You have created too many folder links, hitting the chatlist_invites_limit_default/chatlist_invites_limit_premium limits ». // 400 FILTER_INCLUDE_EMPTY: The include_peers vector of the filter is empty. // 400 INVITE_SLUG_EMPTY: The specified invite slug is empty. // 400 INVITE_SLUG_EXPIRED: The specified chat folder link has expired. diff --git a/tg/tl_connected_bot_gen.go b/tg/tl_connected_bot_gen.go index 7b5928b067..fde7739f74 100644 --- a/tg/tl_connected_bot_gen.go +++ b/tg/tl_connected_bot_gen.go @@ -35,7 +35,7 @@ var ( // Contains info about a connected business bot »¹. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/constructor/connectedBot for reference. type ConnectedBot struct { @@ -50,9 +50,9 @@ type ConnectedBot struct { // and interact with. // // Links: - // 1) https://core.telegram.org/api/business#connected-bots + // 1) https://core.telegram.org/api/bots/connected-business-bots Recipients BusinessBotRecipients - // Rights field of ConnectedBot. + // Business bot rights. Rights BusinessBotRights } diff --git a/tg/tl_contacts_get_sponsored_peers_gen.go b/tg/tl_contacts_get_sponsored_peers_gen.go index c729a2a03e..173e004e6f 100644 --- a/tg/tl_contacts_get_sponsored_peers_gen.go +++ b/tg/tl_contacts_get_sponsored_peers_gen.go @@ -32,10 +32,11 @@ var ( ) // ContactsGetSponsoredPeersRequest represents TL type `contacts.getSponsoredPeers#b6c8c393`. +// Obtain a list of sponsored peer search results for a given query // // See https://core.telegram.org/method/contacts.getSponsoredPeers for reference. type ContactsGetSponsoredPeersRequest struct { - // Q field of ContactsGetSponsoredPeersRequest. + // The query Q string } @@ -161,9 +162,13 @@ func (g *ContactsGetSponsoredPeersRequest) GetQ() (value string) { } // ContactsGetSponsoredPeers invokes method contacts.getSponsoredPeers#b6c8c393 returning error if any. +// Obtain a list of sponsored peer search results for a given query +// +// Possible errors: +// +// 400 SEARCH_QUERY_EMPTY: The search query is empty. // // See https://core.telegram.org/method/contacts.getSponsoredPeers for reference. -// Can be used by bots. func (c *Client) ContactsGetSponsoredPeers(ctx context.Context, q string) (ContactsSponsoredPeersClass, error) { var result ContactsSponsoredPeersBox diff --git a/tg/tl_contacts_resolve_username_gen.go b/tg/tl_contacts_resolve_username_gen.go index fdcd133f3a..8c6f140b00 100644 --- a/tg/tl_contacts_resolve_username_gen.go +++ b/tg/tl_contacts_resolve_username_gen.go @@ -244,7 +244,6 @@ func (r *ContactsResolveUsernameRequest) GetReferer() (value string, ok bool) { // 400 USERNAME_NOT_OCCUPIED: The provided username is not occupied. // // See https://core.telegram.org/method/contacts.resolveUsername for reference. -// Can be used by bots. func (c *Client) ContactsResolveUsername(ctx context.Context, request *ContactsResolveUsernameRequest) (*ContactsResolvedPeer, error) { var result ContactsResolvedPeer diff --git a/tg/tl_contacts_sponsored_peers_gen.go b/tg/tl_contacts_sponsored_peers_gen.go index 399c24307e..79f952f4e2 100644 --- a/tg/tl_contacts_sponsored_peers_gen.go +++ b/tg/tl_contacts_sponsored_peers_gen.go @@ -32,6 +32,7 @@ var ( ) // ContactsSponsoredPeersEmpty represents TL type `contacts.sponsoredPeersEmpty#ea32b4b1`. +// There are no sponsored peers for this query. // // See https://core.telegram.org/constructor/contacts.sponsoredPeersEmpty for reference. type ContactsSponsoredPeersEmpty struct { @@ -133,14 +134,15 @@ func (s *ContactsSponsoredPeersEmpty) DecodeBare(b *bin.Buffer) error { } // ContactsSponsoredPeers represents TL type `contacts.sponsoredPeers#eb032884`. +// Sponsored peers. // // See https://core.telegram.org/constructor/contacts.sponsoredPeers for reference. type ContactsSponsoredPeers struct { - // Peers field of ContactsSponsoredPeers. + // Sponsored peers. Peers []SponsoredPeer - // Chats field of ContactsSponsoredPeers. + // Info about sponsored chats and channels Chats []ChatClass - // Users field of ContactsSponsoredPeers. + // Info about sponsored users Users []UserClass } diff --git a/tg/tl_dialog_filter_gen.go b/tg/tl_dialog_filter_gen.go index f71fff2927..422db033e9 100644 --- a/tg/tl_dialog_filter_gen.go +++ b/tg/tl_dialog_filter_gen.go @@ -84,7 +84,8 @@ type DialogFilter struct { // Links: // 1) https://core.telegram.org/api/folders ExcludeArchived bool - // TitleNoanimate field of DialogFilter. + // If set, any animated emojis present in title should not be animated and should be + // instead frozen on the first frame. TitleNoanimate bool // Folder¹ ID // @@ -941,7 +942,8 @@ type DialogFilterChatlist struct { // Links: // 1) https://core.telegram.org/api/links#chat-folder-links HasMyInvites bool - // TitleNoanimate field of DialogFilterChatlist. + // If set, any animated emojis present in title should not be animated and should be + // instead frozen on the first frame. TitleNoanimate bool // ID of the folder ID int diff --git a/tg/tl_disallowed_gifts_settings_gen.go b/tg/tl_disallowed_gifts_settings_gen.go index c2799bb60a..327ab6f96c 100644 --- a/tg/tl_disallowed_gifts_settings_gen.go +++ b/tg/tl_disallowed_gifts_settings_gen.go @@ -32,6 +32,10 @@ var ( ) // DisallowedGiftsSettings represents TL type `disallowedGiftsSettings#71f276c4`. +// Disallow the reception of specific gift¹ types. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/disallowedGiftsSettings for reference. type DisallowedGiftsSettings struct { @@ -40,13 +44,27 @@ type DisallowedGiftsSettings struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // DisallowUnlimitedStargifts field of DisallowedGiftsSettings. + // Disallow the reception of gifts with an unlimited supply (those with the starGift¹ + // limited flag not set). + // + // Links: + // 1) https://core.telegram.org/constructor/starGift DisallowUnlimitedStargifts bool - // DisallowLimitedStargifts field of DisallowedGiftsSettings. + // Disallow the reception of limited-supply gifts (those with the starGift¹.limited flag + // set). + // + // Links: + // 1) https://core.telegram.org/constructor/starGift DisallowLimitedStargifts bool - // DisallowUniqueStargifts field of DisallowedGiftsSettings. + // Disallow the reception of collectible gifts »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts DisallowUniqueStargifts bool - // DisallowPremiumGifts field of DisallowedGiftsSettings. + // Disallow the reception of gifted Telegram Premium subscriptions »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts DisallowPremiumGifts bool } diff --git a/tg/tl_document_gen.go b/tg/tl_document_gen.go index 39166d622c..2190faceed 100644 --- a/tg/tl_document_gen.go +++ b/tg/tl_document_gen.go @@ -183,7 +183,7 @@ type Document struct { // File reference¹ // // Links: - // 1) https://core.telegram.org/api/file_reference + // 1) https://core.telegram.org/api/file-references FileReference []byte // Creation date Date int diff --git a/tg/tl_draft_message_gen.go b/tg/tl_draft_message_gen.go index a1e52d18a5..f5382c70bb 100644 --- a/tg/tl_draft_message_gen.go +++ b/tg/tl_draft_message_gen.go @@ -253,7 +253,10 @@ type DraftMessage struct { // // Use SetEffect and GetEffect helpers. Effect int64 - // SuggestedPost field of DraftMessage. + // Used to suggest a post to a channel, see here »¹ for more info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/suggested-posts // // Use SetSuggestedPost and GetSuggestedPost helpers. SuggestedPost SuggestedPost diff --git a/tg/tl_emoji_status_gen.go b/tg/tl_emoji_status_gen.go index 4c4a1f8d1d..ee0b841015 100644 --- a/tg/tl_emoji_status_gen.go +++ b/tg/tl_emoji_status_gen.go @@ -151,7 +151,7 @@ type EmojiStatus struct { // Links: // 1) https://core.telegram.org/api/custom-emoji DocumentID int64 - // Until field of EmojiStatus. + // If set, the emoji status will be active until the specified unixtime. // // Use SetUntil and GetUntil helpers. Until int @@ -344,6 +344,14 @@ func (e *EmojiStatus) GetUntil() (value int, ok bool) { } // EmojiStatusCollectible represents TL type `emojiStatusCollectible#7184603b`. +// An owned collectible gift »¹ as emoji status. +// Cannot be passed to account.updateEmojiStatus¹, must be converted to an +// inputEmojiStatusCollectible² first before passing it to that method. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/method/account.updateEmojiStatus +// 3. https://core.telegram.org/constructor/inputEmojiStatusCollectible // // See https://core.telegram.org/constructor/emojiStatusCollectible for reference. type EmojiStatusCollectible struct { @@ -352,25 +360,57 @@ type EmojiStatusCollectible struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // CollectibleID field of EmojiStatusCollectible. + // ID of the collectible (from starGiftUnique¹.id). + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftUnique CollectibleID int64 - // DocumentID field of EmojiStatusCollectible. + // ID of the custom emoji¹ representing the status. + // + // Links: + // 1) https://core.telegram.org/api/custom-emoji DocumentID int64 - // Title field of EmojiStatusCollectible. + // Name of the collectible. Title string - // Slug field of EmojiStatusCollectible. + // Unique identifier of the collectible that may be used to create a collectible gift + // link »¹ for the current collectible, or to fetch further info about the collectible + // using payments.getUniqueStarGift². + // + // Links: + // 1) https://core.telegram.org/api/links#collectible-gift-link + // 2) https://core.telegram.org/method/payments.getUniqueStarGift Slug string - // PatternDocumentID field of EmojiStatusCollectible. + // The ID of a pattern to apply on the profile's backdrop, correlated to the + // starGiftAttributePattern¹ from the gift in slug. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftAttributePattern PatternDocumentID int64 - // CenterColor field of EmojiStatusCollectible. + // Color of the center of the profile backdrop in RGB24 format, from the gift's + // starGiftAttributeBackdrop¹. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftAttributeBackdrop CenterColor int - // EdgeColor field of EmojiStatusCollectible. + // Color of the edges of the profile backdrop in RGB24 format, from the gift's + // starGiftAttributeBackdrop¹. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftAttributeBackdrop EdgeColor int - // PatternColor field of EmojiStatusCollectible. + // Color of the pattern_document_id applied on the profile backdrop in RGB24 format, from + // the gift's starGiftAttributeBackdrop¹. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftAttributeBackdrop PatternColor int - // TextColor field of EmojiStatusCollectible. + // Color of text on the profile backdrop in RGB24 format, from the gift's + // starGiftAttributeBackdrop¹. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftAttributeBackdrop TextColor int - // Until field of EmojiStatusCollectible. + // If set, the emoji status will be active until the specified unixtime. // // Use SetUntil and GetUntil helpers. Until int @@ -763,6 +803,18 @@ func (e *EmojiStatusCollectible) GetUntil() (value int, ok bool) { } // InputEmojiStatusCollectible represents TL type `inputEmojiStatusCollectible#7141dbf`. +// An owned collectible gift »¹ as emoji status: can only be used in account +// updateEmojiStatus², is never returned by the API. +// Note that once set, the status will be returned to users as a emojiStatusCollectible¹ +// constructor, instead (which cannot be passed to account.updateEmojiStatus², and must +// be converted to an inputEmojiStatusCollectible³ first). +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/method/account.updateEmojiStatus +// 3. https://core.telegram.org/constructor/emojiStatusCollectible +// 4. https://core.telegram.org/method/account.updateEmojiStatus +// 5. https://core.telegram.org/constructor/inputEmojiStatusCollectible // // See https://core.telegram.org/constructor/inputEmojiStatusCollectible for reference. type InputEmojiStatusCollectible struct { @@ -771,9 +823,12 @@ type InputEmojiStatusCollectible struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // CollectibleID field of InputEmojiStatusCollectible. + // ID of the collectible (from starGiftUnique¹.id). + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftUnique CollectibleID int64 - // Until field of InputEmojiStatusCollectible. + // If set, the emoji status will be active until the specified unixtime. // // Use SetUntil and GetUntil helpers. Until int @@ -1032,7 +1087,7 @@ type NotEmptyEmojiStatus interface { // Zero returns true if current object has a zero value. Zero() bool - // Until field of EmojiStatus. + // If set, the emoji status will be active until the specified unixtime. GetUntil() (value int, ok bool) } diff --git a/tg/tl_errors_gen.go b/tg/tl_errors_gen.go index e1a0a86646..6c7e25d17f 100644 --- a/tg/tl_errors_gen.go +++ b/tg/tl_errors_gen.go @@ -44,7 +44,9 @@ const ( ErrAdminRankInvalid = "ADMIN_RANK_INVALID" ErrAdminRightsEmpty = "ADMIN_RIGHTS_EMPTY" ErrAlbumPhotosTooMany = "ALBUM_PHOTOS_TOO_MANY" + ErrAllowPaymentRequired = "ALLOW_PAYMENT_REQUIRED" ErrAnonymousReactionsDisabled = "ANONYMOUS_REACTIONS_DISABLED" + ErrAPIGiftRestrictedUpdateApp = "API_GIFT_RESTRICTED_UPDATE_APP" ErrAPIIDInvalid = "API_ID_INVALID" ErrAPIIDPublishedFlood = "API_ID_PUBLISHED_FLOOD" ErrArticleTitleEmpty = "ARTICLE_TITLE_EMPTY" @@ -67,6 +69,7 @@ const ( ErrBoostsRequired = "BOOSTS_REQUIRED" ErrBoostPeerInvalid = "BOOST_PEER_INVALID" ErrBotsTooMuch = "BOTS_TOO_MUCH" + ErrBotAccessForbidden = "BOT_ACCESS_FORBIDDEN" ErrBotAlreadyDisabled = "BOT_ALREADY_DISABLED" ErrBotAppBotInvalid = "BOT_APP_BOT_INVALID" ErrBotAppInvalid = "BOT_APP_INVALID" @@ -76,6 +79,7 @@ const ( ErrBotCommandDescriptionInvalid = "BOT_COMMAND_DESCRIPTION_INVALID" ErrBotCommandInvalid = "BOT_COMMAND_INVALID" ErrBotDomainInvalid = "BOT_DOMAIN_INVALID" + ErrBotFallbackUnsupported = "BOT_FALLBACK_UNSUPPORTED" ErrBotGamesDisabled = "BOT_GAMES_DISABLED" ErrBotGroupsBlocked = "BOT_GROUPS_BLOCKED" ErrBotInlineDisabled = "BOT_INLINE_DISABLED" @@ -86,12 +90,14 @@ const ( ErrBotPaymentsDisabled = "BOT_PAYMENTS_DISABLED" ErrBotResponseTimeout = "BOT_RESPONSE_TIMEOUT" ErrBotScoreNotModified = "BOT_SCORE_NOT_MODIFIED" + ErrBotVerifierForbidden = "BOT_VERIFIER_FORBIDDEN" ErrBotWebviewDisabled = "BOT_WEBVIEW_DISABLED" ErrBroadcastForbidden = "BROADCAST_FORBIDDEN" ErrBroadcastIDInvalid = "BROADCAST_ID_INVALID" ErrBroadcastPublicVotersForbidden = "BROADCAST_PUBLIC_VOTERS_FORBIDDEN" ErrBroadcastRequired = "BROADCAST_REQUIRED" ErrBusinessAddressActive = "BUSINESS_ADDRESS_ACTIVE" + ErrBusinessConnectionInvalid = "BUSINESS_CONNECTION_INVALID" ErrBusinessPeerInvalid = "BUSINESS_PEER_INVALID" ErrBusinessPeerUsageMissing = "BUSINESS_PEER_USAGE_MISSING" ErrBusinessRecipientsEmpty = "BUSINESS_RECIPIENTS_EMPTY" @@ -100,6 +106,7 @@ const ( ErrButtonCopyTextInvalid = "BUTTON_COPY_TEXT_INVALID" ErrButtonDataInvalid = "BUTTON_DATA_INVALID" ErrButtonIDInvalid = "BUTTON_ID_INVALID" + ErrButtonInvalid = "BUTTON_INVALID" ErrButtonPosInvalid = "BUTTON_POS_INVALID" ErrButtonTextInvalid = "BUTTON_TEXT_INVALID" ErrButtonTypeInvalid = "BUTTON_TYPE_INVALID" @@ -112,6 +119,7 @@ const ( ErrCallPeerInvalid = "CALL_PEER_INVALID" ErrCallProtocolCompatLayerInvalid = "CALL_PROTOCOL_COMPAT_LAYER_INVALID" ErrCallProtocolFlagsInvalid = "CALL_PROTOCOL_FLAGS_INVALID" + ErrCallProtocolLayerInvalid = "CALL_PROTOCOL_LAYER_INVALID" ErrCDNMethodInvalid = "CDN_METHOD_INVALID" ErrCDNUploadTimeout = "CDN_UPLOAD_TIMEOUT" ErrChannelsAdminLocatedTooMuch = "CHANNELS_ADMIN_LOCATED_TOO_MUCH" @@ -119,12 +127,15 @@ const ( ErrChannelsTooMuch = "CHANNELS_TOO_MUCH" ErrChannelIDInvalid = "CHANNEL_ID_INVALID" ErrChannelInvalid = "CHANNEL_INVALID" + ErrChannelMonoforumUnsupported = "CHANNEL_MONOFORUM_UNSUPPORTED" ErrChannelParicipantMissing = "CHANNEL_PARICIPANT_MISSING" ErrChannelPrivate = "CHANNEL_PRIVATE" ErrChannelPublicGroupNa = "CHANNEL_PUBLIC_GROUP_NA" ErrChannelTooBig = "CHANNEL_TOO_BIG" ErrChannelTooLarge = "CHANNEL_TOO_LARGE" ErrChargeAlreadyRefunded = "CHARGE_ALREADY_REFUNDED" + ErrChargeIDEmpty = "CHARGE_ID_EMPTY" + ErrChargeIDInvalid = "CHARGE_ID_INVALID" ErrChatlinksTooMuch = "CHATLINKS_TOO_MUCH" ErrChatlinkSlugEmpty = "CHATLINK_SLUG_EMPTY" ErrChatlinkSlugExpired = "CHATLINK_SLUG_EXPIRED" @@ -162,6 +173,7 @@ const ( ErrChatSendStickersForbidden = "CHAT_SEND_STICKERS_FORBIDDEN" ErrChatSendVideosForbidden = "CHAT_SEND_VIDEOS_FORBIDDEN" ErrChatSendVoicesForbidden = "CHAT_SEND_VOICES_FORBIDDEN" + ErrChatSendWebpageForbidden = "CHAT_SEND_WEBPAGE_FORBIDDEN" ErrChatTitleEmpty = "CHAT_TITLE_EMPTY" ErrChatTooBig = "CHAT_TOO_BIG" ErrChatTypeInvalid = "CHAT_TYPE_INVALID" @@ -184,6 +196,7 @@ const ( ErrCreateCallFailed = "CREATE_CALL_FAILED" ErrCurrencyTotalAmountInvalid = "CURRENCY_TOTAL_AMOUNT_INVALID" ErrCustomReactionsTooMany = "CUSTOM_REACTIONS_TOO_MANY" + ErrDataHashSizeInvalid = "DATA_HASH_SIZE_INVALID" ErrDataInvalid = "DATA_INVALID" ErrDataJSONInvalid = "DATA_JSON_INVALID" ErrDataTooLong = "DATA_TOO_LONG" @@ -192,6 +205,7 @@ const ( ErrDhGAInvalid = "DH_G_A_INVALID" ErrDocumentInvalid = "DOCUMENT_INVALID" ErrEditBotInviteForbidden = "EDIT_BOT_INVITE_FORBIDDEN" + ErrEffectIDInvalid = "EFFECT_ID_INVALID" ErrEmailHashExpired = "EMAIL_HASH_EXPIRED" ErrEmailInvalid = "EMAIL_INVALID" ErrEmailNotAllowed = "EMAIL_NOT_ALLOWED" @@ -213,8 +227,10 @@ const ( ErrEntityBoundsInvalid = "ENTITY_BOUNDS_INVALID" ErrEntityMentionUserInvalid = "ENTITY_MENTION_USER_INVALID" ErrErrorTextEmpty = "ERROR_TEXT_EMPTY" + ErrExpiresAtInvalid = "EXPIRES_AT_INVALID" ErrExpireDateInvalid = "EXPIRE_DATE_INVALID" ErrExtendedMediaAmountInvalid = "EXTENDED_MEDIA_AMOUNT_INVALID" + ErrExtendedMediaInvalid = "EXTENDED_MEDIA_INVALID" ErrExternalURLInvalid = "EXTERNAL_URL_INVALID" ErrFilerefUpgradeNeeded = "FILEREF_UPGRADE_NEEDED" ErrFileContentTypeInvalid = "FILE_CONTENT_TYPE_INVALID" @@ -242,6 +258,7 @@ const ( ErrFolderIDInvalid = "FOLDER_ID_INVALID" ErrFormExpired = "FORM_EXPIRED" ErrFormIDEmpty = "FORM_ID_EMPTY" + ErrFormSubmitDuplicate = "FORM_SUBMIT_DUPLICATE" ErrFormUnsupported = "FORM_UNSUPPORTED" ErrForumEnabled = "FORUM_ENABLED" ErrFreshChangeAdminsForbidden = "FRESH_CHANGE_ADMINS_FORBIDDEN" @@ -249,10 +266,14 @@ const ( ErrFreshResetAuthorisationForbidden = "FRESH_RESET_AUTHORISATION_FORBIDDEN" ErrFromMessageBotDisabled = "FROM_MESSAGE_BOT_DISABLED" ErrFromPeerInvalid = "FROM_PEER_INVALID" + ErrFrozenMethodInvalid = "FROZEN_METHOD_INVALID" + ErrFrozenParticipantMissing = "FROZEN_PARTICIPANT_MISSING" ErrGameBotInvalid = "GAME_BOT_INVALID" ErrGeoPointInvalid = "GEO_POINT_INVALID" + ErrGiftMonthsInvalid = "GIFT_MONTHS_INVALID" ErrGiftSlugExpired = "GIFT_SLUG_EXPIRED" ErrGiftSlugInvalid = "GIFT_SLUG_INVALID" + ErrGiftStarsInvalid = "GIFT_STARS_INVALID" ErrGifContentTypeInvalid = "GIF_CONTENT_TYPE_INVALID" ErrGifIDInvalid = "GIF_ID_INVALID" ErrGraphExpiredReload = "GRAPH_EXPIRED_RELOAD" @@ -268,6 +289,7 @@ const ( ErrGroupedMediaInvalid = "GROUPED_MEDIA_INVALID" ErrHashtagInvalid = "HASHTAG_INVALID" ErrHashInvalid = "HASH_INVALID" + ErrHashSizeInvalid = "HASH_SIZE_INVALID" ErrHideRequesterMissing = "HIDE_REQUESTER_MISSING" ErrIDExpired = "ID_EXPIRED" ErrIDInvalid = "ID_INVALID" @@ -283,6 +305,7 @@ const ( ErrInputFileInvalid = "INPUT_FILE_INVALID" ErrInputFilterInvalid = "INPUT_FILTER_INVALID" ErrInputPeersEmpty = "INPUT_PEERS_EMPTY" + ErrInputPurposeInvalid = "INPUT_PURPOSE_INVALID" ErrInputTextEmpty = "INPUT_TEXT_EMPTY" ErrInputTextTooLong = "INPUT_TEXT_TOO_LONG" ErrInputUserDeactivated = "INPUT_USER_DEACTIVATED" @@ -296,6 +319,7 @@ const ( ErrInviteSlugEmpty = "INVITE_SLUG_EMPTY" ErrInviteSlugExpired = "INVITE_SLUG_EXPIRED" ErrInviteSlugInvalid = "INVITE_SLUG_INVALID" + ErrInvoiceInvalid = "INVOICE_INVALID" ErrInvoicePayloadInvalid = "INVOICE_PAYLOAD_INVALID" ErrJoinAsPeerInvalid = "JOIN_AS_PEER_INVALID" ErrLanguageInvalid = "LANGUAGE_INVALID" @@ -310,6 +334,7 @@ const ( ErrMaxIDInvalid = "MAX_ID_INVALID" ErrMaxQtsInvalid = "MAX_QTS_INVALID" ErrMD5ChecksumInvalid = "MD5_CHECKSUM_INVALID" + ErrMediaAlreadyPaid = "MEDIA_ALREADY_PAID" ErrMediaCaptionTooLong = "MEDIA_CAPTION_TOO_LONG" ErrMediaEmpty = "MEDIA_EMPTY" ErrMediaFileInvalid = "MEDIA_FILE_INVALID" @@ -337,8 +362,10 @@ const ( ErrMessageTooOld = "MESSAGE_TOO_OLD" ErrMethodInvalid = "METHOD_INVALID" ErrMinDateInvalid = "MIN_DATE_INVALID" + ErrMonthInvalid = "MONTH_INVALID" ErrMsgIDInvalid = "MSG_ID_INVALID" ErrMsgTooOld = "MSG_TOO_OLD" + ErrMsgVoiceMissing = "MSG_VOICE_MISSING" ErrMsgWaitFailed = "MSG_WAIT_FAILED" ErrMultiMediaTooLong = "MULTI_MEDIA_TOO_LONG" ErrNewSaltInvalid = "NEW_SALT_INVALID" @@ -347,6 +374,7 @@ const ( ErrNextOffsetInvalid = "NEXT_OFFSET_INVALID" ErrNotEligible = "NOT_ELIGIBLE" ErrNotJoined = "NOT_JOINED" + ErrNoPaymentNeeded = "NO_PAYMENT_NEEDED" ErrOffsetInvalid = "OFFSET_INVALID" ErrOffsetPeerIDInvalid = "OFFSET_PEER_ID_INVALID" ErrOptionsTooMuch = "OPTIONS_TOO_MUCH" @@ -355,6 +383,8 @@ const ( ErrPackShortNameInvalid = "PACK_SHORT_NAME_INVALID" ErrPackShortNameOccupied = "PACK_SHORT_NAME_OCCUPIED" ErrPackTitleInvalid = "PACK_TITLE_INVALID" + ErrPackTypeInvalid = "PACK_TYPE_INVALID" + ErrParentPeerInvalid = "PARENT_PEER_INVALID" ErrParticipantsTooFew = "PARTICIPANTS_TOO_FEW" ErrParticipantIDInvalid = "PARTICIPANT_ID_INVALID" ErrParticipantJoinMissing = "PARTICIPANT_JOIN_MISSING" @@ -366,7 +396,9 @@ const ( ErrPasswordRecoveryNa = "PASSWORD_RECOVERY_NA" ErrPasswordRequired = "PASSWORD_REQUIRED" ErrPasswordTooFresh = "PASSWORD_TOO_FRESH" + ErrPaymentCredentialsInvalid = "PAYMENT_CREDENTIALS_INVALID" ErrPaymentProviderInvalid = "PAYMENT_PROVIDER_INVALID" + ErrPaymentRequired = "PAYMENT_REQUIRED" ErrPaymentUnsupported = "PAYMENT_UNSUPPORTED" ErrPeersListEmpty = "PEERS_LIST_EMPTY" ErrPeerHistoryEmpty = "PEER_HISTORY_EMPTY" @@ -409,7 +441,9 @@ const ( ErrPollOptionInvalid = "POLL_OPTION_INVALID" ErrPollQuestionInvalid = "POLL_QUESTION_INVALID" ErrPollVoteRequired = "POLL_VOTE_REQUIRED" + ErrPrecheckoutFailed = "PRECHECKOUT_FAILED" ErrPremiumAccountRequired = "PREMIUM_ACCOUNT_REQUIRED" + ErrPremiumCurrentlyUnavailable = "PREMIUM_CURRENTLY_UNAVAILABLE" ErrPremiumSubActiveUntil = "PREMIUM_SUB_ACTIVE_UNTIL" ErrPreviousChatImportActiveWaitMin = "PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_MIN" ErrPricingChatInvalid = "PRICING_CHAT_INVALID" @@ -419,9 +453,11 @@ const ( ErrPrivacyValueInvalid = "PRIVACY_VALUE_INVALID" ErrPublicChannelMissing = "PUBLIC_CHANNEL_MISSING" ErrPublicKeyRequired = "PUBLIC_KEY_REQUIRED" + ErrPurposeInvalid = "PURPOSE_INVALID" ErrQueryIDEmpty = "QUERY_ID_EMPTY" ErrQueryIDInvalid = "QUERY_ID_INVALID" ErrQueryTooShort = "QUERY_TOO_SHORT" + ErrQuickRepliesBotNotAllowed = "QUICK_REPLIES_BOT_NOT_ALLOWED" ErrQuickRepliesTooMuch = "QUICK_REPLIES_TOO_MUCH" ErrQuizAnswerMissing = "QUIZ_ANSWER_MISSING" ErrQuizCorrectAnswersEmpty = "QUIZ_CORRECT_ANSWERS_EMPTY" @@ -432,9 +468,11 @@ const ( ErrRaiseHandForbidden = "RAISE_HAND_FORBIDDEN" ErrRandomIDDuplicate = "RANDOM_ID_DUPLICATE" ErrRandomIDEmpty = "RANDOM_ID_EMPTY" + ErrRandomIDExpired = "RANDOM_ID_EXPIRED" ErrRandomIDInvalid = "RANDOM_ID_INVALID" ErrRandomLengthInvalid = "RANDOM_LENGTH_INVALID" ErrRangesInvalid = "RANGES_INVALID" + ErrReactionsCountInvalid = "REACTIONS_COUNT_INVALID" ErrReactionsTooMany = "REACTIONS_TOO_MANY" ErrReactionEmpty = "REACTION_EMPTY" ErrReactionInvalid = "REACTION_INVALID" @@ -446,6 +484,7 @@ const ( ErrReplyMessagesTooMuch = "REPLY_MESSAGES_TOO_MUCH" ErrReplyMessageIDInvalid = "REPLY_MESSAGE_ID_INVALID" ErrReplyToInvalid = "REPLY_TO_INVALID" + ErrReplyToMonoforumPeerInvalid = "REPLY_TO_MONOFORUM_PEER_INVALID" ErrReplyToUserInvalid = "REPLY_TO_USER_INVALID" ErrRequestTokenInvalid = "REQUEST_TOKEN_INVALID" ErrResetRequestMissing = "RESET_REQUEST_MISSING" @@ -460,6 +499,7 @@ const ( ErrRingtoneInvalid = "RINGTONE_INVALID" ErrRingtoneMimeInvalid = "RINGTONE_MIME_INVALID" ErrRsaDecryptFailed = "RSA_DECRYPT_FAILED" + ErrSavedIDEmpty = "SAVED_ID_EMPTY" ErrScheduleBotNotAllowed = "SCHEDULE_BOT_NOT_ALLOWED" ErrScheduleDateInvalid = "SCHEDULE_DATE_INVALID" ErrScheduleDateTooLate = "SCHEDULE_DATE_TOO_LATE" @@ -470,9 +510,11 @@ const ( ErrSearchWithLinkNotSupported = "SEARCH_WITH_LINK_NOT_SUPPORTED" ErrSecondsInvalid = "SECONDS_INVALID" ErrSecureSecretRequired = "SECURE_SECRET_REQUIRED" + ErrSelfDeleteRestricted = "SELF_DELETE_RESTRICTED" ErrSendAsPeerInvalid = "SEND_AS_PEER_INVALID" ErrSendCodeUnavailable = "SEND_CODE_UNAVAILABLE" ErrSendMediaInvalid = "SEND_MEDIA_INVALID" + ErrSendMessageGameInvalid = "SEND_MESSAGE_GAME_INVALID" ErrSendMessageMediaInvalid = "SEND_MESSAGE_MEDIA_INVALID" ErrSendMessageTypeInvalid = "SEND_MESSAGE_TYPE_INVALID" ErrSensitiveChangeForbidden = "SENSITIVE_CHANGE_FORBIDDEN" @@ -492,13 +534,27 @@ const ( ErrSRPAInvalid = "SRP_A_INVALID" ErrSRPIDInvalid = "SRP_ID_INVALID" ErrSRPPasswordChanged = "SRP_PASSWORD_CHANGED" + ErrStargiftAlreadyConverted = "STARGIFT_ALREADY_CONVERTED" + ErrStargiftAlreadyRefunded = "STARGIFT_ALREADY_REFUNDED" + ErrStargiftAlreadyUpgraded = "STARGIFT_ALREADY_UPGRADED" + ErrStargiftExportInProgress = "STARGIFT_EXPORT_IN_PROGRESS" ErrStargiftInvalid = "STARGIFT_INVALID" + ErrStargiftNotFound = "STARGIFT_NOT_FOUND" + ErrStargiftOwnerInvalid = "STARGIFT_OWNER_INVALID" + ErrStargiftPeerInvalid = "STARGIFT_PEER_INVALID" + ErrStargiftResellCurrencyNotAllowed = "STARGIFT_RESELL_CURRENCY_NOT_ALLOWED" + ErrStargiftSlugInvalid = "STARGIFT_SLUG_INVALID" + ErrStargiftTransferTooEarly = "STARGIFT_TRANSFER_TOO_EARLY" + ErrStargiftUpgradeUnavailable = "STARGIFT_UPGRADE_UNAVAILABLE" ErrStargiftUsageLimited = "STARGIFT_USAGE_LIMITED" + ErrStargiftUserUsageLimited = "STARGIFT_USER_USAGE_LIMITED" ErrStarrefAwaitingEnd = "STARREF_AWAITING_END" ErrStarrefExpired = "STARREF_EXPIRED" ErrStarrefHashRevoked = "STARREF_HASH_REVOKED" ErrStarrefPermilleInvalid = "STARREF_PERMILLE_INVALID" ErrStarrefPermilleTooLow = "STARREF_PERMILLE_TOO_LOW" + ErrStarsAmountInvalid = "STARS_AMOUNT_INVALID" + ErrStarsFormAmountMismatch = "STARS_FORM_AMOUNT_MISMATCH" ErrStarsInvoiceInvalid = "STARS_INVOICE_INVALID" ErrStarsPaymentRequired = "STARS_PAYMENT_REQUIRED" ErrStartParamEmpty = "START_PARAM_EMPTY" @@ -534,7 +590,10 @@ const ( ErrStorySendFloodMonthly = "STORY_SEND_FLOOD_MONTHLY" ErrStorySendFloodWeekly = "STORY_SEND_FLOOD_WEEKLY" ErrSubscriptionExportMissing = "SUBSCRIPTION_EXPORT_MISSING" + ErrSubscriptionIDInvalid = "SUBSCRIPTION_ID_INVALID" ErrSubscriptionPeriodInvalid = "SUBSCRIPTION_PERIOD_INVALID" + ErrSuggestedPostAmountInvalid = "SUGGESTED_POST_AMOUNT_INVALID" + ErrSuggestedPostPeerInvalid = "SUGGESTED_POST_PEER_INVALID" ErrSwitchPmTextEmpty = "SWITCH_PM_TEXT_EMPTY" ErrSwitchWebviewURLInvalid = "SWITCH_WEBVIEW_URL_INVALID" ErrTakeoutInitDelay = "TAKEOUT_INIT_DELAY" @@ -549,27 +608,35 @@ const ( ErrThemeInvalid = "THEME_INVALID" ErrThemeMimeInvalid = "THEME_MIME_INVALID" ErrThemeParamsInvalid = "THEME_PARAMS_INVALID" + ErrThemeSlugInvalid = "THEME_SLUG_INVALID" ErrThemeTitleInvalid = "THEME_TITLE_INVALID" ErrTimezoneInvalid = "TIMEZONE_INVALID" ErrTitleInvalid = "TITLE_INVALID" ErrTmpPasswordDisabled = "TMP_PASSWORD_DISABLED" ErrTmpPasswordInvalid = "TMP_PASSWORD_INVALID" + ErrTodoItemsEmpty = "TODO_ITEMS_EMPTY" + ErrTodoItemDuplicate = "TODO_ITEM_DUPLICATE" + ErrTodoNotModified = "TODO_NOT_MODIFIED" ErrTokenEmpty = "TOKEN_EMPTY" ErrTokenInvalid = "TOKEN_INVALID" ErrTokenTypeInvalid = "TOKEN_TYPE_INVALID" ErrTopicClosed = "TOPIC_CLOSED" ErrTopicDeleted = "TOPIC_DELETED" ErrTopicIDInvalid = "TOPIC_ID_INVALID" + ErrToIDInvalid = "TO_ID_INVALID" ErrToLangInvalid = "TO_LANG_INVALID" ErrTransactionIDInvalid = "TRANSACTION_ID_INVALID" ErrTranscriptionFailed = "TRANSCRIPTION_FAILED" ErrTranslateReqFailed = "TRANSLATE_REQ_FAILED" ErrTranslateReqQuotaExceeded = "TRANSLATE_REQ_QUOTA_EXCEEDED" + ErrTranslationsDisabled = "TRANSLATIONS_DISABLED" + ErrTranslationTimeout = "TRANSLATION_TIMEOUT" ErrTTLDaysInvalid = "TTL_DAYS_INVALID" ErrTTLMediaInvalid = "TTL_MEDIA_INVALID" ErrTTLPeriodInvalid = "TTL_PERIOD_INVALID" ErrTypesEmpty = "TYPES_EMPTY" ErrTimeout = "Timeout" + ErrUnsupported = "UNSUPPORTED" ErrUntilDateInvalid = "UNTIL_DATE_INVALID" ErrUpdateAppToLogin = "UPDATE_APP_TO_LOGIN" ErrURLInvalid = "URL_INVALID" @@ -603,6 +670,7 @@ const ( ErrUserKicked = "USER_KICKED" ErrUserNotMutualContact = "USER_NOT_MUTUAL_CONTACT" ErrUserNotParticipant = "USER_NOT_PARTICIPANT" + ErrUserPermissionDenied = "USER_PERMISSION_DENIED" ErrUserPrivacyRestricted = "USER_PRIVACY_RESTRICTED" ErrUserPublicMissing = "USER_PUBLIC_MISSING" ErrUserRestricted = "USER_RESTRICTED" @@ -690,11 +758,21 @@ func IsAlbumPhotosTooMany(err error) bool { return tgerr.Is(err, ErrAlbumPhotosTooMany) } +// IsAllowPaymentRequired reports whether err is ALLOW_PAYMENT_REQUIRED. +func IsAllowPaymentRequired(err error) bool { + return tgerr.Is(err, ErrAllowPaymentRequired) +} + // IsAnonymousReactionsDisabled reports whether err is ANONYMOUS_REACTIONS_DISABLED. func IsAnonymousReactionsDisabled(err error) bool { return tgerr.Is(err, ErrAnonymousReactionsDisabled) } +// IsAPIGiftRestrictedUpdateApp reports whether err is API_GIFT_RESTRICTED_UPDATE_APP. +func IsAPIGiftRestrictedUpdateApp(err error) bool { + return tgerr.Is(err, ErrAPIGiftRestrictedUpdateApp) +} + // IsAPIIDInvalid reports whether err is API_ID_INVALID. func IsAPIIDInvalid(err error) bool { return tgerr.Is(err, ErrAPIIDInvalid) @@ -805,6 +883,11 @@ func IsBotsTooMuch(err error) bool { return tgerr.Is(err, ErrBotsTooMuch) } +// IsBotAccessForbidden reports whether err is BOT_ACCESS_FORBIDDEN. +func IsBotAccessForbidden(err error) bool { + return tgerr.Is(err, ErrBotAccessForbidden) +} + // IsBotAlreadyDisabled reports whether err is BOT_ALREADY_DISABLED. func IsBotAlreadyDisabled(err error) bool { return tgerr.Is(err, ErrBotAlreadyDisabled) @@ -850,6 +933,11 @@ func IsBotDomainInvalid(err error) bool { return tgerr.Is(err, ErrBotDomainInvalid) } +// IsBotFallbackUnsupported reports whether err is BOT_FALLBACK_UNSUPPORTED. +func IsBotFallbackUnsupported(err error) bool { + return tgerr.Is(err, ErrBotFallbackUnsupported) +} + // IsBotGamesDisabled reports whether err is BOT_GAMES_DISABLED. func IsBotGamesDisabled(err error) bool { return tgerr.Is(err, ErrBotGamesDisabled) @@ -900,6 +988,11 @@ func IsBotScoreNotModified(err error) bool { return tgerr.Is(err, ErrBotScoreNotModified) } +// IsBotVerifierForbidden reports whether err is BOT_VERIFIER_FORBIDDEN. +func IsBotVerifierForbidden(err error) bool { + return tgerr.Is(err, ErrBotVerifierForbidden) +} + // IsBotWebviewDisabled reports whether err is BOT_WEBVIEW_DISABLED. func IsBotWebviewDisabled(err error) bool { return tgerr.Is(err, ErrBotWebviewDisabled) @@ -930,6 +1023,11 @@ func IsBusinessAddressActive(err error) bool { return tgerr.Is(err, ErrBusinessAddressActive) } +// IsBusinessConnectionInvalid reports whether err is BUSINESS_CONNECTION_INVALID. +func IsBusinessConnectionInvalid(err error) bool { + return tgerr.Is(err, ErrBusinessConnectionInvalid) +} + // IsBusinessPeerInvalid reports whether err is BUSINESS_PEER_INVALID. func IsBusinessPeerInvalid(err error) bool { return tgerr.Is(err, ErrBusinessPeerInvalid) @@ -970,6 +1068,11 @@ func IsButtonIDInvalid(err error) bool { return tgerr.Is(err, ErrButtonIDInvalid) } +// IsButtonInvalid reports whether err is BUTTON_INVALID. +func IsButtonInvalid(err error) bool { + return tgerr.Is(err, ErrButtonInvalid) +} + // IsButtonPosInvalid reports whether err is BUTTON_POS_INVALID. func IsButtonPosInvalid(err error) bool { return tgerr.Is(err, ErrButtonPosInvalid) @@ -1030,6 +1133,11 @@ func IsCallProtocolFlagsInvalid(err error) bool { return tgerr.Is(err, ErrCallProtocolFlagsInvalid) } +// IsCallProtocolLayerInvalid reports whether err is CALL_PROTOCOL_LAYER_INVALID. +func IsCallProtocolLayerInvalid(err error) bool { + return tgerr.Is(err, ErrCallProtocolLayerInvalid) +} + // IsCDNMethodInvalid reports whether err is CDN_METHOD_INVALID. func IsCDNMethodInvalid(err error) bool { return tgerr.Is(err, ErrCDNMethodInvalid) @@ -1065,6 +1173,11 @@ func IsChannelInvalid(err error) bool { return tgerr.Is(err, ErrChannelInvalid) } +// IsChannelMonoforumUnsupported reports whether err is CHANNEL_MONOFORUM_UNSUPPORTED. +func IsChannelMonoforumUnsupported(err error) bool { + return tgerr.Is(err, ErrChannelMonoforumUnsupported) +} + // IsChannelParicipantMissing reports whether err is CHANNEL_PARICIPANT_MISSING. func IsChannelParicipantMissing(err error) bool { return tgerr.Is(err, ErrChannelParicipantMissing) @@ -1095,6 +1208,16 @@ func IsChargeAlreadyRefunded(err error) bool { return tgerr.Is(err, ErrChargeAlreadyRefunded) } +// IsChargeIDEmpty reports whether err is CHARGE_ID_EMPTY. +func IsChargeIDEmpty(err error) bool { + return tgerr.Is(err, ErrChargeIDEmpty) +} + +// IsChargeIDInvalid reports whether err is CHARGE_ID_INVALID. +func IsChargeIDInvalid(err error) bool { + return tgerr.Is(err, ErrChargeIDInvalid) +} + // IsChatlinksTooMuch reports whether err is CHATLINKS_TOO_MUCH. func IsChatlinksTooMuch(err error) bool { return tgerr.Is(err, ErrChatlinksTooMuch) @@ -1280,6 +1403,11 @@ func IsChatSendVoicesForbidden(err error) bool { return tgerr.Is(err, ErrChatSendVoicesForbidden) } +// IsChatSendWebpageForbidden reports whether err is CHAT_SEND_WEBPAGE_FORBIDDEN. +func IsChatSendWebpageForbidden(err error) bool { + return tgerr.Is(err, ErrChatSendWebpageForbidden) +} + // IsChatTitleEmpty reports whether err is CHAT_TITLE_EMPTY. func IsChatTitleEmpty(err error) bool { return tgerr.Is(err, ErrChatTitleEmpty) @@ -1390,6 +1518,11 @@ func IsCustomReactionsTooMany(err error) bool { return tgerr.Is(err, ErrCustomReactionsTooMany) } +// IsDataHashSizeInvalid reports whether err is DATA_HASH_SIZE_INVALID. +func IsDataHashSizeInvalid(err error) bool { + return tgerr.Is(err, ErrDataHashSizeInvalid) +} + // IsDataInvalid reports whether err is DATA_INVALID. func IsDataInvalid(err error) bool { return tgerr.Is(err, ErrDataInvalid) @@ -1430,6 +1563,11 @@ func IsEditBotInviteForbidden(err error) bool { return tgerr.Is(err, ErrEditBotInviteForbidden) } +// IsEffectIDInvalid reports whether err is EFFECT_ID_INVALID. +func IsEffectIDInvalid(err error) bool { + return tgerr.Is(err, ErrEffectIDInvalid) +} + // IsEmailHashExpired reports whether err is EMAIL_HASH_EXPIRED. func IsEmailHashExpired(err error) bool { return tgerr.Is(err, ErrEmailHashExpired) @@ -1535,6 +1673,11 @@ func IsErrorTextEmpty(err error) bool { return tgerr.Is(err, ErrErrorTextEmpty) } +// IsExpiresAtInvalid reports whether err is EXPIRES_AT_INVALID. +func IsExpiresAtInvalid(err error) bool { + return tgerr.Is(err, ErrExpiresAtInvalid) +} + // IsExpireDateInvalid reports whether err is EXPIRE_DATE_INVALID. func IsExpireDateInvalid(err error) bool { return tgerr.Is(err, ErrExpireDateInvalid) @@ -1545,6 +1688,11 @@ func IsExtendedMediaAmountInvalid(err error) bool { return tgerr.Is(err, ErrExtendedMediaAmountInvalid) } +// IsExtendedMediaInvalid reports whether err is EXTENDED_MEDIA_INVALID. +func IsExtendedMediaInvalid(err error) bool { + return tgerr.Is(err, ErrExtendedMediaInvalid) +} + // IsExternalURLInvalid reports whether err is EXTERNAL_URL_INVALID. func IsExternalURLInvalid(err error) bool { return tgerr.Is(err, ErrExternalURLInvalid) @@ -1680,6 +1828,11 @@ func IsFormIDEmpty(err error) bool { return tgerr.Is(err, ErrFormIDEmpty) } +// IsFormSubmitDuplicate reports whether err is FORM_SUBMIT_DUPLICATE. +func IsFormSubmitDuplicate(err error) bool { + return tgerr.Is(err, ErrFormSubmitDuplicate) +} + // IsFormUnsupported reports whether err is FORM_UNSUPPORTED. func IsFormUnsupported(err error) bool { return tgerr.Is(err, ErrFormUnsupported) @@ -1715,6 +1868,16 @@ func IsFromPeerInvalid(err error) bool { return tgerr.Is(err, ErrFromPeerInvalid) } +// IsFrozenMethodInvalid reports whether err is FROZEN_METHOD_INVALID. +func IsFrozenMethodInvalid(err error) bool { + return tgerr.Is(err, ErrFrozenMethodInvalid) +} + +// IsFrozenParticipantMissing reports whether err is FROZEN_PARTICIPANT_MISSING. +func IsFrozenParticipantMissing(err error) bool { + return tgerr.Is(err, ErrFrozenParticipantMissing) +} + // IsGameBotInvalid reports whether err is GAME_BOT_INVALID. func IsGameBotInvalid(err error) bool { return tgerr.Is(err, ErrGameBotInvalid) @@ -1725,6 +1888,11 @@ func IsGeoPointInvalid(err error) bool { return tgerr.Is(err, ErrGeoPointInvalid) } +// IsGiftMonthsInvalid reports whether err is GIFT_MONTHS_INVALID. +func IsGiftMonthsInvalid(err error) bool { + return tgerr.Is(err, ErrGiftMonthsInvalid) +} + // IsGiftSlugExpired reports whether err is GIFT_SLUG_EXPIRED. func IsGiftSlugExpired(err error) bool { return tgerr.Is(err, ErrGiftSlugExpired) @@ -1735,6 +1903,11 @@ func IsGiftSlugInvalid(err error) bool { return tgerr.Is(err, ErrGiftSlugInvalid) } +// IsGiftStarsInvalid reports whether err is GIFT_STARS_INVALID. +func IsGiftStarsInvalid(err error) bool { + return tgerr.Is(err, ErrGiftStarsInvalid) +} + // IsGifContentTypeInvalid reports whether err is GIF_CONTENT_TYPE_INVALID. func IsGifContentTypeInvalid(err error) bool { return tgerr.Is(err, ErrGifContentTypeInvalid) @@ -1810,6 +1983,11 @@ func IsHashInvalid(err error) bool { return tgerr.Is(err, ErrHashInvalid) } +// IsHashSizeInvalid reports whether err is HASH_SIZE_INVALID. +func IsHashSizeInvalid(err error) bool { + return tgerr.Is(err, ErrHashSizeInvalid) +} + // IsHideRequesterMissing reports whether err is HIDE_REQUESTER_MISSING. func IsHideRequesterMissing(err error) bool { return tgerr.Is(err, ErrHideRequesterMissing) @@ -1885,6 +2063,11 @@ func IsInputPeersEmpty(err error) bool { return tgerr.Is(err, ErrInputPeersEmpty) } +// IsInputPurposeInvalid reports whether err is INPUT_PURPOSE_INVALID. +func IsInputPurposeInvalid(err error) bool { + return tgerr.Is(err, ErrInputPurposeInvalid) +} + // IsInputTextEmpty reports whether err is INPUT_TEXT_EMPTY. func IsInputTextEmpty(err error) bool { return tgerr.Is(err, ErrInputTextEmpty) @@ -1950,6 +2133,11 @@ func IsInviteSlugInvalid(err error) bool { return tgerr.Is(err, ErrInviteSlugInvalid) } +// IsInvoiceInvalid reports whether err is INVOICE_INVALID. +func IsInvoiceInvalid(err error) bool { + return tgerr.Is(err, ErrInvoiceInvalid) +} + // IsInvoicePayloadInvalid reports whether err is INVOICE_PAYLOAD_INVALID. func IsInvoicePayloadInvalid(err error) bool { return tgerr.Is(err, ErrInvoicePayloadInvalid) @@ -2020,6 +2208,11 @@ func IsMD5ChecksumInvalid(err error) bool { return tgerr.Is(err, ErrMD5ChecksumInvalid) } +// IsMediaAlreadyPaid reports whether err is MEDIA_ALREADY_PAID. +func IsMediaAlreadyPaid(err error) bool { + return tgerr.Is(err, ErrMediaAlreadyPaid) +} + // IsMediaCaptionTooLong reports whether err is MEDIA_CAPTION_TOO_LONG. func IsMediaCaptionTooLong(err error) bool { return tgerr.Is(err, ErrMediaCaptionTooLong) @@ -2155,6 +2348,11 @@ func IsMinDateInvalid(err error) bool { return tgerr.Is(err, ErrMinDateInvalid) } +// IsMonthInvalid reports whether err is MONTH_INVALID. +func IsMonthInvalid(err error) bool { + return tgerr.Is(err, ErrMonthInvalid) +} + // IsMsgIDInvalid reports whether err is MSG_ID_INVALID. func IsMsgIDInvalid(err error) bool { return tgerr.Is(err, ErrMsgIDInvalid) @@ -2165,6 +2363,11 @@ func IsMsgTooOld(err error) bool { return tgerr.Is(err, ErrMsgTooOld) } +// IsMsgVoiceMissing reports whether err is MSG_VOICE_MISSING. +func IsMsgVoiceMissing(err error) bool { + return tgerr.Is(err, ErrMsgVoiceMissing) +} + // IsMsgWaitFailed reports whether err is MSG_WAIT_FAILED. func IsMsgWaitFailed(err error) bool { return tgerr.Is(err, ErrMsgWaitFailed) @@ -2205,6 +2408,11 @@ func IsNotJoined(err error) bool { return tgerr.Is(err, ErrNotJoined) } +// IsNoPaymentNeeded reports whether err is NO_PAYMENT_NEEDED. +func IsNoPaymentNeeded(err error) bool { + return tgerr.Is(err, ErrNoPaymentNeeded) +} + // IsOffsetInvalid reports whether err is OFFSET_INVALID. func IsOffsetInvalid(err error) bool { return tgerr.Is(err, ErrOffsetInvalid) @@ -2245,6 +2453,16 @@ func IsPackTitleInvalid(err error) bool { return tgerr.Is(err, ErrPackTitleInvalid) } +// IsPackTypeInvalid reports whether err is PACK_TYPE_INVALID. +func IsPackTypeInvalid(err error) bool { + return tgerr.Is(err, ErrPackTypeInvalid) +} + +// IsParentPeerInvalid reports whether err is PARENT_PEER_INVALID. +func IsParentPeerInvalid(err error) bool { + return tgerr.Is(err, ErrParentPeerInvalid) +} + // IsParticipantsTooFew reports whether err is PARTICIPANTS_TOO_FEW. func IsParticipantsTooFew(err error) bool { return tgerr.Is(err, ErrParticipantsTooFew) @@ -2300,11 +2518,21 @@ func IsPasswordTooFresh(err error) bool { return tgerr.Is(err, ErrPasswordTooFresh) } +// IsPaymentCredentialsInvalid reports whether err is PAYMENT_CREDENTIALS_INVALID. +func IsPaymentCredentialsInvalid(err error) bool { + return tgerr.Is(err, ErrPaymentCredentialsInvalid) +} + // IsPaymentProviderInvalid reports whether err is PAYMENT_PROVIDER_INVALID. func IsPaymentProviderInvalid(err error) bool { return tgerr.Is(err, ErrPaymentProviderInvalid) } +// IsPaymentRequired reports whether err is PAYMENT_REQUIRED. +func IsPaymentRequired(err error) bool { + return tgerr.Is(err, ErrPaymentRequired) +} + // IsPaymentUnsupported reports whether err is PAYMENT_UNSUPPORTED. func IsPaymentUnsupported(err error) bool { return tgerr.Is(err, ErrPaymentUnsupported) @@ -2515,11 +2743,21 @@ func IsPollVoteRequired(err error) bool { return tgerr.Is(err, ErrPollVoteRequired) } +// IsPrecheckoutFailed reports whether err is PRECHECKOUT_FAILED. +func IsPrecheckoutFailed(err error) bool { + return tgerr.Is(err, ErrPrecheckoutFailed) +} + // IsPremiumAccountRequired reports whether err is PREMIUM_ACCOUNT_REQUIRED. func IsPremiumAccountRequired(err error) bool { return tgerr.Is(err, ErrPremiumAccountRequired) } +// IsPremiumCurrentlyUnavailable reports whether err is PREMIUM_CURRENTLY_UNAVAILABLE. +func IsPremiumCurrentlyUnavailable(err error) bool { + return tgerr.Is(err, ErrPremiumCurrentlyUnavailable) +} + // IsPremiumSubActiveUntil reports whether err is PREMIUM_SUB_ACTIVE_UNTIL. func IsPremiumSubActiveUntil(err error) bool { return tgerr.Is(err, ErrPremiumSubActiveUntil) @@ -2565,6 +2803,11 @@ func IsPublicKeyRequired(err error) bool { return tgerr.Is(err, ErrPublicKeyRequired) } +// IsPurposeInvalid reports whether err is PURPOSE_INVALID. +func IsPurposeInvalid(err error) bool { + return tgerr.Is(err, ErrPurposeInvalid) +} + // IsQueryIDEmpty reports whether err is QUERY_ID_EMPTY. func IsQueryIDEmpty(err error) bool { return tgerr.Is(err, ErrQueryIDEmpty) @@ -2580,6 +2823,11 @@ func IsQueryTooShort(err error) bool { return tgerr.Is(err, ErrQueryTooShort) } +// IsQuickRepliesBotNotAllowed reports whether err is QUICK_REPLIES_BOT_NOT_ALLOWED. +func IsQuickRepliesBotNotAllowed(err error) bool { + return tgerr.Is(err, ErrQuickRepliesBotNotAllowed) +} + // IsQuickRepliesTooMuch reports whether err is QUICK_REPLIES_TOO_MUCH. func IsQuickRepliesTooMuch(err error) bool { return tgerr.Is(err, ErrQuickRepliesTooMuch) @@ -2630,6 +2878,11 @@ func IsRandomIDEmpty(err error) bool { return tgerr.Is(err, ErrRandomIDEmpty) } +// IsRandomIDExpired reports whether err is RANDOM_ID_EXPIRED. +func IsRandomIDExpired(err error) bool { + return tgerr.Is(err, ErrRandomIDExpired) +} + // IsRandomIDInvalid reports whether err is RANDOM_ID_INVALID. func IsRandomIDInvalid(err error) bool { return tgerr.Is(err, ErrRandomIDInvalid) @@ -2645,6 +2898,11 @@ func IsRangesInvalid(err error) bool { return tgerr.Is(err, ErrRangesInvalid) } +// IsReactionsCountInvalid reports whether err is REACTIONS_COUNT_INVALID. +func IsReactionsCountInvalid(err error) bool { + return tgerr.Is(err, ErrReactionsCountInvalid) +} + // IsReactionsTooMany reports whether err is REACTIONS_TOO_MANY. func IsReactionsTooMany(err error) bool { return tgerr.Is(err, ErrReactionsTooMany) @@ -2700,6 +2958,11 @@ func IsReplyToInvalid(err error) bool { return tgerr.Is(err, ErrReplyToInvalid) } +// IsReplyToMonoforumPeerInvalid reports whether err is REPLY_TO_MONOFORUM_PEER_INVALID. +func IsReplyToMonoforumPeerInvalid(err error) bool { + return tgerr.Is(err, ErrReplyToMonoforumPeerInvalid) +} + // IsReplyToUserInvalid reports whether err is REPLY_TO_USER_INVALID. func IsReplyToUserInvalid(err error) bool { return tgerr.Is(err, ErrReplyToUserInvalid) @@ -2770,6 +3033,11 @@ func IsRsaDecryptFailed(err error) bool { return tgerr.Is(err, ErrRsaDecryptFailed) } +// IsSavedIDEmpty reports whether err is SAVED_ID_EMPTY. +func IsSavedIDEmpty(err error) bool { + return tgerr.Is(err, ErrSavedIDEmpty) +} + // IsScheduleBotNotAllowed reports whether err is SCHEDULE_BOT_NOT_ALLOWED. func IsScheduleBotNotAllowed(err error) bool { return tgerr.Is(err, ErrScheduleBotNotAllowed) @@ -2820,6 +3088,11 @@ func IsSecureSecretRequired(err error) bool { return tgerr.Is(err, ErrSecureSecretRequired) } +// IsSelfDeleteRestricted reports whether err is SELF_DELETE_RESTRICTED. +func IsSelfDeleteRestricted(err error) bool { + return tgerr.Is(err, ErrSelfDeleteRestricted) +} + // IsSendAsPeerInvalid reports whether err is SEND_AS_PEER_INVALID. func IsSendAsPeerInvalid(err error) bool { return tgerr.Is(err, ErrSendAsPeerInvalid) @@ -2835,6 +3108,11 @@ func IsSendMediaInvalid(err error) bool { return tgerr.Is(err, ErrSendMediaInvalid) } +// IsSendMessageGameInvalid reports whether err is SEND_MESSAGE_GAME_INVALID. +func IsSendMessageGameInvalid(err error) bool { + return tgerr.Is(err, ErrSendMessageGameInvalid) +} + // IsSendMessageMediaInvalid reports whether err is SEND_MESSAGE_MEDIA_INVALID. func IsSendMessageMediaInvalid(err error) bool { return tgerr.Is(err, ErrSendMessageMediaInvalid) @@ -2930,16 +3208,76 @@ func IsSRPPasswordChanged(err error) bool { return tgerr.Is(err, ErrSRPPasswordChanged) } +// IsStargiftAlreadyConverted reports whether err is STARGIFT_ALREADY_CONVERTED. +func IsStargiftAlreadyConverted(err error) bool { + return tgerr.Is(err, ErrStargiftAlreadyConverted) +} + +// IsStargiftAlreadyRefunded reports whether err is STARGIFT_ALREADY_REFUNDED. +func IsStargiftAlreadyRefunded(err error) bool { + return tgerr.Is(err, ErrStargiftAlreadyRefunded) +} + +// IsStargiftAlreadyUpgraded reports whether err is STARGIFT_ALREADY_UPGRADED. +func IsStargiftAlreadyUpgraded(err error) bool { + return tgerr.Is(err, ErrStargiftAlreadyUpgraded) +} + +// IsStargiftExportInProgress reports whether err is STARGIFT_EXPORT_IN_PROGRESS. +func IsStargiftExportInProgress(err error) bool { + return tgerr.Is(err, ErrStargiftExportInProgress) +} + // IsStargiftInvalid reports whether err is STARGIFT_INVALID. func IsStargiftInvalid(err error) bool { return tgerr.Is(err, ErrStargiftInvalid) } +// IsStargiftNotFound reports whether err is STARGIFT_NOT_FOUND. +func IsStargiftNotFound(err error) bool { + return tgerr.Is(err, ErrStargiftNotFound) +} + +// IsStargiftOwnerInvalid reports whether err is STARGIFT_OWNER_INVALID. +func IsStargiftOwnerInvalid(err error) bool { + return tgerr.Is(err, ErrStargiftOwnerInvalid) +} + +// IsStargiftPeerInvalid reports whether err is STARGIFT_PEER_INVALID. +func IsStargiftPeerInvalid(err error) bool { + return tgerr.Is(err, ErrStargiftPeerInvalid) +} + +// IsStargiftResellCurrencyNotAllowed reports whether err is STARGIFT_RESELL_CURRENCY_NOT_ALLOWED. +func IsStargiftResellCurrencyNotAllowed(err error) bool { + return tgerr.Is(err, ErrStargiftResellCurrencyNotAllowed) +} + +// IsStargiftSlugInvalid reports whether err is STARGIFT_SLUG_INVALID. +func IsStargiftSlugInvalid(err error) bool { + return tgerr.Is(err, ErrStargiftSlugInvalid) +} + +// IsStargiftTransferTooEarly reports whether err is STARGIFT_TRANSFER_TOO_EARLY. +func IsStargiftTransferTooEarly(err error) bool { + return tgerr.Is(err, ErrStargiftTransferTooEarly) +} + +// IsStargiftUpgradeUnavailable reports whether err is STARGIFT_UPGRADE_UNAVAILABLE. +func IsStargiftUpgradeUnavailable(err error) bool { + return tgerr.Is(err, ErrStargiftUpgradeUnavailable) +} + // IsStargiftUsageLimited reports whether err is STARGIFT_USAGE_LIMITED. func IsStargiftUsageLimited(err error) bool { return tgerr.Is(err, ErrStargiftUsageLimited) } +// IsStargiftUserUsageLimited reports whether err is STARGIFT_USER_USAGE_LIMITED. +func IsStargiftUserUsageLimited(err error) bool { + return tgerr.Is(err, ErrStargiftUserUsageLimited) +} + // IsStarrefAwaitingEnd reports whether err is STARREF_AWAITING_END. func IsStarrefAwaitingEnd(err error) bool { return tgerr.Is(err, ErrStarrefAwaitingEnd) @@ -2965,6 +3303,16 @@ func IsStarrefPermilleTooLow(err error) bool { return tgerr.Is(err, ErrStarrefPermilleTooLow) } +// IsStarsAmountInvalid reports whether err is STARS_AMOUNT_INVALID. +func IsStarsAmountInvalid(err error) bool { + return tgerr.Is(err, ErrStarsAmountInvalid) +} + +// IsStarsFormAmountMismatch reports whether err is STARS_FORM_AMOUNT_MISMATCH. +func IsStarsFormAmountMismatch(err error) bool { + return tgerr.Is(err, ErrStarsFormAmountMismatch) +} + // IsStarsInvoiceInvalid reports whether err is STARS_INVOICE_INVALID. func IsStarsInvoiceInvalid(err error) bool { return tgerr.Is(err, ErrStarsInvoiceInvalid) @@ -3140,11 +3488,26 @@ func IsSubscriptionExportMissing(err error) bool { return tgerr.Is(err, ErrSubscriptionExportMissing) } +// IsSubscriptionIDInvalid reports whether err is SUBSCRIPTION_ID_INVALID. +func IsSubscriptionIDInvalid(err error) bool { + return tgerr.Is(err, ErrSubscriptionIDInvalid) +} + // IsSubscriptionPeriodInvalid reports whether err is SUBSCRIPTION_PERIOD_INVALID. func IsSubscriptionPeriodInvalid(err error) bool { return tgerr.Is(err, ErrSubscriptionPeriodInvalid) } +// IsSuggestedPostAmountInvalid reports whether err is SUGGESTED_POST_AMOUNT_INVALID. +func IsSuggestedPostAmountInvalid(err error) bool { + return tgerr.Is(err, ErrSuggestedPostAmountInvalid) +} + +// IsSuggestedPostPeerInvalid reports whether err is SUGGESTED_POST_PEER_INVALID. +func IsSuggestedPostPeerInvalid(err error) bool { + return tgerr.Is(err, ErrSuggestedPostPeerInvalid) +} + // IsSwitchPmTextEmpty reports whether err is SWITCH_PM_TEXT_EMPTY. func IsSwitchPmTextEmpty(err error) bool { return tgerr.Is(err, ErrSwitchPmTextEmpty) @@ -3215,6 +3578,11 @@ func IsThemeParamsInvalid(err error) bool { return tgerr.Is(err, ErrThemeParamsInvalid) } +// IsThemeSlugInvalid reports whether err is THEME_SLUG_INVALID. +func IsThemeSlugInvalid(err error) bool { + return tgerr.Is(err, ErrThemeSlugInvalid) +} + // IsThemeTitleInvalid reports whether err is THEME_TITLE_INVALID. func IsThemeTitleInvalid(err error) bool { return tgerr.Is(err, ErrThemeTitleInvalid) @@ -3240,6 +3608,21 @@ func IsTmpPasswordInvalid(err error) bool { return tgerr.Is(err, ErrTmpPasswordInvalid) } +// IsTodoItemsEmpty reports whether err is TODO_ITEMS_EMPTY. +func IsTodoItemsEmpty(err error) bool { + return tgerr.Is(err, ErrTodoItemsEmpty) +} + +// IsTodoItemDuplicate reports whether err is TODO_ITEM_DUPLICATE. +func IsTodoItemDuplicate(err error) bool { + return tgerr.Is(err, ErrTodoItemDuplicate) +} + +// IsTodoNotModified reports whether err is TODO_NOT_MODIFIED. +func IsTodoNotModified(err error) bool { + return tgerr.Is(err, ErrTodoNotModified) +} + // IsTokenEmpty reports whether err is TOKEN_EMPTY. func IsTokenEmpty(err error) bool { return tgerr.Is(err, ErrTokenEmpty) @@ -3270,6 +3653,11 @@ func IsTopicIDInvalid(err error) bool { return tgerr.Is(err, ErrTopicIDInvalid) } +// IsToIDInvalid reports whether err is TO_ID_INVALID. +func IsToIDInvalid(err error) bool { + return tgerr.Is(err, ErrToIDInvalid) +} + // IsToLangInvalid reports whether err is TO_LANG_INVALID. func IsToLangInvalid(err error) bool { return tgerr.Is(err, ErrToLangInvalid) @@ -3295,6 +3683,16 @@ func IsTranslateReqQuotaExceeded(err error) bool { return tgerr.Is(err, ErrTranslateReqQuotaExceeded) } +// IsTranslationsDisabled reports whether err is TRANSLATIONS_DISABLED. +func IsTranslationsDisabled(err error) bool { + return tgerr.Is(err, ErrTranslationsDisabled) +} + +// IsTranslationTimeout reports whether err is TRANSLATION_TIMEOUT. +func IsTranslationTimeout(err error) bool { + return tgerr.Is(err, ErrTranslationTimeout) +} + // IsTTLDaysInvalid reports whether err is TTL_DAYS_INVALID. func IsTTLDaysInvalid(err error) bool { return tgerr.Is(err, ErrTTLDaysInvalid) @@ -3320,6 +3718,11 @@ func IsTimeout(err error) bool { return tgerr.Is(err, ErrTimeout) } +// IsUnsupported reports whether err is UNSUPPORTED. +func IsUnsupported(err error) bool { + return tgerr.Is(err, ErrUnsupported) +} + // IsUntilDateInvalid reports whether err is UNTIL_DATE_INVALID. func IsUntilDateInvalid(err error) bool { return tgerr.Is(err, ErrUntilDateInvalid) @@ -3485,6 +3888,11 @@ func IsUserNotParticipant(err error) bool { return tgerr.Is(err, ErrUserNotParticipant) } +// IsUserPermissionDenied reports whether err is USER_PERMISSION_DENIED. +func IsUserPermissionDenied(err error) bool { + return tgerr.Is(err, ErrUserPermissionDenied) +} + // IsUserPrivacyRestricted reports whether err is USER_PRIVACY_RESTRICTED. func IsUserPrivacyRestricted(err error) bool { return tgerr.Is(err, ErrUserPrivacyRestricted) diff --git a/tg/tl_global_privacy_settings_gen.go b/tg/tl_global_privacy_settings_gen.go index 3dfab82057..5adca296f5 100644 --- a/tg/tl_global_privacy_settings_gen.go +++ b/tg/tl_global_privacy_settings_gen.go @@ -68,37 +68,33 @@ type GlobalPrivacySettings struct { // 4) https://core.telegram.org/method/messages.getOutboxReadDate // 5) https://core.telegram.org/constructor/userFull HideReadMarks bool - // If set, only users that have a premium account, are in our contact list, or already - // have a private chat with us can write to us; a 403 PRIVACY_PREMIUM_REQUIRED error will - // be emitted otherwise. The userFull¹.contact_require_premium flag will be set for - // users that have this flag enabled. To check whether we can write to a user with this - // flag enabled, if we haven't yet cached all the required information (for example we - // don't have the userFull² or history of all users while displaying the chat list in - // the sharing UI) the users.getIsPremiumRequiredToContact³ method may be invoked, - // passing the list of users currently visible in the UI, returning a list of booleans - // that directly specify whether we can or cannot write to each user. This option may be - // enabled by both non-Premium⁴ and Premium⁵ users only if the - // new_noncontact_peers_require_premium_without_ownpremium client configuration flag - // »⁶ is equal to true, otherwise it may be enabled only by Premium⁷ users and - // non-Premium users will receive a PREMIUM_ACCOUNT_REQUIRED error when trying to enable - // this flag. + // See here for more info on this flag »¹. + // + // Links: + // 1) https://core.telegram.org/api/privacy#require-premium-for-new-non-contact-users + NewNoncontactPeersRequirePremium bool + // Enables or disables our userFull¹.display_gifts_button flag: if the userFull² + // display_gifts_button flag of both us and another user is set, a gift button should + // always be displayed in the text field in private chats with the other user: once + // clicked, the gift UI should be displayed, offering the user options to gift Telegram + // Premium »³ subscriptions or Telegram Gifts »⁴. // // Links: // 1) https://core.telegram.org/constructor/userFull // 2) https://core.telegram.org/constructor/userFull - // 3) https://core.telegram.org/method/users.getIsPremiumRequiredToContact - // 4) https://core.telegram.org/api/premium - // 5) https://core.telegram.org/api/premium - // 6) https://core.telegram.org/api/config#new-noncontact-peers-require-premium-without-ownpremium - // 7) https://core.telegram.org/api/premium - NewNoncontactPeersRequirePremium bool - // DisplayGiftsButton field of GlobalPrivacySettings. + // 3) https://core.telegram.org/api/premium#gifting-telegram-premium + // 4) https://core.telegram.org/api/gifts DisplayGiftsButton bool - // NoncontactPeersPaidStars field of GlobalPrivacySettings. + // If configured, specifies the number of stars¹ users must pay us to send us a message, + // see here »² for more info on paid messages. + // + // Links: + // 1) https://core.telegram.org/api/stars + // 2) https://core.telegram.org/api/paid-messages // // Use SetNoncontactPeersPaidStars and GetNoncontactPeersPaidStars helpers. NoncontactPeersPaidStars int64 - // DisallowedGifts field of GlobalPrivacySettings. + // Disallows the reception of specific gift types. // // Use SetDisallowedGifts and GetDisallowedGifts helpers. DisallowedGifts DisallowedGiftsSettings diff --git a/tg/tl_group_call_gen.go b/tg/tl_group_call_gen.go index bd78f1e8e2..1f083a3df1 100644 --- a/tg/tl_group_call_gen.go +++ b/tg/tl_group_call_gen.go @@ -256,9 +256,9 @@ type GroupCall struct { // Links: // 1) https://core.telegram.org/method/phone.getGroupParticipants ListenersHidden bool - // Conference field of GroupCall. + // Whether this is an E2E conference call. Conference bool - // Creator field of GroupCall. + // Whether we're created this group call. Creator bool // MessagesEnabled field of GroupCall. MessagesEnabled bool @@ -296,7 +296,7 @@ type GroupCall struct { UnmutedVideoLimit int // Version Version int - // InviteLink field of GroupCall. + // Invitation link for the conference. // // Use SetInviteLink and GetInviteLink helpers. InviteLink string diff --git a/tg/tl_help_get_cdn_config_gen.go b/tg/tl_help_get_cdn_config_gen.go index 565185e821..9267998789 100644 --- a/tg/tl_help_get_cdn_config_gen.go +++ b/tg/tl_help_get_cdn_config_gen.go @@ -138,7 +138,6 @@ func (g *HelpGetCDNConfigRequest) DecodeBare(b *bin.Buffer) error { // 1. https://core.telegram.org/cdn // // See https://core.telegram.org/method/help.getCdnConfig for reference. -// Can be used by bots. func (c *Client) HelpGetCDNConfig(ctx context.Context) (*CDNConfig, error) { var result CDNConfig diff --git a/tg/tl_help_get_config_gen.go b/tg/tl_help_get_config_gen.go index ba169369c2..117914e921 100644 --- a/tg/tl_help_get_config_gen.go +++ b/tg/tl_help_get_config_gen.go @@ -142,7 +142,6 @@ func (g *HelpGetConfigRequest) DecodeBare(b *bin.Buffer) error { // 403 USER_PRIVACY_RESTRICTED: The user's privacy settings do not allow you to do this. // // See https://core.telegram.org/method/help.getConfig for reference. -// Can be used by bots. func (c *Client) HelpGetConfig(ctx context.Context) (*Config, error) { var result Config diff --git a/tg/tl_help_get_promo_data_gen.go b/tg/tl_help_get_promo_data_gen.go index 2ac30fbffb..7a6844b58e 100644 --- a/tg/tl_help_get_promo_data_gen.go +++ b/tg/tl_help_get_promo_data_gen.go @@ -32,7 +32,11 @@ var ( ) // HelpGetPromoDataRequest represents TL type `help.getPromoData#c0977421`. -// Get MTProxy/Public Service Announcement information +// Returns a set of useful suggestions and PSA/MTProxy sponsored peers, see here »¹ for +// more info. +// +// Links: +// 1. https://core.telegram.org/api/config#suggestions // // See https://core.telegram.org/method/help.getPromoData for reference. type HelpGetPromoDataRequest struct { @@ -129,7 +133,11 @@ func (g *HelpGetPromoDataRequest) DecodeBare(b *bin.Buffer) error { } // HelpGetPromoData invokes method help.getPromoData#c0977421 returning error if any. -// Get MTProxy/Public Service Announcement information +// Returns a set of useful suggestions and PSA/MTProxy sponsored peers, see here »¹ for +// more info. +// +// Links: +// 1. https://core.telegram.org/api/config#suggestions // // See https://core.telegram.org/method/help.getPromoData for reference. func (c *Client) HelpGetPromoData(ctx context.Context) (HelpPromoDataClass, error) { diff --git a/tg/tl_help_promo_data_gen.go b/tg/tl_help_promo_data_gen.go index 944cd4bd37..15882bc8df 100644 --- a/tg/tl_help_promo_data_gen.go +++ b/tg/tl_help_promo_data_gen.go @@ -167,7 +167,11 @@ func (p *HelpPromoDataEmpty) GetExpires() (value int) { } // HelpPromoData represents TL type `help.promoData#8a4d87a`. -// MTProxy/Public Service Announcement information +// A set of useful suggestions and a PSA/MTProxy sponsored peer, see here »¹ for more +// info. +// +// Links: +// 1. https://core.telegram.org/api/config#suggestions // // See https://core.telegram.org/constructor/help.promoData for reference. type HelpPromoData struct { @@ -176,27 +180,41 @@ type HelpPromoData struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // MTProxy-related channel + // Set when connecting using an MTProxy that has configured an associated peer (that will + // be passed in peer, i.e. the channel that sponsored the MTProxy) that should be pinned + // on top of the chat list. Proxy bool - // Expiry of PSA/MTProxy info + // Unixtime when to re-invoke help.getPromoData¹. + // + // Links: + // 1) https://core.telegram.org/method/help.getPromoData Expires int // MTProxy/PSA peer // // Use SetPeer and GetPeer helpers. Peer PeerClass - // PSA type + // For Public Service Announcement peers, indicates the type of the PSA. // // Use SetPsaType and GetPsaType helpers. PsaType string - // PSA message + // For Public Service Announcement peers, contains the PSA itself. // // Use SetPsaMessage and GetPsaMessage helpers. PsaMessage string - // PendingSuggestions field of HelpPromoData. + // Contains a list of pending suggestions »¹. + // + // Links: + // 1) https://core.telegram.org/api/config#basic-suggestions PendingSuggestions []string - // DismissedSuggestions field of HelpPromoData. + // Contains a list of inverted suggestions »¹. + // + // Links: + // 1) https://core.telegram.org/api/config#inverted-suggestions DismissedSuggestions []string - // CustomPendingSuggestion field of HelpPromoData. + // Contains a list of custom pending suggestions »¹. + // + // Links: + // 1) https://core.telegram.org/api/config#custom-suggestions // // Use SetCustomPendingSuggestion and GetCustomPendingSuggestion helpers. CustomPendingSuggestion PendingSuggestion diff --git a/tg/tl_help_set_bot_updates_status_gen.go b/tg/tl_help_set_bot_updates_status_gen.go index 815ea3c277..108a439090 100644 --- a/tg/tl_help_set_bot_updates_status_gen.go +++ b/tg/tl_help_set_bot_updates_status_gen.go @@ -198,7 +198,6 @@ func (s *HelpSetBotUpdatesStatusRequest) GetMessage() (value string) { // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/help.setBotUpdatesStatus for reference. -// Can be used by bots. func (c *Client) HelpSetBotUpdatesStatus(ctx context.Context, request *HelpSetBotUpdatesStatusRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_input_business_bot_recipients_gen.go b/tg/tl_input_business_bot_recipients_gen.go index 1c13f6967f..0024fa37e4 100644 --- a/tg/tl_input_business_bot_recipients_gen.go +++ b/tg/tl_input_business_bot_recipients_gen.go @@ -35,7 +35,7 @@ var ( // Specifies the private chats that a connected business bot »¹ may interact with. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/constructor/inputBusinessBotRecipients for reference. type InputBusinessBotRecipients struct { diff --git a/tg/tl_input_chat_theme_gen.go b/tg/tl_input_chat_theme_gen.go index 31122497d1..043e492dc1 100644 --- a/tg/tl_input_chat_theme_gen.go +++ b/tg/tl_input_chat_theme_gen.go @@ -32,6 +32,7 @@ var ( ) // InputChatThemeEmpty represents TL type `inputChatThemeEmpty#83268483`. +// Remove any currently configured theme. // // See https://core.telegram.org/constructor/inputChatThemeEmpty for reference. type InputChatThemeEmpty struct { @@ -133,10 +134,14 @@ func (i *InputChatThemeEmpty) DecodeBare(b *bin.Buffer) error { } // InputChatTheme represents TL type `inputChatTheme#c93de95c`. +// Set an emoji-based chat theme, returned by account.getChatThemes¹. +// +// Links: +// 1. https://core.telegram.org/method/account.getChatThemes // // See https://core.telegram.org/constructor/inputChatTheme for reference. type InputChatTheme struct { - // Emoticon field of InputChatTheme. + // The emoji. Emoticon string } @@ -267,10 +272,19 @@ func (i *InputChatTheme) GetEmoticon() (value string) { } // InputChatThemeUniqueGift represents TL type `inputChatThemeUniqueGift#87e5dfe4`. +// Set a theme based on an owned collectible gift »¹, returned by account +// getUniqueGiftChatThemes². +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/method/account.getUniqueGiftChatThemes // // See https://core.telegram.org/constructor/inputChatThemeUniqueGift for reference. type InputChatThemeUniqueGift struct { - // Slug field of InputChatThemeUniqueGift. + // The slug from starGiftUnique¹.slug. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftUnique Slug string } diff --git a/tg/tl_input_document_gen.go b/tg/tl_input_document_gen.go index 7e81c0b3db..665e8975bd 100644 --- a/tg/tl_input_document_gen.go +++ b/tg/tl_input_document_gen.go @@ -148,7 +148,7 @@ type InputDocument struct { // File reference¹ // // Links: - // 1) https://core.telegram.org/api/file_reference + // 1) https://core.telegram.org/api/file-references FileReference []byte } diff --git a/tg/tl_input_file_location_gen.go b/tg/tl_input_file_location_gen.go index 2906e6a260..a606fd0ff9 100644 --- a/tg/tl_input_file_location_gen.go +++ b/tg/tl_input_file_location_gen.go @@ -45,7 +45,7 @@ type InputFileLocation struct { // File reference¹ // // Links: - // 1) https://core.telegram.org/api/file_reference + // 1) https://core.telegram.org/api/file-references FileReference []byte } @@ -433,7 +433,7 @@ type InputDocumentFileLocation struct { // File reference¹ // // Links: - // 1) https://core.telegram.org/api/file_reference + // 1) https://core.telegram.org/api/file-references FileReference []byte // Thumbnail size to download the thumbnail ThumbSize string @@ -940,7 +940,7 @@ type InputPhotoFileLocation struct { // File reference¹ // // Links: - // 1) https://core.telegram.org/api/file_reference + // 1) https://core.telegram.org/api/file-references FileReference []byte // The PhotoSize¹ to download: must be set to the type field of the desired PhotoSize // object of the photo² diff --git a/tg/tl_input_group_call_gen.go b/tg/tl_input_group_call_gen.go index 0f21e41a10..f9b75d9526 100644 --- a/tg/tl_input_group_call_gen.go +++ b/tg/tl_input_group_call_gen.go @@ -194,10 +194,17 @@ func (i *InputGroupCall) GetAccessHash() (value int64) { } // InputGroupCallSlug represents TL type `inputGroupCallSlug#fe06823f`. +// Join a conference call through an invitation link »¹. +// +// Links: +// 1. https://core.telegram.org/api/links#conference-links // // See https://core.telegram.org/constructor/inputGroupCallSlug for reference. type InputGroupCallSlug struct { - // Slug field of InputGroupCallSlug. + // Slug from the conference link »¹. + // + // Links: + // 1) https://core.telegram.org/api/links#conference-links Slug string } @@ -328,10 +335,17 @@ func (i *InputGroupCallSlug) GetSlug() (value string) { } // InputGroupCallInviteMessage represents TL type `inputGroupCallInviteMessage#8c10603f`. +// Join a group call through a messageActionConferenceCall¹ invitation message. +// +// Links: +// 1. https://core.telegram.org/constructor/messageActionConferenceCall // // See https://core.telegram.org/constructor/inputGroupCallInviteMessage for reference. type InputGroupCallInviteMessage struct { - // MsgID field of InputGroupCallInviteMessage. + // ID of the messageActionConferenceCall¹. + // + // Links: + // 1) https://core.telegram.org/constructor/messageActionConferenceCall MsgID int } diff --git a/tg/tl_input_invoice_gen.go b/tg/tl_input_invoice_gen.go index dba466d68c..fd61794613 100644 --- a/tg/tl_input_invoice_gen.go +++ b/tg/tl_input_invoice_gen.go @@ -835,9 +835,12 @@ type InputInvoiceStarGift struct { // If set, your name will be hidden if the destination user decides to display the gift // on their profile (they will still see that you sent the gift) HideName bool - // IncludeUpgrade field of InputInvoiceStarGift. + // Also pay for an eventual upgrade of the gift to a collectible gift »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts IncludeUpgrade bool - // Peer field of InputInvoiceStarGift. + // Receiver of the gift. Peer InputPeerClass // Identifier of the gift, from starGift¹.id // @@ -1137,6 +1140,12 @@ func (i *InputInvoiceStarGift) GetMessage() (value TextWithEntities, ok bool) { } // InputInvoiceStarGiftUpgrade represents TL type `inputInvoiceStarGiftUpgrade#4d818d5d`. +// Used to pay to upgrade a Gift to a collectible gift¹, see the collectible gifts »² +// documentation for more info on the full flow. +// +// Links: +// 1. https://core.telegram.org/api/gifts#upgrade-a-gift-to-a-collectible-gift +// 2. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/inputInvoiceStarGiftUpgrade for reference. type InputInvoiceStarGiftUpgrade struct { @@ -1145,9 +1154,13 @@ type InputInvoiceStarGiftUpgrade struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // KeepOriginalDetails field of InputInvoiceStarGiftUpgrade. + // Set this flag to keep the original gift text, sender and receiver in the upgraded gift + // as a starGiftAttributeOriginalDetails¹ attribute. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftAttributeOriginalDetails KeepOriginalDetails bool - // Stargift field of InputInvoiceStarGiftUpgrade. + // The identifier of the received gift to upgrade. Stargift InputSavedStarGiftClass } @@ -1332,12 +1345,18 @@ func (i *InputInvoiceStarGiftUpgrade) GetStargift() (value InputSavedStarGiftCla } // InputInvoiceStarGiftTransfer represents TL type `inputInvoiceStarGiftTransfer#4a5f5bd9`. +// Used to pay to transfer a collectible gift to another peer¹, see the gifts »² +// documentation for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts#transferring-collectible-gifts +// 2. https://core.telegram.org/api/gifts#transferring-collectible-gifts // // See https://core.telegram.org/constructor/inputInvoiceStarGiftTransfer for reference. type InputInvoiceStarGiftTransfer struct { - // Stargift field of InputInvoiceStarGiftTransfer. + // The identifier of the received gift Stargift InputSavedStarGiftClass - // ToID field of InputInvoiceStarGiftTransfer. + // The destination peer ToID InputPeerClass } @@ -1503,6 +1522,12 @@ func (i *InputInvoiceStarGiftTransfer) GetToID() (value InputPeerClass) { } // InputInvoicePremiumGiftStars represents TL type `inputInvoicePremiumGiftStars#dabab2ef`. +// Used to gift a Telegram Premium¹ subscription to another user, paying with Telegram +// Stars². +// +// Links: +// 1. https://core.telegram.org/api/premium +// 2. https://core.telegram.org/api/stars // // See https://core.telegram.org/constructor/inputInvoicePremiumGiftStars for reference. type InputInvoicePremiumGiftStars struct { @@ -1511,11 +1536,15 @@ type InputInvoicePremiumGiftStars struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // UserID field of InputInvoicePremiumGiftStars. + // Who will receive the gifted subscription. UserID InputUserClass - // Months field of InputInvoicePremiumGiftStars. + // Duration of the subscription in months, must be one of the options with currency == + // "XTR" returned by payments.getPremiumGiftCodeOptions¹. + // + // Links: + // 1) https://core.telegram.org/method/payments.getPremiumGiftCodeOptions Months int - // Message field of InputInvoicePremiumGiftStars. + // Message attached with the gift. // // Use SetMessage and GetMessage helpers. Message TextWithEntities @@ -1738,12 +1767,22 @@ func (i *InputInvoicePremiumGiftStars) GetMessage() (value TextWithEntities, ok } // InputInvoiceBusinessBotTransferStars represents TL type `inputInvoiceBusinessBotTransferStars#f4997e42`. +// Transfer stars from the balance of a user account connected to a business bot¹, to +// the balance of the business bot², see here »³ for more info on the full flow. +// +// Links: +// 1. https://core.telegram.org/api/bots/connected-business-bots +// 2. https://core.telegram.org/api/bots/connected-business-bots +// 3. https://core.telegram.org/api/stars#transferring-stars-from-a-business-account-to-the-business-bot // // See https://core.telegram.org/constructor/inputInvoiceBusinessBotTransferStars for reference. type InputInvoiceBusinessBotTransferStars struct { - // Bot field of InputInvoiceBusinessBotTransferStars. + // Always inputUserSelf¹. + // + // Links: + // 1) https://core.telegram.org/constructor/inputUserSelf Bot InputUserClass - // Stars field of InputInvoiceBusinessBotTransferStars. + // The number of stars to transfer. Stars int64 } @@ -1904,16 +1943,25 @@ func (i *InputInvoiceBusinessBotTransferStars) GetStars() (value int64) { } // InputInvoiceStarGiftResale represents TL type `inputInvoiceStarGiftResale#c39f5324`. +// Used to buy a collectible gift¹ currently up on resale, see here² for more info on +// the full flow. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/api/gifts#reselling-collectible-gifts // // See https://core.telegram.org/constructor/inputInvoiceStarGiftResale for reference. type InputInvoiceStarGiftResale struct { - // Flags field of InputInvoiceStarGiftResale. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Ton field of InputInvoiceStarGiftResale. + // Buy the gift using TON. Ton bool - // Slug field of InputInvoiceStarGiftResale. + // Slug of the gift to buy. Slug string - // ToID field of InputInvoiceStarGiftResale. + // The receiver of the gift. ToID InputPeerClass } @@ -2123,12 +2171,21 @@ func (i *InputInvoiceStarGiftResale) GetToID() (value InputPeerClass) { } // InputInvoiceStarGiftPrepaidUpgrade represents TL type `inputInvoiceStarGiftPrepaidUpgrade#9a0b48b8`. +// Separately prepay for the upgrade of a gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade // // See https://core.telegram.org/constructor/inputInvoiceStarGiftPrepaidUpgrade for reference. type InputInvoiceStarGiftPrepaidUpgrade struct { - // Peer field of InputInvoiceStarGiftPrepaidUpgrade. + // The peer that owns the gift. Peer InputPeerClass - // Hash field of InputInvoiceStarGiftPrepaidUpgrade. + // The upgrade hash from messageActionStarGift¹.prepaid_upgrade_hash or savedStarGift² + // prepaid_upgrade_hash. + // + // Links: + // 1) https://core.telegram.org/constructor/messageActionStarGift + // 2) https://core.telegram.org/constructor/savedStarGift Hash string } diff --git a/tg/tl_input_media_gen.go b/tg/tl_input_media_gen.go index 3ec36ecf07..064b21a72b 100644 --- a/tg/tl_input_media_gen.go +++ b/tg/tl_input_media_gen.go @@ -1092,11 +1092,11 @@ type InputMediaUploadedDocument struct { // // Use SetStickers and GetStickers helpers. Stickers []InputDocumentClass - // VideoCover field of InputMediaUploadedDocument. + // Start playing the video at the specified timestamp (seconds). // // Use SetVideoCover and GetVideoCover helpers. VideoCover InputPhotoClass - // VideoTimestamp field of InputMediaUploadedDocument. + // Start playing the video at the specified timestamp (seconds). // // Use SetVideoTimestamp and GetVideoTimestamp helpers. VideoTimestamp int @@ -1695,11 +1695,11 @@ type InputMediaDocument struct { Spoiler bool // The document to be forwarded. ID InputDocumentClass - // VideoCover field of InputMediaDocument. + // Custom video cover. // // Use SetVideoCover and GetVideoCover helpers. VideoCover InputPhotoClass - // VideoTimestamp field of InputMediaDocument. + // Start playing the video at the specified timestamp (seconds). // // Use SetVideoTimestamp and GetVideoTimestamp helpers. VideoTimestamp int @@ -2608,11 +2608,11 @@ type InputMediaDocumentExternal struct { // // Use SetTTLSeconds and GetTTLSeconds helpers. TTLSeconds int - // VideoCover field of InputMediaDocumentExternal. + // Custom video cover. // // Use SetVideoCover and GetVideoCover helpers. VideoCover InputPhotoClass - // VideoTimestamp field of InputMediaDocumentExternal. + // Start playing the video at the specified timestamp (seconds). // // Use SetVideoTimestamp and GetVideoTimestamp helpers. VideoTimestamp int @@ -5076,10 +5076,14 @@ func (i *InputMediaPaidMedia) MapExtendedMedia() (value InputMediaClassArray) { } // InputMediaTodo represents TL type `inputMediaTodo#9fc55fde`. +// Creates a todo list »¹. +// +// Links: +// 1. https://core.telegram.org/api/todo // // See https://core.telegram.org/constructor/inputMediaTodo for reference. type InputMediaTodo struct { - // Todo field of InputMediaTodo. + // The todo list. Todo TodoList } diff --git a/tg/tl_input_photo_gen.go b/tg/tl_input_photo_gen.go index 3d803c384e..ade71ecb29 100644 --- a/tg/tl_input_photo_gen.go +++ b/tg/tl_input_photo_gen.go @@ -148,7 +148,7 @@ type InputPhoto struct { // File reference¹ // // Links: - // 1) https://core.telegram.org/api/file_reference + // 1) https://core.telegram.org/api/file-references FileReference []byte } diff --git a/tg/tl_input_privacy_key_gen.go b/tg/tl_input_privacy_key_gen.go index d75992fa98..bcc4ae95a8 100644 --- a/tg/tl_input_privacy_key_gen.go +++ b/tg/tl_input_privacy_key_gen.go @@ -1278,6 +1278,10 @@ func (i *InputPrivacyKeyStarGiftsAutoSave) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyNoPaidMessages represents TL type `inputPrivacyKeyNoPaidMessages#bdc597b4`. +// Who can send you messages without paying, if paid messages »¹ are enabled. +// +// Links: +// 1. https://core.telegram.org/api/paid-messages // // See https://core.telegram.org/constructor/inputPrivacyKeyNoPaidMessages for reference. type InputPrivacyKeyNoPaidMessages struct { diff --git a/tg/tl_input_privacy_rule_gen.go b/tg/tl_input_privacy_rule_gen.go index 3b62f195e4..6163f6784a 100644 --- a/tg/tl_input_privacy_rule_gen.go +++ b/tg/tl_input_privacy_rule_gen.go @@ -760,7 +760,13 @@ func (i *InputPrivacyValueDisallowUsers) MapUsers() (value InputUserClassArray) // // See https://core.telegram.org/constructor/inputPrivacyValueAllowChatParticipants for reference. type InputPrivacyValueAllowChatParticipants struct { - // Allowed chat IDs + // Allowed chat IDs (either a chat¹ or a supergroup² ID, verbatim the way it is + // received in the constructor (i.e. unlike with bot API IDs, here group and supergroup + // IDs should be treated in the same way)). + // + // Links: + // 1) https://core.telegram.org/constructor/chat + // 2) https://core.telegram.org/constructor/channel Chats []int64 } @@ -908,7 +914,13 @@ func (i *InputPrivacyValueAllowChatParticipants) GetChats() (value []int64) { // // See https://core.telegram.org/constructor/inputPrivacyValueDisallowChatParticipants for reference. type InputPrivacyValueDisallowChatParticipants struct { - // Disallowed chat IDs + // Disallowed chat IDs (either a chat¹ or a supergroup² ID, verbatim the way it is + // received in the constructor (i.e. unlike with bot API IDs, here group and supergroup + // IDs should be treated in the same way)). + // + // Links: + // 1) https://core.telegram.org/constructor/chat + // 2) https://core.telegram.org/constructor/channel Chats []int64 } diff --git a/tg/tl_input_reply_to_gen.go b/tg/tl_input_reply_to_gen.go index 0d7ceb935b..726eae83a9 100644 --- a/tg/tl_input_reply_to_gen.go +++ b/tg/tl_input_reply_to_gen.go @@ -78,11 +78,18 @@ type InputReplyToMessage struct { // // Use SetQuoteOffset and GetQuoteOffset helpers. QuoteOffset int - // MonoforumPeerID field of InputReplyToMessage. + // Must be set to the ID of the topic when replying to a message within a monoforum + // topic¹. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetMonoforumPeerID and GetMonoforumPeerID helpers. MonoforumPeerID InputPeerClass - // TodoItemID field of InputReplyToMessage. + // Can be set to reply to the specified item of a todo list »¹. + // + // Links: + // 1) https://core.telegram.org/api/todo // // Use SetTodoItemID and GetTodoItemID helpers. TodoItemID int @@ -742,10 +749,14 @@ func (i *InputReplyToStory) GetStoryID() (value int) { } // InputReplyToMonoForum represents TL type `inputReplyToMonoForum#69d66c45`. +// Used to send messages to a monoforum topic¹. +// +// Links: +// 1. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/constructor/inputReplyToMonoForum for reference. type InputReplyToMonoForum struct { - // MonoforumPeerID field of InputReplyToMonoForum. + // The topic ID. MonoforumPeerID InputPeerClass } diff --git a/tg/tl_input_saved_star_gift_gen.go b/tg/tl_input_saved_star_gift_gen.go index 33bd32c714..7df551a317 100644 --- a/tg/tl_input_saved_star_gift_gen.go +++ b/tg/tl_input_saved_star_gift_gen.go @@ -32,10 +32,15 @@ var ( ) // InputSavedStarGiftUser represents TL type `inputSavedStarGiftUser#69279795`. +// A gift received in a private chat with another user. // // See https://core.telegram.org/constructor/inputSavedStarGiftUser for reference. type InputSavedStarGiftUser struct { - // MsgID field of InputSavedStarGiftUser. + // ID of the messageService¹ with the messageActionStarGift² with the gift. + // + // Links: + // 1) https://core.telegram.org/constructor/messageService + // 2) https://core.telegram.org/constructor/messageActionStarGift MsgID int } @@ -166,12 +171,18 @@ func (i *InputSavedStarGiftUser) GetMsgID() (value int) { } // InputSavedStarGiftChat represents TL type `inputSavedStarGiftChat#f101aa7f`. +// A gift received by a channel we own. // // See https://core.telegram.org/constructor/inputSavedStarGiftChat for reference. type InputSavedStarGiftChat struct { - // Peer field of InputSavedStarGiftChat. + // The channel. Peer InputPeerClass - // SavedID field of InputSavedStarGiftChat. + // ID of the gift, must be the saved_id of a + // messageActionStarGift¹/messageActionStarGiftUnique² constructor. + // + // Links: + // 1) https://core.telegram.org/constructor/messageActionStarGift + // 2) https://core.telegram.org/constructor/messageActionStarGiftUnique SavedID int64 } @@ -332,10 +343,14 @@ func (i *InputSavedStarGiftChat) GetSavedID() (value int64) { } // InputSavedStarGiftSlug represents TL type `inputSavedStarGiftSlug#2085c238`. +// Points to a collectible gift obtained from a collectible gift link »¹. +// +// Links: +// 1. https://core.telegram.org/api/links#collectible-gift-link // // See https://core.telegram.org/constructor/inputSavedStarGiftSlug for reference. type InputSavedStarGiftSlug struct { - // Slug field of InputSavedStarGiftSlug. + // Slug from the link. Slug string } diff --git a/tg/tl_input_sticker_set_gen.go b/tg/tl_input_sticker_set_gen.go index 61478deefc..26287a57f0 100644 --- a/tg/tl_input_sticker_set_gen.go +++ b/tg/tl_input_sticker_set_gen.go @@ -1304,6 +1304,7 @@ func (i *InputStickerSetEmojiChannelDefaultStatuses) DecodeBare(b *bin.Buffer) e } // InputStickerSetTonGifts represents TL type `inputStickerSetTonGifts#1cf671a0`. +// TON gifts stickerset. // // See https://core.telegram.org/constructor/inputStickerSetTonGifts for reference. type InputStickerSetTonGifts struct { diff --git a/tg/tl_input_store_payment_purpose_gen.go b/tg/tl_input_store_payment_purpose_gen.go index 80f214747a..174b079a0d 100644 --- a/tg/tl_input_store_payment_purpose_gen.go +++ b/tg/tl_input_store_payment_purpose_gen.go @@ -1358,7 +1358,10 @@ func (i *InputStorePaymentPremiumGiveaway) MapAdditionalPeers() (value InputPeer // // See https://core.telegram.org/constructor/inputStorePaymentStarsTopup for reference. type InputStorePaymentStarsTopup struct { - // Flags field of InputStorePaymentStarsTopup. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Amount of stars to topup Stars int64 @@ -1375,7 +1378,10 @@ type InputStorePaymentStarsTopup struct { // Links: // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 - // SpendPurposePeer field of InputStorePaymentStarsTopup. + // Should be populated with the peer where the topup process was initiated due to low + // funds (i.e. a bot for bot payments, a channel for paid media/reactions, etc); leave + // this flag unpopulated if the topup flow was not initated when attempting to spend more + // Stars than currently available on the account's balance. // // Use SetSpendPurposePeer and GetSpendPurposePeer helpers. SpendPurposePeer InputPeerClass @@ -2467,6 +2473,7 @@ func (i *InputStorePaymentStarsGiveaway) MapAdditionalPeers() (value InputPeerCl } // InputStorePaymentAuthCode represents TL type `inputStorePaymentAuthCode#9bb2636d`. +// Indicates payment for a login code. // // See https://core.telegram.org/constructor/inputStorePaymentAuthCode for reference. type InputStorePaymentAuthCode struct { @@ -2475,15 +2482,27 @@ type InputStorePaymentAuthCode struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Restore field of InputStorePaymentAuthCode. + // Set this flag to restore a previously made purchase. Restore bool - // PhoneNumber field of InputStorePaymentAuthCode. + // Phone number. PhoneNumber string - // PhoneCodeHash field of InputStorePaymentAuthCode. + // phone_code_hash returned by auth.sendCode¹. + // + // Links: + // 1) https://core.telegram.org/method/auth.sendCode PhoneCodeHash string - // Currency field of InputStorePaymentAuthCode. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of InputStorePaymentAuthCode. + // Price of the product in the smallest units of the currency (integer, not float/double) + // For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 } diff --git a/tg/tl_invoke_with_business_connection_gen.go b/tg/tl_invoke_with_business_connection_gen.go index c85475d7a9..5ffe515ca1 100644 --- a/tg/tl_invoke_with_business_connection_gen.go +++ b/tg/tl_invoke_with_business_connection_gen.go @@ -39,7 +39,7 @@ var ( // being used. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // 2. https://core.telegram.org/constructor/botBusinessConnection // // See https://core.telegram.org/constructor/invokeWithBusinessConnection for reference. diff --git a/tg/tl_invoke_with_re_captcha_gen.go b/tg/tl_invoke_with_re_captcha_gen.go index b285d3185d..41d0e08200 100644 --- a/tg/tl_invoke_with_re_captcha_gen.go +++ b/tg/tl_invoke_with_re_captcha_gen.go @@ -32,12 +32,15 @@ var ( ) // InvokeWithReCaptchaRequest represents TL type `invokeWithReCaptcha#adbb0f94`. +// Official clients only: re-execute a method call that required reCAPTCHA verification +// via a RECAPTCHA_CHECK_%s__%s, where the first placeholder is the action, and the +// second one is the reCAPTCHA key ID. // // See https://core.telegram.org/constructor/invokeWithReCaptcha for reference. type InvokeWithReCaptchaRequest struct { - // Token field of InvokeWithReCaptchaRequest. + // reCAPTCHA token received after verification. Token string - // Query field of InvokeWithReCaptchaRequest. + // The original method call. Query bin.Object } diff --git a/tg/tl_media_area_coordinates_gen.go b/tg/tl_media_area_coordinates_gen.go index a3ba8b642c..0b7b750f9f 100644 --- a/tg/tl_media_area_coordinates_gen.go +++ b/tg/tl_media_area_coordinates_gen.go @@ -32,7 +32,7 @@ var ( ) // MediaAreaCoordinates represents TL type `mediaAreaCoordinates#cfc9e002`. -// Coordinates and size of a clicable rectangular area on top of a story. +// Coordinates and size of a clickable rectangular area on top of a story. // // See https://core.telegram.org/constructor/mediaAreaCoordinates for reference. type MediaAreaCoordinates struct { diff --git a/tg/tl_media_area_gen.go b/tg/tl_media_area_gen.go index 52e4ef2fc4..13ae0e30a5 100644 --- a/tg/tl_media_area_gen.go +++ b/tg/tl_media_area_gen.go @@ -1814,12 +1814,20 @@ func (m *MediaAreaWeather) GetColor() (value int) { } // MediaAreaStarGift represents TL type `mediaAreaStarGift#5787686d`. +// Represents a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/mediaAreaStarGift for reference. type MediaAreaStarGift struct { - // Coordinates field of MediaAreaStarGift. + // Coordinates of the media area. Coordinates MediaAreaCoordinates - // Slug field of MediaAreaStarGift. + // slug from starGiftUnique¹.slug, that can be resolved as specified here »². + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftUnique + // 2) https://core.telegram.org/api/gifts#sharing-and-getting-info-about-a-collectible-gift Slug string } diff --git a/tg/tl_message_action_gen.go b/tg/tl_message_action_gen.go index 11343a007f..2b00ec1fd2 100644 --- a/tg/tl_message_action_gen.go +++ b/tg/tl_message_action_gen.go @@ -5002,7 +5002,7 @@ func (m *MessageActionGroupCallScheduled) GetScheduleDate() (value int) { // // See https://core.telegram.org/constructor/messageActionSetChatTheme for reference. type MessageActionSetChatTheme struct { - // Theme field of MessageActionSetChatTheme. + // The new chat theme. Theme ChatThemeClass } @@ -5554,6 +5554,12 @@ func (m *MessageActionWebViewDataSent) GetText() (value string) { // MessageActionGiftPremium represents TL type `messageActionGiftPremium#6c6274fa`. // Info about a gifted Telegram Premium subscription +// This service message should be displayed below the appropriate sticker from the +// inputStickerSetPremiumGifts »¹ stickerset »²: +// +// Links: +// 1. https://core.telegram.org/constructor/inputStickerSetPremiumGifts +// 2. https://core.telegram.org/api/stickers#stickersets // // See https://core.telegram.org/constructor/messageActionGiftPremium for reference. type MessageActionGiftPremium struct { @@ -5575,7 +5581,7 @@ type MessageActionGiftPremium struct { // Links: // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 - // Duration of the gifted Telegram Premium subscription + // Duration of the gifted Telegram Premium subscription. Months int // If the gift was bought using a cryptocurrency, the cryptocurrency name. // @@ -8717,9 +8723,13 @@ func (m *MessageActionPaymentRefunded) GetCharge() (value PaymentCharge) { // MessageActionGiftStars represents TL type `messageActionGiftStars#45d5b021`. // You gifted or were gifted some Telegram Stars¹. +// This service message should be displayed below the appropriate sticker from the +// inputStickerSetPremiumGifts »¹ stickerset »²: // // Links: // 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/constructor/inputStickerSetPremiumGifts +// 3. https://core.telegram.org/api/stickers#stickersets // // See https://core.telegram.org/constructor/messageActionGiftStars for reference. type MessageActionGiftStars struct { @@ -9084,10 +9094,14 @@ func (m *MessageActionGiftStars) GetTransactionID() (value string, ok bool) { // MessageActionPrizeStars represents TL type `messageActionPrizeStars#b00c47a2`. // You won some Telegram Stars¹ in a Telegram Star giveaway »². +// This service message should be displayed below the appropriate sticker from the +// inputStickerSetPremiumGifts »¹ stickerset »²: // // Links: // 1. https://core.telegram.org/api/stars // 2. https://core.telegram.org/api/giveaways#star-giveaways +// 3. https://core.telegram.org/constructor/inputStickerSetPremiumGifts +// 4. https://core.telegram.org/api/stickers#stickersets // // See https://core.telegram.org/constructor/messageActionPrizeStars for reference. type MessageActionPrizeStars struct { @@ -9385,11 +9399,11 @@ type MessageActionStarGift struct { // decides to display the gift on their profile NameHidden bool // Whether this gift was added to the destination user's profile (may be toggled using - // payments.saveStarGift¹ and fetched using payments.getUserStarGifts²) + // payments.saveStarGift¹ and fetched using payments.getSavedStarGifts²) // // Links: // 1) https://core.telegram.org/method/payments.saveStarGift - // 2) https://core.telegram.org/method/payments.getUserStarGifts + // 2) https://core.telegram.org/method/payments.getSavedStarGifts Saved bool // Whether this gift was converted to Telegram Stars¹ and cannot be displayed on the // profile anymore. @@ -9397,15 +9411,27 @@ type MessageActionStarGift struct { // Links: // 1) https://core.telegram.org/api/stars Converted bool - // Upgraded field of MessageActionStarGift. + // This gift was upgraded to a collectible gift »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts Upgraded bool - // Refunded field of MessageActionStarGift. + // This gift is not available anymore because a request to refund the payment related to + // this gift was made, and the money was returned. Refunded bool - // CanUpgrade field of MessageActionStarGift. + // If set, this gift can be upgraded to a collectible gift¹; can only be set for the + // receiver of a gift. + // + // Links: + // 1) https://core.telegram.org/api/gifts#upgrade-a-gift-to-a-collectible-gift CanUpgrade bool - // PrepaidUpgrade field of MessageActionStarGift. + // The sender has already pre-paid for the upgrade of this gift to a collectible gift. PrepaidUpgrade bool - // UpgradeSeparate field of MessageActionStarGift. + // This service message is the notification of a separate pre-payment for the upgrade of + // a gift we own¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade UpgradeSeparate bool // Info about the gift Gift StarGiftClass @@ -9420,31 +9446,50 @@ type MessageActionStarGift struct { // // Use SetConvertStars and GetConvertStars helpers. ConvertStars int64 - // UpgradeMsgID field of MessageActionStarGift. + // If set, this gift was upgraded to a collectible gift¹, and the corresponding + // messageActionStarGiftUnique² is available at the specified message ID. + // + // Links: + // 1) https://core.telegram.org/api/gifts#upgrade-a-gift-to-a-collectible-gift + // 2) https://core.telegram.org/constructor/messageActionStarGiftUnique // // Use SetUpgradeMsgID and GetUpgradeMsgID helpers. UpgradeMsgID int - // UpgradeStars field of MessageActionStarGift. + // The number of Telegram Stars the user can pay to convert the gift into a collectible + // gift »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts // // Use SetUpgradeStars and GetUpgradeStars helpers. UpgradeStars int64 - // FromID field of MessageActionStarGift. + // Sender of the gift (unset for anonymous gifts). // // Use SetFromID and GetFromID helpers. FromID PeerClass - // Peer field of MessageActionStarGift. + // Receiver of the gift. // // Use SetPeer and GetPeer helpers. Peer PeerClass - // SavedID field of MessageActionStarGift. + // For channel gifts, ID to use in inputSavedStarGiftChat¹ constructors. + // + // Links: + // 1) https://core.telegram.org/constructor/inputSavedStarGiftChat // // Use SetSavedID and GetSavedID helpers. SavedID int64 - // PrepaidUpgradeHash field of MessageActionStarGift. + // Hash to prepay for a gift upgrade separately »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade // // Use SetPrepaidUpgradeHash and GetPrepaidUpgradeHash helpers. PrepaidUpgradeHash string - // GiftMsgID field of MessageActionStarGift. + // For separate upgrades¹, the identifier of the message with the gift whose upgrade was + // prepaid (only valid for the receiver of the service message). + // + // Links: + // 1) https://core.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade // // Use SetGiftMsgID and GetGiftMsgID helpers. GiftMsgID int @@ -10268,6 +10313,11 @@ func (m *MessageActionStarGift) GetGiftMsgID() (value int, ok bool) { } // MessageActionStarGiftUnique represents TL type `messageActionStarGiftUnique#95728543`. +// A gift »¹ was upgraded to a collectible gift »². +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/messageActionStarGiftUnique for reference. type MessageActionStarGiftUnique struct { @@ -10276,49 +10326,85 @@ type MessageActionStarGiftUnique struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Upgrade field of MessageActionStarGiftUnique. + // If set, this collectible was upgraded »¹ to a collectible gift from a previously + // received or sent (depending on the out flag of the containing messageService²) + // non-collectible gift. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts + // 2) https://core.telegram.org/constructor/messageService Upgrade bool - // Transferred field of MessageActionStarGiftUnique. + // If set, this collectible was transferred (either to the current user or by the current + // user to the other user in the private chat, depending on the out flag of the + // containing messageService¹). + // + // Links: + // 1) https://core.telegram.org/constructor/messageService Transferred bool - // Saved field of MessageActionStarGiftUnique. + // If set, this gift is visible on the user or channel's profile page; can only be set + // for the receiver of a gift. Saved bool - // Refunded field of MessageActionStarGiftUnique. + // This gift was upgraded to a collectible gift »¹ and then re-downgraded to a regular + // gift because a request to refund the payment related to the upgrade was made, and the + // money was returned. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts Refunded bool - // PrepaidUpgrade field of MessageActionStarGiftUnique. + // The sender has pre-paid for the upgrade of this gift to a collectible gift. PrepaidUpgrade bool // Assigned field of MessageActionStarGiftUnique. Assigned bool - // Gift field of MessageActionStarGiftUnique. + // The collectible gift. Gift StarGiftClass - // CanExportAt field of MessageActionStarGiftUnique. + // If set, indicates that the current gift can't be exported to the TON blockchain »¹ + // yet: the owner will be able to export it at the specified unixtime. + // + // Links: + // 1) https://core.telegram.org/api/gifts#withdraw-a-collectible-gift-to-the-ton-blockchain // // Use SetCanExportAt and GetCanExportAt helpers. CanExportAt int - // TransferStars field of MessageActionStarGiftUnique. + // If set, indicates that the gift can be transferred »¹ to another user by paying the + // specified amount of stars. + // + // Links: + // 1) https://core.telegram.org/api/gifts#transferring-collectible-gifts // // Use SetTransferStars and GetTransferStars helpers. TransferStars int64 - // FromID field of MessageActionStarGiftUnique. + // Sender of the gift (unset for anonymous gifts). // // Use SetFromID and GetFromID helpers. FromID PeerClass - // Peer field of MessageActionStarGiftUnique. + // Receiver of the gift. // // Use SetPeer and GetPeer helpers. Peer PeerClass - // SavedID field of MessageActionStarGiftUnique. + // For channel gifts, ID to use in inputSavedStarGiftChat¹ constructors. + // + // Links: + // 1) https://core.telegram.org/constructor/inputSavedStarGiftChat // // Use SetSavedID and GetSavedID helpers. SavedID int64 - // ResaleAmount field of MessageActionStarGiftUnique. + // Resale price of the gift. // // Use SetResaleAmount and GetResaleAmount helpers. ResaleAmount StarsAmountClass - // CanTransferAt field of MessageActionStarGiftUnique. + // If set, indicates that the current gift can't be transferred »¹ yet: the owner will + // be able to transfer it at the specified unixtime. + // + // Links: + // 1) https://core.telegram.org/api/gifts#transferring-collectible-gifts // // Use SetCanTransferAt and GetCanTransferAt helpers. CanTransferAt int - // CanResellAt field of MessageActionStarGiftUnique. + // If set, indicates that the current gift can't be resold »¹ yet: the owner will be + // able to put it up for sale at the specified unixtime. + // + // Links: + // 1) https://core.telegram.org/api/gifts#reselling-collectible-gifts // // Use SetCanResellAt and GetCanResellAt helpers. CanResellAt int @@ -11085,12 +11171,18 @@ func (m *MessageActionStarGiftUnique) GetDropOriginalDetailsStars() (value int64 } // MessageActionPaidMessagesRefunded represents TL type `messageActionPaidMessagesRefunded#ac1f1fcd`. +// Sent from peer A to B, indicates that A refunded all stars¹ B previously paid to send +// messages to A, see here »² for more info on paid messages. +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/api/paid-messages // // See https://core.telegram.org/constructor/messageActionPaidMessagesRefunded for reference. type MessageActionPaidMessagesRefunded struct { - // Count field of MessageActionPaidMessagesRefunded. + // Number of paid messages affected by the refund. Count int - // Stars field of MessageActionPaidMessagesRefunded. + // Number of refunded stars. Stars int64 } @@ -11246,6 +11338,10 @@ func (m *MessageActionPaidMessagesRefunded) GetStars() (value int64) { } // MessageActionPaidMessagesPrice represents TL type `messageActionPaidMessagesPrice#84b88578`. +// The price of paid messages »¹ in this chat was changed. +// +// Links: +// 1. https://core.telegram.org/api/paid-messages // // See https://core.telegram.org/constructor/messageActionPaidMessagesPrice for reference. type MessageActionPaidMessagesPrice struct { @@ -11254,9 +11350,18 @@ type MessageActionPaidMessagesPrice struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // BroadcastMessagesAllowed field of MessageActionPaidMessagesPrice. + // Can only be set for channels, if set indicates that direct messages were enabled »¹, + // otherwise indicates that direct messages were disabled; the price of paid messages is + // related to the price of direct messages (aka those sent to the associated monoforum²). + // + // Links: + // 1) https://core.telegram.org/api/monoforum + // 2) https://core.telegram.org/api/monoforum BroadcastMessagesAllowed bool - // Stars field of MessageActionPaidMessagesPrice. + // The new price in Telegram Stars¹, can be 0 if messages are now free. + // + // Links: + // 1) https://core.telegram.org/api/stars Stars int64 } @@ -11436,6 +11541,16 @@ func (m *MessageActionPaidMessagesPrice) GetStars() (value int64) { } // MessageActionConferenceCall represents TL type `messageActionConferenceCall#2ffe2f7a`. +// Represents a conference call¹ (or an invitation to a conference call, if neither the +// missed nor active flags are set). +// If call_requests_disabled¹ is not set or false, an incoming +// messageActionConferenceCall² with the missed and active flags not set should trigger +// ringing and an incoming call screen, just like for one-on-one calls. +// +// Links: +// 1. https://core.telegram.org/api/end-to-end/group-calls +// 2. https://core.telegram.org/api/config#call-requests-disabled +// 3. https://core.telegram.org/constructor/messageActionConferenceCall // // See https://core.telegram.org/constructor/messageActionConferenceCall for reference. type MessageActionConferenceCall struct { @@ -11444,19 +11559,19 @@ type MessageActionConferenceCall struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Missed field of MessageActionConferenceCall. + // Whether the conference call has ended and the user hasn't joined. Missed bool - // Active field of MessageActionConferenceCall. + // Whether the user is currently in the conference call. Active bool - // Video field of MessageActionConferenceCall. + // Whether this is a video conference call. Video bool - // CallID field of MessageActionConferenceCall. + // Call ID. CallID int64 - // Duration field of MessageActionConferenceCall. + // Call duration, for left calls only. // // Use SetDuration and GetDuration helpers. Duration int - // OtherParticipants field of MessageActionConferenceCall. + // Identifiers of some other call participants. // // Use SetOtherParticipants and GetOtherParticipants helpers. OtherParticipants []PeerClass @@ -11818,12 +11933,16 @@ func (m *MessageActionConferenceCall) MapOtherParticipants() (value PeerClassArr } // MessageActionTodoCompletions represents TL type `messageActionTodoCompletions#cc7c5c89`. +// Items were marked as completed or not completed in a todo list »¹. +// +// Links: +// 1. https://core.telegram.org/api/todo // // See https://core.telegram.org/constructor/messageActionTodoCompletions for reference. type MessageActionTodoCompletions struct { - // Completed field of MessageActionTodoCompletions. + // Items marked as completed. Completed []int - // Incompleted field of MessageActionTodoCompletions. + // Items marked as not completed. Incompleted []int } @@ -12005,10 +12124,14 @@ func (m *MessageActionTodoCompletions) GetIncompleted() (value []int) { } // MessageActionTodoAppendTasks represents TL type `messageActionTodoAppendTasks#c7edbc83`. +// Items were appended to the todo list »¹. +// +// Links: +// 1. https://core.telegram.org/api/todo // // See https://core.telegram.org/constructor/messageActionTodoAppendTasks for reference. type MessageActionTodoAppendTasks struct { - // List field of MessageActionTodoAppendTasks. + // Appended items. List []TodoItem } @@ -12154,6 +12277,10 @@ func (m *MessageActionTodoAppendTasks) GetList() (value []TodoItem) { } // MessageActionSuggestedPostApproval represents TL type `messageActionSuggestedPostApproval#ee7a1596`. +// A suggested post »¹ was approved or rejected. +// +// Links: +// 1. https://core.telegram.org/api/suggested-posts // // See https://core.telegram.org/constructor/messageActionSuggestedPostApproval for reference. type MessageActionSuggestedPostApproval struct { @@ -12162,19 +12289,20 @@ type MessageActionSuggestedPostApproval struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Rejected field of MessageActionSuggestedPostApproval. + // Whether the suggested post was rejected. Rejected bool - // BalanceTooLow field of MessageActionSuggestedPostApproval. + // If set, the post was approved but the user's balance is too low to pay for the + // suggested post. BalanceTooLow bool - // RejectComment field of MessageActionSuggestedPostApproval. + // If the suggested post was rejected, can optionally contain a rejection comment. // // Use SetRejectComment and GetRejectComment helpers. RejectComment string - // ScheduleDate field of MessageActionSuggestedPostApproval. + // Scheduling date. // // Use SetScheduleDate and GetScheduleDate helpers. ScheduleDate int - // Price field of MessageActionSuggestedPostApproval. + // Price for the suggested post. // // Use SetPrice and GetPrice helpers. Price StarsAmountClass @@ -12501,10 +12629,15 @@ func (m *MessageActionSuggestedPostApproval) GetPrice() (value StarsAmountClass, } // MessageActionSuggestedPostSuccess represents TL type `messageActionSuggestedPostSuccess#95ddcf69`. +// A suggested post »¹ was successfully posted, and payment for it was successfully +// received. +// +// Links: +// 1. https://core.telegram.org/api/suggested-posts // // See https://core.telegram.org/constructor/messageActionSuggestedPostSuccess for reference. type MessageActionSuggestedPostSuccess struct { - // Price field of MessageActionSuggestedPostSuccess. + // The price. Price StarsAmountClass } @@ -12640,6 +12773,14 @@ func (m *MessageActionSuggestedPostSuccess) GetPrice() (value StarsAmountClass) } // MessageActionSuggestedPostRefund represents TL type `messageActionSuggestedPostRefund#69f916f8`. +// A suggested post »¹ was accepted and posted or scheduled, but either the channel +// deleted the posted/scheduled post before stars_suggested_post_age_min² seconds have +// elapsed, or the user refunded the payment for the stars used to pay for the suggested +// post. +// +// Links: +// 1. https://core.telegram.org/api/suggested-posts +// 2. https://core.telegram.org/api/config#stars-suggested-post-age-min // // See https://core.telegram.org/constructor/messageActionSuggestedPostRefund for reference. type MessageActionSuggestedPostRefund struct { @@ -12648,7 +12789,7 @@ type MessageActionSuggestedPostRefund struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // PayerInitiated field of MessageActionSuggestedPostRefund. + // If set, the user refunded the payment for the stars used to pay for the suggested post. PayerInitiated bool } @@ -12803,6 +12944,13 @@ func (m *MessageActionSuggestedPostRefund) GetPayerInitiated() (value bool) { } // MessageActionGiftTon represents TL type `messageActionGiftTon#a8a3c699`. +// You were gifted some toncoins. +// This service message should be displayed below the appropriate sticker from the +// inputStickerSetTonGifts »¹ stickerset »²: +// +// Links: +// 1. https://core.telegram.org/constructor/inputStickerSetTonGifts +// 2. https://core.telegram.org/api/stickers#stickersets // // See https://core.telegram.org/constructor/messageActionGiftTon for reference. type MessageActionGiftTon struct { @@ -12811,15 +12959,17 @@ type MessageActionGiftTon struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Currency field of MessageActionGiftTon. + // Name of a localized FIAT currency. Currency string - // Amount field of MessageActionGiftTon. + // FIAT currency equivalent (in the currency specified in currency) of the amount + // specified in crypto_amount. Amount int64 - // CryptoCurrency field of MessageActionGiftTon. + // Name of the cryptocurrency. CryptoCurrency string - // CryptoAmount field of MessageActionGiftTon. + // Amount in the smallest unit of the cryptocurrency (for TONs, one billionth of a ton, + // AKA a nanoton). CryptoAmount int64 - // TransactionID field of MessageActionGiftTon. + // Transaction ID. // // Use SetTransactionID and GetTransactionID helpers. TransactionID string diff --git a/tg/tl_message_gen.go b/tg/tl_message_gen.go index e891225c7e..6a7720d1a5 100644 --- a/tg/tl_message_gen.go +++ b/tg/tl_message_gen.go @@ -308,9 +308,16 @@ type Message struct { // 2) https://core.telegram.org/api/scheduled-messages // 3) https://core.telegram.org/api/files#video-qualities VideoProcessingPending bool - // PaidSuggestedPostStars field of Message. + // Set if this is a suggested channel post »¹ that was paid using Telegram Stars². + // + // Links: + // 1) https://core.telegram.org/api/suggested-posts + // 2) https://core.telegram.org/api/stars PaidSuggestedPostStars bool - // PaidSuggestedPostTon field of Message. + // Set if this is a suggested channel post »¹ that was paid using Toncoins. + // + // Links: + // 1) https://core.telegram.org/api/suggested-posts PaidSuggestedPostTon bool // ID of the message ID int @@ -336,12 +343,14 @@ type Message struct { FromBoostsApplied int // Peer ID, the chat where this message was sent PeerID PeerClass - // Messages fetched from a saved messages dialog »¹ will have peer=inputPeerSelf² and - // the saved_peer_id flag set to the ID of the saved dialog. + // Messages from a saved messages dialog »¹ will have peer=inputPeerSelf² and the + // saved_peer_id flag set to the ID of the saved dialog.Messages from a monoforum »³ + // will have peer=ID of the monoforum and the saved_peer_id flag set to the ID of a topic. // // Links: // 1) https://core.telegram.org/api/saved-messages // 2) https://core.telegram.org/constructor/inputPeerSelf + // 3) https://core.telegram.org/api/monoforum // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID PeerClass @@ -357,7 +366,7 @@ type Message struct { // of the user. // // Links: - // 1) https://core.telegram.org/api/business#connected-bots + // 1) https://core.telegram.org/api/bots/connected-business-bots // // Use SetViaBusinessBotID and GetViaBusinessBotID helpers. ViaBusinessBotID int64 @@ -451,15 +460,29 @@ type Message struct { // // Use SetFactcheck and GetFactcheck helpers. Factcheck FactCheck - // ReportDeliveryUntilDate field of Message. + // Used for Telegram Gateway verification messages¹: if set and the current unixtime is + // bigger than the specified unixtime, invoke messages.reportMessagesDelivery² passing + // the ID and the peer of this message as soon as it is received by the client + // (optionally batching requests for the same peer). + // + // Links: + // 1) https://telegram.org/blog/star-messages-gateway-2-0-and-more#save-even-more-on-user-verification + // 2) https://core.telegram.org/method/messages.reportMessagesDelivery // // Use SetReportDeliveryUntilDate and GetReportDeliveryUntilDate helpers. ReportDeliveryUntilDate int - // PaidMessageStars field of Message. + // The amount of stars the sender has paid to send the message, see here »¹ for more + // info. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages // // Use SetPaidMessageStars and GetPaidMessageStars helpers. PaidMessageStars int64 - // SuggestedPost field of Message. + // Used to suggest a post to a channel, see here »¹ for more info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/suggested-posts // // Use SetSuggestedPost and GetSuggestedPost helpers. SuggestedPost SuggestedPost @@ -2375,7 +2398,10 @@ type MessageService struct { Mentioned bool // Whether the message contains unread media MediaUnread bool - // ReactionsArePossible field of MessageService. + // Whether you can react to this message »¹. + // + // Links: + // 1) https://core.telegram.org/api/reactions ReactionsArePossible bool // Whether the message is silent Silent bool @@ -2391,7 +2417,12 @@ type MessageService struct { FromID PeerClass // Sender of service message PeerID PeerClass - // SavedPeerID field of MessageService. + // Will only be set for service messages within a monoforum topic »¹: peer will be + // equal to the ID of the monoforum and the saved_peer_id flag will be set to the ID of a + // topic. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID PeerClass @@ -2403,7 +2434,10 @@ type MessageService struct { Date int // Event connected with the service message Action MessageActionClass - // Reactions field of MessageService. + // Reactions »¹. + // + // Links: + // 1) https://core.telegram.org/api/reactions // // Use SetReactions and GetReactions helpers. Reactions MessageReactions @@ -3229,12 +3263,14 @@ type NotEmptyMessage interface { // Peer ID, the chat where this message was sent GetPeerID() (value PeerClass) - // Messages fetched from a saved messages dialog »¹ will have peer=inputPeerSelf² and - // the saved_peer_id flag set to the ID of the saved dialog. + // Messages from a saved messages dialog »¹ will have peer=inputPeerSelf² and the + // saved_peer_id flag set to the ID of the saved dialog.Messages from a monoforum »³ + // will have peer=ID of the monoforum and the saved_peer_id flag set to the ID of a topic. // // Links: // 1) https://core.telegram.org/api/saved-messages // 2) https://core.telegram.org/constructor/inputPeerSelf + // 3) https://core.telegram.org/api/monoforum GetSavedPeerID() (value PeerClass, ok bool) // Reply information diff --git a/tg/tl_message_media_gen.go b/tg/tl_message_media_gen.go index 04bcaa2350..d2cf2e5db9 100644 --- a/tg/tl_message_media_gen.go +++ b/tg/tl_message_media_gen.go @@ -912,11 +912,11 @@ type MessageMediaDocument struct { // // Use SetAltDocuments and GetAltDocuments helpers. AltDocuments []DocumentClass - // VideoCover field of MessageMediaDocument. + // Custom video cover. // // Use SetVideoCover and GetVideoCover helpers. VideoCover PhotoClass - // VideoTimestamp field of MessageMediaDocument. + // Start playing the video at the specified timestamp (seconds). // // Use SetVideoTimestamp and GetVideoTimestamp helpers. VideoTimestamp int @@ -4892,6 +4892,10 @@ func (m *MessageMediaPaidMedia) MapExtendedMedia() (value MessageExtendedMediaCl } // MessageMediaToDo represents TL type `messageMediaToDo#8a53b014`. +// Represents a todo list »¹. +// +// Links: +// 1. https://core.telegram.org/api/todo // // See https://core.telegram.org/constructor/messageMediaToDo for reference. type MessageMediaToDo struct { @@ -4900,9 +4904,9 @@ type MessageMediaToDo struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Todo field of MessageMediaToDo. + // The todo list. Todo TodoList - // Completions field of MessageMediaToDo. + // Completed items. // // Use SetCompletions and GetCompletions helpers. Completions []TodoCompletion diff --git a/tg/tl_message_replies_gen.go b/tg/tl_message_replies_gen.go index 2d73edfe93..e2f34b486f 100644 --- a/tg/tl_message_replies_gen.go +++ b/tg/tl_message_replies_gen.go @@ -32,7 +32,8 @@ var ( ) // MessageReplies represents TL type `messageReplies#83d60fc2`. -// Info about the comment section of a channel post, or a simple message thread¹ +// Info about the comment section of a channel post, a simple message thread, a forum +// topic, or a direct messages topic¹ (all features ultimately based on message threads). // // Links: // 1. https://core.telegram.org/api/threads diff --git a/tg/tl_message_reply_header_gen.go b/tg/tl_message_reply_header_gen.go index 1208e5b895..72d8244ce1 100644 --- a/tg/tl_message_reply_header_gen.go +++ b/tg/tl_message_reply_header_gen.go @@ -100,7 +100,10 @@ type MessageReplyHeader struct { // // Use SetQuoteOffset and GetQuoteOffset helpers. QuoteOffset int - // TodoItemID field of MessageReplyHeader. + // Can be set to reply to the specified item of a todo list »¹. + // + // Links: + // 1) https://core.telegram.org/api/todo // // Use SetTodoItemID and GetTodoItemID helpers. TodoItemID int diff --git a/tg/tl_messages_add_chat_user_gen.go b/tg/tl_messages_add_chat_user_gen.go index 1762132989..0b90d6b83e 100644 --- a/tg/tl_messages_add_chat_user_gen.go +++ b/tg/tl_messages_add_chat_user_gen.go @@ -228,6 +228,8 @@ func (a *MessagesAddChatUserRequest) GetFwdLimit() (value int) { // 400 BOT_GROUPS_BLOCKED: This bot can't be added to groups. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_ID_INVALID: The provided chat id is invalid. +// 400 CHAT_INVALID: Invalid chat. +// 400 CHAT_MEMBER_ADD_FAILED: Could not add participants. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MSG_ID_INVALID: Invalid message ID provided. diff --git a/tg/tl_messages_append_todo_list_gen.go b/tg/tl_messages_append_todo_list_gen.go index ab9d01038d..2f061a5fe4 100644 --- a/tg/tl_messages_append_todo_list_gen.go +++ b/tg/tl_messages_append_todo_list_gen.go @@ -32,14 +32,18 @@ var ( ) // MessagesAppendTodoListRequest represents TL type `messages.appendTodoList#21a61057`. +// Appends one or more items to a todo list »¹. +// +// Links: +// 1. https://core.telegram.org/api/todo // // See https://core.telegram.org/method/messages.appendTodoList for reference. type MessagesAppendTodoListRequest struct { - // Peer field of MessagesAppendTodoListRequest. + // Peer where the todo list was posted. Peer InputPeerClass - // MsgID field of MessagesAppendTodoListRequest. + // ID of the message with the todo list. MsgID int - // List field of MessagesAppendTodoListRequest. + // Items to append. List []TodoItem } @@ -235,9 +239,19 @@ func (a *MessagesAppendTodoListRequest) GetList() (value []TodoItem) { } // MessagesAppendTodoList invokes method messages.appendTodoList#21a61057 returning error if any. +// Appends one or more items to a todo list »¹. +// +// Links: +// 1. https://core.telegram.org/api/todo +// +// Possible errors: +// +// 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 TODO_ITEM_DUPLICATE: Duplicate checklist items detected. +// 400 TODO_NOT_MODIFIED: No todo items were specified, so no changes were made to the todo list. // // See https://core.telegram.org/method/messages.appendTodoList for reference. -// Can be used by bots. func (c *Client) MessagesAppendTodoList(ctx context.Context, request *MessagesAppendTodoListRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_create_chat_gen.go b/tg/tl_messages_create_chat_gen.go index 0082c6d5b4..46f5a406e8 100644 --- a/tg/tl_messages_create_chat_gen.go +++ b/tg/tl_messages_create_chat_gen.go @@ -292,11 +292,12 @@ func (c *MessagesCreateChatRequest) MapUsers() (value InputUserClassArray) { // // 500 CHAT_ID_GENERATE_FAILED: Failure while generating the chat ID. // 400 CHAT_INVALID: Invalid chat. +// 400 CHAT_MEMBER_ADD_FAILED: Could not add participants. // 400 CHAT_TITLE_EMPTY: No chat title provided. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 TTL_PERIOD_INVALID: The specified TTL period is invalid. // 400 USERS_TOO_FEW: Not enough users (to create a chat, for example). -// 406 USER_RESTRICTED: You're spamreported, you can't create channels or chats. +// 403 USER_RESTRICTED: You're spamreported, you can't create channels or chats. // // See https://core.telegram.org/method/messages.createChat for reference. func (c *Client) MessagesCreateChat(ctx context.Context, request *MessagesCreateChatRequest) (*MessagesInvitedUsers, error) { diff --git a/tg/tl_messages_delete_chat_user_gen.go b/tg/tl_messages_delete_chat_user_gen.go index 2ce5611fba..955cdf57c6 100644 --- a/tg/tl_messages_delete_chat_user_gen.go +++ b/tg/tl_messages_delete_chat_user_gen.go @@ -262,7 +262,6 @@ func (d *MessagesDeleteChatUserRequest) GetUserID() (value InputUserClass) { // 400 USER_NOT_PARTICIPANT: You're not a member of this supergroup/channel. // // See https://core.telegram.org/method/messages.deleteChatUser for reference. -// Can be used by bots. func (c *Client) MessagesDeleteChatUser(ctx context.Context, request *MessagesDeleteChatUserRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_delete_exported_chat_invite_gen.go b/tg/tl_messages_delete_exported_chat_invite_gen.go index 2a1d5366a6..66ea06cb36 100644 --- a/tg/tl_messages_delete_exported_chat_invite_gen.go +++ b/tg/tl_messages_delete_exported_chat_invite_gen.go @@ -198,6 +198,7 @@ func (d *MessagesDeleteExportedChatInviteRequest) GetLink() (value string) { // // Possible errors: // +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 INVITE_HASH_EXPIRED: The invite link has expired. // 400 INVITE_REVOKED_MISSING: The specified invite link was already revoked or is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. diff --git a/tg/tl_messages_delete_messages_gen.go b/tg/tl_messages_delete_messages_gen.go index bda10e79f2..aaa114ea78 100644 --- a/tg/tl_messages_delete_messages_gen.go +++ b/tg/tl_messages_delete_messages_gen.go @@ -235,11 +235,13 @@ func (d *MessagesDeleteMessagesRequest) GetID() (value []int) { // // Possible errors: // +// 403 BOT_ACCESS_FORBIDDEN: The specified method can be used over a business connection for some operations, but the specified query attempted an operation that is not allowed over a business connection. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 403 MESSAGE_DELETE_FORBIDDEN: You can't delete one of the messages you tried to delete, most likely because it is a service message. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 SELF_DELETE_RESTRICTED: Business bots can't delete messages just for the user, revoke must be set. // // See https://core.telegram.org/method/messages.deleteMessages for reference. -// Can be used by bots. func (c *Client) MessagesDeleteMessages(ctx context.Context, request *MessagesDeleteMessagesRequest) (*MessagesAffectedMessages, error) { var result MessagesAffectedMessages diff --git a/tg/tl_messages_delete_saved_history_gen.go b/tg/tl_messages_delete_saved_history_gen.go index 0d51e5a421..f92baddf3d 100644 --- a/tg/tl_messages_delete_saved_history_gen.go +++ b/tg/tl_messages_delete_saved_history_gen.go @@ -32,10 +32,12 @@ var ( ) // MessagesDeleteSavedHistoryRequest represents TL type `messages.deleteSavedHistory#4dc5085f`. -// Deletes messages forwarded from a specific peer to saved messages »¹. +// Deletes messages from a monoforum topic »¹, or deletes messages forwarded from a +// specific peer to saved messages »². // // Links: -// 1. https://core.telegram.org/api/saved-messages +// 1. https://core.telegram.org/api/monoforum +// 2. https://core.telegram.org/api/saved-messages // // See https://core.telegram.org/method/messages.deleteSavedHistory for reference. type MessagesDeleteSavedHistoryRequest struct { @@ -44,11 +46,16 @@ type MessagesDeleteSavedHistoryRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ParentPeer field of MessagesDeleteSavedHistoryRequest. + // If set, affects the messages of the passed monoforum topic »¹, otherwise affects + // saved messages »². + // + // Links: + // 1) https://core.telegram.org/api/monoforum + // 2) https://core.telegram.org/api/saved-messages // // Use SetParentPeer and GetParentPeer helpers. ParentPeer InputPeerClass - // Peer, whose messages will be deleted from saved messages »¹ + // Peer, whose messages will be deleted from saved messages »¹, or the ID of the topic. // // Links: // 1) https://core.telegram.org/api/saved-messages @@ -370,10 +377,12 @@ func (d *MessagesDeleteSavedHistoryRequest) GetMaxDate() (value int, ok bool) { } // MessagesDeleteSavedHistory invokes method messages.deleteSavedHistory#4dc5085f returning error if any. -// Deletes messages forwarded from a specific peer to saved messages »¹. +// Deletes messages from a monoforum topic »¹, or deletes messages forwarded from a +// specific peer to saved messages »². // // Links: -// 1. https://core.telegram.org/api/saved-messages +// 1. https://core.telegram.org/api/monoforum +// 2. https://core.telegram.org/api/saved-messages // // Possible errors: // diff --git a/tg/tl_messages_edit_chat_about_gen.go b/tg/tl_messages_edit_chat_about_gen.go index f444d6277b..e6fe876956 100644 --- a/tg/tl_messages_edit_chat_about_gen.go +++ b/tg/tl_messages_edit_chat_about_gen.go @@ -218,7 +218,6 @@ func (e *MessagesEditChatAboutRequest) GetAbout() (value string) { // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.editChatAbout for reference. -// Can be used by bots. func (c *Client) MessagesEditChatAbout(ctx context.Context, request *MessagesEditChatAboutRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_edit_chat_default_banned_rights_gen.go b/tg/tl_messages_edit_chat_default_banned_rights_gen.go index 2b41eba808..d9e2c855e8 100644 --- a/tg/tl_messages_edit_chat_default_banned_rights_gen.go +++ b/tg/tl_messages_edit_chat_default_banned_rights_gen.go @@ -205,6 +205,7 @@ func (e *MessagesEditChatDefaultBannedRightsRequest) GetBannedRights() (value Ch // Possible errors: // // 400 BANNED_RIGHTS_INVALID: You provided some invalid flags in the banned rights. +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_ID_INVALID: The provided chat id is invalid. @@ -214,7 +215,6 @@ func (e *MessagesEditChatDefaultBannedRightsRequest) GetBannedRights() (value Ch // 400 UNTIL_DATE_INVALID: Invalid until date provided. // // See https://core.telegram.org/method/messages.editChatDefaultBannedRights for reference. -// Can be used by bots. func (c *Client) MessagesEditChatDefaultBannedRights(ctx context.Context, request *MessagesEditChatDefaultBannedRightsRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_edit_chat_photo_gen.go b/tg/tl_messages_edit_chat_photo_gen.go index 55d3ba95c2..74eb8b229a 100644 --- a/tg/tl_messages_edit_chat_photo_gen.go +++ b/tg/tl_messages_edit_chat_photo_gen.go @@ -207,7 +207,6 @@ func (e *MessagesEditChatPhotoRequest) GetPhoto() (value InputChatPhotoClass) { // 400 PHOTO_INVALID: Photo invalid. // // See https://core.telegram.org/method/messages.editChatPhoto for reference. -// Can be used by bots. func (c *Client) MessagesEditChatPhoto(ctx context.Context, request *MessagesEditChatPhotoRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_edit_chat_title_gen.go b/tg/tl_messages_edit_chat_title_gen.go index 24de037b54..a2ff2380f0 100644 --- a/tg/tl_messages_edit_chat_title_gen.go +++ b/tg/tl_messages_edit_chat_title_gen.go @@ -200,7 +200,6 @@ func (e *MessagesEditChatTitleRequest) GetTitle() (value string) { // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.editChatTitle for reference. -// Can be used by bots. func (c *Client) MessagesEditChatTitle(ctx context.Context, request *MessagesEditChatTitleRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_edit_exported_chat_invite_gen.go b/tg/tl_messages_edit_exported_chat_invite_gen.go index 04201533d5..c438f62064 100644 --- a/tg/tl_messages_edit_exported_chat_invite_gen.go +++ b/tg/tl_messages_edit_exported_chat_invite_gen.go @@ -457,7 +457,6 @@ func (e *MessagesEditExportedChatInviteRequest) GetTitle() (value string, ok boo // 400 USAGE_LIMIT_INVALID: The specified usage limit is invalid. // // See https://core.telegram.org/method/messages.editExportedChatInvite for reference. -// Can be used by bots. func (c *Client) MessagesEditExportedChatInvite(ctx context.Context, request *MessagesEditExportedChatInviteRequest) (MessagesExportedChatInviteClass, error) { var result MessagesExportedChatInviteBox diff --git a/tg/tl_messages_edit_inline_bot_message_gen.go b/tg/tl_messages_edit_inline_bot_message_gen.go index b0b65c4a42..5bad66036f 100644 --- a/tg/tl_messages_edit_inline_bot_message_gen.go +++ b/tg/tl_messages_edit_inline_bot_message_gen.go @@ -500,7 +500,6 @@ func (e *MessagesEditInlineBotMessageRequest) MapEntities() (value MessageEntity // 400 MESSAGE_NOT_MODIFIED: The provided message data is identical to the previous message data, the message wasn't modified. // // See https://core.telegram.org/method/messages.editInlineBotMessage for reference. -// Can be used by bots. func (c *Client) MessagesEditInlineBotMessage(ctx context.Context, request *MessagesEditInlineBotMessageRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_edit_message_gen.go b/tg/tl_messages_edit_message_gen.go index 15695f09e6..eaedb3d68e 100644 --- a/tg/tl_messages_edit_message_gen.go +++ b/tg/tl_messages_edit_message_gen.go @@ -625,6 +625,8 @@ func (e *MessagesEditMessageRequest) MapEntities() (value MessageEntityClassArra // // 400 BOT_DOMAIN_INVALID: Bot domain invalid. // 400 BOT_INVALID: This is not a valid bot. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. +// 400 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection. // 400 BUTTON_COPY_TEXT_INVALID: The specified keyboardButtonCopy.copy_text is invalid. // 400 BUTTON_DATA_INVALID: The data of one or more of the buttons you provided is invalid. // 400 BUTTON_TYPE_INVALID: The type of one or more of the buttons you provided is invalid. @@ -659,14 +661,17 @@ func (e *MessagesEditMessageRequest) MapEntities() (value MessageEntityClassArra // 500 MSG_WAIT_FAILED: A waiting call returned an error. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 PEER_TYPES_INVALID: The passed keyboardButtonSwitchInline.peer_types field is invalid. +// 400 PHOTO_INVALID_DIMENSIONS: The photo dimensions are invalid. +// 400 PHOTO_SAVE_FILE_INVALID: Internal issues, try again later. // 400 REPLY_MARKUP_INVALID: The provided reply markup is invalid. // 400 REPLY_MARKUP_TOO_LONG: The specified reply_markup is too long. // 400 SCHEDULE_DATE_INVALID: Invalid schedule date provided. +// 400 TODO_ITEMS_EMPTY: A checklist was specified, but no checklist items were passed. +// 400 TODO_ITEM_DUPLICATE: Duplicate checklist items detected. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // 400 WEBPAGE_NOT_FOUND: A preview for the specified webpage url could not be generated. // // See https://core.telegram.org/method/messages.editMessage for reference. -// Can be used by bots. func (c *Client) MessagesEditMessage(ctx context.Context, request *MessagesEditMessageRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_export_chat_invite_gen.go b/tg/tl_messages_export_chat_invite_gen.go index bf0742e007..9d9063b34c 100644 --- a/tg/tl_messages_export_chat_invite_gen.go +++ b/tg/tl_messages_export_chat_invite_gen.go @@ -462,6 +462,7 @@ func (e *MessagesExportChatInviteRequest) GetSubscriptionPricing() (value StarsS // Possible errors: // // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_MONOFORUM_UNSUPPORTED: Monoforums do not support this feature. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_ID_INVALID: The provided chat id is invalid. @@ -474,7 +475,6 @@ func (e *MessagesExportChatInviteRequest) GetSubscriptionPricing() (value StarsS // 400 USAGE_LIMIT_INVALID: The specified usage limit is invalid. // // See https://core.telegram.org/method/messages.exportChatInvite for reference. -// Can be used by bots. func (c *Client) MessagesExportChatInvite(ctx context.Context, request *MessagesExportChatInviteRequest) (ExportedChatInviteClass, error) { var result ExportedChatInviteBox diff --git a/tg/tl_messages_forward_messages_gen.go b/tg/tl_messages_forward_messages_gen.go index 52f2c909f6..80f73451fc 100644 --- a/tg/tl_messages_forward_messages_gen.go +++ b/tg/tl_messages_forward_messages_gen.go @@ -80,7 +80,12 @@ type MessagesForwardMessagesRequest struct { // // Use SetTopMsgID and GetTopMsgID helpers. TopMsgID int - // ReplyTo field of MessagesForwardMessagesRequest. + // Can only contain an inputReplyToMonoForum¹, to forward messages to a monoforum + // topic² (mutually exclusive with top_msg_id). + // + // Links: + // 1) https://core.telegram.org/constructor/inputReplyToMonoForum + // 2) https://core.telegram.org/api/monoforum // // Use SetReplyTo and GetReplyTo helpers. ReplyTo InputReplyToClass @@ -99,15 +104,23 @@ type MessagesForwardMessagesRequest struct { // // Use SetQuickReplyShortcut and GetQuickReplyShortcut helpers. QuickReplyShortcut InputQuickReplyShortcutClass - // VideoTimestamp field of MessagesForwardMessagesRequest. + // Start playing the video at the specified timestamp (seconds). // // Use SetVideoTimestamp and GetVideoTimestamp helpers. VideoTimestamp int - // AllowPaidStars field of MessagesForwardMessagesRequest. + // For paid messages »¹, specifies the amount of Telegram Stars² the user has agreed + // to pay in order to send the message. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages + // 2) https://core.telegram.org/api/stars // // Use SetAllowPaidStars and GetAllowPaidStars helpers. AllowPaidStars int64 - // SuggestedPost field of MessagesForwardMessagesRequest. + // Used to suggest a post to a channel, see here »¹ for more info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/suggested-posts // // Use SetSuggestedPost and GetSuggestedPost helpers. SuggestedPost SuggestedPost @@ -964,6 +977,8 @@ func (f *MessagesForwardMessagesRequest) GetSuggestedPost() (value SuggestedPost // // Possible errors: // +// 406 ALLOW_PAYMENT_REQUIRED: This peer only accepts paid messages »: this error is only emitted for older layers without paid messages support, so the client must be updated in order to use paid messages. . +// 403 ALLOW_PAYMENT_REQUIRED_%d: This peer charges %d Telegram Stars per message, but the allow_paid_stars was not set or its value is smaller than %d. // 400 BROADCAST_PUBLIC_VOTERS_FORBIDDEN: You can't forward polls with public voters. // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. @@ -976,6 +991,7 @@ func (f *MessagesForwardMessagesRequest) GetSuggestedPost() (value SuggestedPost // 403 CHAT_SEND_DOCS_FORBIDDEN: You can't send documents in this chat. // 403 CHAT_SEND_GAME_FORBIDDEN: You can't send a game to this chat. // 403 CHAT_SEND_GIFS_FORBIDDEN: You can't send gifs in this chat. +// 403 CHAT_SEND_INLINE_FORBIDDEN: You can't send inline messages in this group. // 403 CHAT_SEND_MEDIA_FORBIDDEN: You can't send media in this chat. // 403 CHAT_SEND_PHOTOS_FORBIDDEN: You can't send photos in this chat. // 403 CHAT_SEND_PLAIN_FORBIDDEN: You can't send non-media (text) messages in this chat. @@ -983,6 +999,7 @@ func (f *MessagesForwardMessagesRequest) GetSuggestedPost() (value SuggestedPost // 403 CHAT_SEND_STICKERS_FORBIDDEN: You can't send stickers in this chat. // 403 CHAT_SEND_VIDEOS_FORBIDDEN: You can't send videos in this chat. // 403 CHAT_SEND_VOICES_FORBIDDEN: You can't send voice recordings in this chat. +// 403 CHAT_SEND_WEBPAGE_FORBIDDEN: You can't send webpage previews to this chat. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 GROUPED_MEDIA_INVALID: Invalid grouped media. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. @@ -991,20 +1008,23 @@ func (f *MessagesForwardMessagesRequest) GetSuggestedPost() (value SuggestedPost // 400 MESSAGE_ID_INVALID: The provided message id is invalid. // 400 MSG_ID_INVALID: Invalid message ID provided. // 406 PAYMENT_UNSUPPORTED: A detailed description of the error will be received separately as described here ». -// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 406 PEER_ID_INVALID: The provided peer id is invalid. // 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. -// 406 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. +// 403 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. +// 400 QUICK_REPLIES_BOT_NOT_ALLOWED: Quick replies cannot be used by bots. // 400 QUICK_REPLIES_TOO_MUCH: A maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached. // 400 QUIZ_ANSWER_MISSING: You can forward a quiz while hiding the original author only after choosing an option in the quiz. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // 400 RANDOM_ID_INVALID: A provided random ID is invalid. // 400 REPLY_MESSAGES_TOO_MUCH: Each shortcut can contain a maximum of appConfig.quick_reply_messages_limit messages, the limit was reached. +// 400 REPLY_TO_MONOFORUM_PEER_INVALID: The specified inputReplyToMonoForum.monoforum_peer_id is invalid. // 400 SCHEDULE_BOT_NOT_ALLOWED: Bots cannot schedule messages. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. // 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. // 400 SLOWMODE_MULTI_MSGS_DISABLED: Slowmode is enabled, you cannot forward multiple messages to this group. // 420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat. +// 400 SUGGESTED_POST_PEER_INVALID: You cannot send suggested posts to non-monoforum peers. // 406 TOPIC_CLOSED: This topic was closed, you can't send messages to it anymore. // 406 TOPIC_DELETED: The specified topic was deleted. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. @@ -1014,7 +1034,6 @@ func (f *MessagesForwardMessagesRequest) GetSuggestedPost() (value SuggestedPost // 400 YOU_BLOCKED_USER: You blocked this user. // // See https://core.telegram.org/method/messages.forwardMessages for reference. -// Can be used by bots. func (c *Client) MessagesForwardMessages(ctx context.Context, request *MessagesForwardMessagesRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_get_chats_gen.go b/tg/tl_messages_get_chats_gen.go index d4e5240319..5b038b2616 100644 --- a/tg/tl_messages_get_chats_gen.go +++ b/tg/tl_messages_get_chats_gen.go @@ -183,7 +183,6 @@ func (g *MessagesGetChatsRequest) GetID() (value []int64) { // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.getChats for reference. -// Can be used by bots. func (c *Client) MessagesGetChats(ctx context.Context, id []int64) (MessagesChatsClass, error) { var result MessagesChatsBox diff --git a/tg/tl_messages_get_custom_emoji_documents_gen.go b/tg/tl_messages_get_custom_emoji_documents_gen.go index cea1436fd6..aefbc9a15c 100644 --- a/tg/tl_messages_get_custom_emoji_documents_gen.go +++ b/tg/tl_messages_get_custom_emoji_documents_gen.go @@ -198,7 +198,6 @@ func (g *MessagesGetCustomEmojiDocumentsRequest) GetDocumentID() (value []int64) // 3. https://core.telegram.org/constructor/documentAttributeCustomEmoji // // See https://core.telegram.org/method/messages.getCustomEmojiDocuments for reference. -// Can be used by bots. func (c *Client) MessagesGetCustomEmojiDocuments(ctx context.Context, documentid []int64) ([]DocumentClass, error) { var result DocumentClassVector diff --git a/tg/tl_messages_get_dialog_unread_marks_gen.go b/tg/tl_messages_get_dialog_unread_marks_gen.go index ac842a2b46..63001a2a61 100644 --- a/tg/tl_messages_get_dialog_unread_marks_gen.go +++ b/tg/tl_messages_get_dialog_unread_marks_gen.go @@ -41,7 +41,8 @@ type MessagesGetDialogUnreadMarksRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ParentPeer field of MessagesGetDialogUnreadMarksRequest. + // Can be equal to the ID of a monoforum, to fetch monoforum topics manually marked as + // unread. // // Use SetParentPeer and GetParentPeer helpers. ParentPeer InputPeerClass diff --git a/tg/tl_messages_get_dialogs_gen.go b/tg/tl_messages_get_dialogs_gen.go index 2d5fa3b643..862be421d7 100644 --- a/tg/tl_messages_get_dialogs_gen.go +++ b/tg/tl_messages_get_dialogs_gen.go @@ -399,9 +399,11 @@ func (g *MessagesGetDialogsRequest) GetHash() (value int64) { // // Possible errors: // +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 FOLDER_ID_INVALID: Invalid folder ID. // 400 OFFSET_PEER_ID_INVALID: The provided offset peer is invalid. +// 400 PINNED_DIALOGS_TOO_MUCH: Too many pinned dialogs. // 400 TAKEOUT_INVALID: The specified takeout ID is invalid. // // See https://core.telegram.org/method/messages.getDialogs for reference. diff --git a/tg/tl_messages_get_document_by_hash_gen.go b/tg/tl_messages_get_document_by_hash_gen.go index 86c92e87f5..c3628f01af 100644 --- a/tg/tl_messages_get_document_by_hash_gen.go +++ b/tg/tl_messages_get_document_by_hash_gen.go @@ -223,7 +223,6 @@ func (g *MessagesGetDocumentByHashRequest) GetMimeType() (value string) { // 400 SHA256_HASH_INVALID: The provided SHA256 hash is invalid. // // See https://core.telegram.org/method/messages.getDocumentByHash for reference. -// Can be used by bots. func (c *Client) MessagesGetDocumentByHash(ctx context.Context, request *MessagesGetDocumentByHashRequest) (DocumentClass, error) { var result DocumentBox diff --git a/tg/tl_messages_get_exported_chat_invite_gen.go b/tg/tl_messages_get_exported_chat_invite_gen.go index 5d041cf6da..0d9dd8bbba 100644 --- a/tg/tl_messages_get_exported_chat_invite_gen.go +++ b/tg/tl_messages_get_exported_chat_invite_gen.go @@ -198,6 +198,7 @@ func (g *MessagesGetExportedChatInviteRequest) GetLink() (value string) { // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. diff --git a/tg/tl_messages_get_exported_chat_invites_gen.go b/tg/tl_messages_get_exported_chat_invites_gen.go index b84dcf1699..5c5863274e 100644 --- a/tg/tl_messages_get_exported_chat_invites_gen.go +++ b/tg/tl_messages_get_exported_chat_invites_gen.go @@ -395,6 +395,7 @@ func (g *MessagesGetExportedChatInvitesRequest) GetLimit() (value int) { // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 CHAT_ID_INVALID: The provided chat id is invalid. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 PEER_ID_INVALID: The provided peer id is invalid. // diff --git a/tg/tl_messages_get_full_chat_gen.go b/tg/tl_messages_get_full_chat_gen.go index d5d8802f9a..0452bc09e1 100644 --- a/tg/tl_messages_get_full_chat_gen.go +++ b/tg/tl_messages_get_full_chat_gen.go @@ -179,7 +179,6 @@ func (g *MessagesGetFullChatRequest) GetChatID() (value int64) { // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.getFullChat for reference. -// Can be used by bots. func (c *Client) MessagesGetFullChat(ctx context.Context, chatid int64) (*MessagesChatFull, error) { var result MessagesChatFull diff --git a/tg/tl_messages_get_game_high_scores_gen.go b/tg/tl_messages_get_game_high_scores_gen.go index c971cf2670..45cec57ea3 100644 --- a/tg/tl_messages_get_game_high_scores_gen.go +++ b/tg/tl_messages_get_game_high_scores_gen.go @@ -235,7 +235,6 @@ func (g *MessagesGetGameHighScoresRequest) GetUserID() (value InputUserClass) { // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.getGameHighScores for reference. -// Can be used by bots. func (c *Client) MessagesGetGameHighScores(ctx context.Context, request *MessagesGetGameHighScoresRequest) (*MessagesHighScores, error) { var result MessagesHighScores diff --git a/tg/tl_messages_get_history_gen.go b/tg/tl_messages_get_history_gen.go index 91280e4bec..94ee03de75 100644 --- a/tg/tl_messages_get_history_gen.go +++ b/tg/tl_messages_get_history_gen.go @@ -368,6 +368,8 @@ func (g *MessagesGetHistoryRequest) GetHash() (value int64) { // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ID_INVALID: The provided chat id is invalid. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// 400 FROZEN_PARTICIPANT_MISSING: The current account is frozen, and cannot access the specified peer. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 TAKEOUT_INVALID: The specified takeout ID is invalid. diff --git a/tg/tl_messages_get_inline_game_high_scores_gen.go b/tg/tl_messages_get_inline_game_high_scores_gen.go index 39fd6ff38a..cd3e824716 100644 --- a/tg/tl_messages_get_inline_game_high_scores_gen.go +++ b/tg/tl_messages_get_inline_game_high_scores_gen.go @@ -207,7 +207,6 @@ func (g *MessagesGetInlineGameHighScoresRequest) GetUserID() (value InputUserCla // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.getInlineGameHighScores for reference. -// Can be used by bots. func (c *Client) MessagesGetInlineGameHighScores(ctx context.Context, request *MessagesGetInlineGameHighScoresRequest) (*MessagesHighScores, error) { var result MessagesHighScores diff --git a/tg/tl_messages_get_messages_gen.go b/tg/tl_messages_get_messages_gen.go index 47db1c710a..68dfe7dd75 100644 --- a/tg/tl_messages_get_messages_gen.go +++ b/tg/tl_messages_get_messages_gen.go @@ -188,7 +188,6 @@ func (g *MessagesGetMessagesRequest) MapID() (value InputMessageClassArray) { // Returns the list of messages by their IDs. // // See https://core.telegram.org/method/messages.getMessages for reference. -// Can be used by bots. func (c *Client) MessagesGetMessages(ctx context.Context, id []InputMessageClass) (MessagesMessagesClass, error) { var result MessagesMessagesBox diff --git a/tg/tl_messages_get_messages_views_gen.go b/tg/tl_messages_get_messages_views_gen.go index b5b014b93c..4c7a49f5b5 100644 --- a/tg/tl_messages_get_messages_views_gen.go +++ b/tg/tl_messages_get_messages_views_gen.go @@ -247,6 +247,7 @@ func (g *MessagesGetMessagesViewsRequest) GetIncrement() (value bool) { // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ID_INVALID: The provided chat id is invalid. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // diff --git a/tg/tl_messages_get_peer_dialogs_gen.go b/tg/tl_messages_get_peer_dialogs_gen.go index 1f6f1e65d2..76b31f87d0 100644 --- a/tg/tl_messages_get_peer_dialogs_gen.go +++ b/tg/tl_messages_get_peer_dialogs_gen.go @@ -191,6 +191,7 @@ func (g *MessagesGetPeerDialogsRequest) MapPeers() (value InputDialogPeerClassAr // // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. +// 400 FROZEN_PARTICIPANT_MISSING: The current account is frozen, and cannot access the specified peer. // 400 INPUT_PEERS_EMPTY: The specified peer array is empty. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. diff --git a/tg/tl_messages_get_peer_settings_gen.go b/tg/tl_messages_get_peer_settings_gen.go index 81402ca48a..58282b61fb 100644 --- a/tg/tl_messages_get_peer_settings_gen.go +++ b/tg/tl_messages_get_peer_settings_gen.go @@ -172,6 +172,7 @@ func (g *MessagesGetPeerSettingsRequest) GetPeer() (value InputPeerClass) { // Possible errors: // // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_MONOFORUM_UNSUPPORTED: Monoforums do not support this feature. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. diff --git a/tg/tl_messages_get_quick_reply_messages_gen.go b/tg/tl_messages_get_quick_reply_messages_gen.go index 560d3e98f9..5d04046983 100644 --- a/tg/tl_messages_get_quick_reply_messages_gen.go +++ b/tg/tl_messages_get_quick_reply_messages_gen.go @@ -50,10 +50,11 @@ type MessagesGetQuickReplyMessagesRequest struct { // // Use SetID and GetID helpers. ID []int - // Hash used for caching, for more info click here¹ + // Hash for pagination, generated as specified here »¹ (not the usual algorithm used + // for hash generation). // // Links: - // 1) https://core.telegram.org/api/offsets#hash-generation + // 1) https://core.telegram.org/api/business#quick-reply-shortcuts Hash int64 } diff --git a/tg/tl_messages_get_saved_dialogs_by_id_gen.go b/tg/tl_messages_get_saved_dialogs_by_id_gen.go index a44041bf7d..3912eeed32 100644 --- a/tg/tl_messages_get_saved_dialogs_by_id_gen.go +++ b/tg/tl_messages_get_saved_dialogs_by_id_gen.go @@ -32,6 +32,11 @@ var ( ) // MessagesGetSavedDialogsByIDRequest represents TL type `messages.getSavedDialogsByID#6f6f9c96`. +// Obtain information about specific saved message dialogs »¹ or monoforum topics »². +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#saved-message-dialogs +// 2. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/method/messages.getSavedDialogsByID for reference. type MessagesGetSavedDialogsByIDRequest struct { @@ -40,11 +45,15 @@ type MessagesGetSavedDialogsByIDRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ParentPeer field of MessagesGetSavedDialogsByIDRequest. + // If set, fetches monoforum topics »¹, otherwise fetches saved message dialogs »². + // + // Links: + // 1) https://core.telegram.org/api/monoforum + // 2) https://core.telegram.org/api/saved-messages#saved-message-dialogs // // Use SetParentPeer and GetParentPeer helpers. ParentPeer InputPeerClass - // IDs field of MessagesGetSavedDialogsByIDRequest. + // IDs of dialogs (topics) to fetch. IDs []InputPeerClass } @@ -258,9 +267,13 @@ func (g *MessagesGetSavedDialogsByIDRequest) MapIDs() (value InputPeerClassArray } // MessagesGetSavedDialogsByID invokes method messages.getSavedDialogsByID#6f6f9c96 returning error if any. +// Obtain information about specific saved message dialogs »¹ or monoforum topics »². +// +// Links: +// 1. https://core.telegram.org/api/saved-messages#saved-message-dialogs +// 2. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/method/messages.getSavedDialogsByID for reference. -// Can be used by bots. func (c *Client) MessagesGetSavedDialogsByID(ctx context.Context, request *MessagesGetSavedDialogsByIDRequest) (MessagesSavedDialogsClass, error) { var result MessagesSavedDialogsBox diff --git a/tg/tl_messages_get_saved_dialogs_gen.go b/tg/tl_messages_get_saved_dialogs_gen.go index 93fd035146..0e2fb59237 100644 --- a/tg/tl_messages_get_saved_dialogs_gen.go +++ b/tg/tl_messages_get_saved_dialogs_gen.go @@ -32,10 +32,11 @@ var ( ) // MessagesGetSavedDialogsRequest represents TL type `messages.getSavedDialogs#1e91fc99`. -// Returns the current saved dialog list, see here »¹ for more info. +// Returns the current saved dialog list »¹ or monoforum topic list »². // // Links: // 1. https://core.telegram.org/api/saved-messages +// 2. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/method/messages.getSavedDialogs for reference. type MessagesGetSavedDialogsRequest struct { @@ -46,7 +47,8 @@ type MessagesGetSavedDialogsRequest struct { Flags bin.Fields // Exclude pinned dialogs ExcludePinned bool - // ParentPeer field of MessagesGetSavedDialogsRequest. + // If set, fetches the topic list of the passed monoforum, otherwise fetches the saved + // dialog list. // // Use SetParentPeer and GetParentPeer helpers. ParentPeer InputPeerClass @@ -400,10 +402,11 @@ func (g *MessagesGetSavedDialogsRequest) GetHash() (value int64) { } // MessagesGetSavedDialogs invokes method messages.getSavedDialogs#1e91fc99 returning error if any. -// Returns the current saved dialog list, see here »¹ for more info. +// Returns the current saved dialog list »¹ or monoforum topic list »². // // Links: // 1. https://core.telegram.org/api/saved-messages +// 2. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/method/messages.getSavedDialogs for reference. func (c *Client) MessagesGetSavedDialogs(ctx context.Context, request *MessagesGetSavedDialogsRequest) (MessagesSavedDialogsClass, error) { diff --git a/tg/tl_messages_get_saved_history_gen.go b/tg/tl_messages_get_saved_history_gen.go index bacfd4474d..f75e4958c3 100644 --- a/tg/tl_messages_get_saved_history_gen.go +++ b/tg/tl_messages_get_saved_history_gen.go @@ -32,10 +32,12 @@ var ( ) // MessagesGetSavedHistoryRequest represents TL type `messages.getSavedHistory#998ab009`. -// Returns saved messages »¹ forwarded from a specific peer +// Fetch saved messages »¹ forwarded from a specific peer, or fetch messages from a +// monoforum topic »². // // Links: // 1. https://core.telegram.org/api/saved-messages +// 2. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/method/messages.getSavedHistory for reference. type MessagesGetSavedHistoryRequest struct { @@ -44,11 +46,12 @@ type MessagesGetSavedHistoryRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ParentPeer field of MessagesGetSavedHistoryRequest. + // If set, fetches messages from the specified monoforum, otherwise fetches from saved + // messages. // // Use SetParentPeer and GetParentPeer helpers. ParentPeer InputPeerClass - // Target peer + // Target peer (or topic) Peer InputPeerClass // Only return messages starting from the specified message ID OffsetID int @@ -438,10 +441,12 @@ func (g *MessagesGetSavedHistoryRequest) GetHash() (value int64) { } // MessagesGetSavedHistory invokes method messages.getSavedHistory#998ab009 returning error if any. -// Returns saved messages »¹ forwarded from a specific peer +// Fetch saved messages »¹ forwarded from a specific peer, or fetch messages from a +// monoforum topic »². // // Links: // 1. https://core.telegram.org/api/saved-messages +// 2. https://core.telegram.org/api/monoforum // // Possible errors: // diff --git a/tg/tl_messages_get_saved_reaction_tags_gen.go b/tg/tl_messages_get_saved_reaction_tags_gen.go index d1fd261404..98d2386ec4 100644 --- a/tg/tl_messages_get_saved_reaction_tags_gen.go +++ b/tg/tl_messages_get_saved_reaction_tags_gen.go @@ -250,6 +250,10 @@ func (g *MessagesGetSavedReactionTagsRequest) GetHash() (value int64) { // Links: // 1. https://core.telegram.org/api/saved-messages#tags // +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/messages.getSavedReactionTags for reference. func (c *Client) MessagesGetSavedReactionTags(ctx context.Context, request *MessagesGetSavedReactionTagsRequest) (MessagesSavedReactionTagsClass, error) { var result MessagesSavedReactionTagsBox diff --git a/tg/tl_messages_get_scheduled_history_gen.go b/tg/tl_messages_get_scheduled_history_gen.go index d76ab40464..84b22c810e 100644 --- a/tg/tl_messages_get_scheduled_history_gen.go +++ b/tg/tl_messages_get_scheduled_history_gen.go @@ -39,8 +39,9 @@ type MessagesGetScheduledHistoryRequest struct { // Peer Peer InputPeerClass // Hash used for caching, for more info click here¹. To generate the hash, populate the - // ids array with the id, date and edit_date (in this order) of the previously returned - // messages (in order, i.e. ids = [id1, date1, edit_date1, id2, date2, edit_date2, ...]). + // ids array with the id, edit_date (0 if unedited) and date (in this order) of the + // previously returned messages (in order, i.e. ids = [id1, (edit_date1 ?? 0), date1, id2 + // (edit_date2 ?? 0), date2, ...]). // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation diff --git a/tg/tl_messages_get_sponsored_messages_gen.go b/tg/tl_messages_get_sponsored_messages_gen.go index 52629aac4c..9b167262f8 100644 --- a/tg/tl_messages_get_sponsored_messages_gen.go +++ b/tg/tl_messages_get_sponsored_messages_gen.go @@ -46,7 +46,10 @@ type MessagesGetSponsoredMessagesRequest struct { Flags bin.Fields // The currently open channel/bot. Peer InputPeerClass - // MsgID field of MessagesGetSponsoredMessagesRequest. + // Must be set when fetching sponsored messages to show on channel videos »¹. + // + // Links: + // 1) https://core.telegram.org/api/sponsored-messages#getting-sponsored-video-advertisements // // Use SetMsgID and GetMsgID helpers. MsgID int @@ -244,6 +247,11 @@ func (g *MessagesGetSponsoredMessagesRequest) GetMsgID() (value int, ok bool) { // Links: // 1. https://core.telegram.org/api/sponsored-messages // +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. +// // See https://core.telegram.org/method/messages.getSponsoredMessages for reference. func (c *Client) MessagesGetSponsoredMessages(ctx context.Context, request *MessagesGetSponsoredMessagesRequest) (MessagesSponsoredMessagesClass, error) { var result MessagesSponsoredMessagesBox diff --git a/tg/tl_messages_get_sticker_set_gen.go b/tg/tl_messages_get_sticker_set_gen.go index 0da828b455..3727e01347 100644 --- a/tg/tl_messages_get_sticker_set_gen.go +++ b/tg/tl_messages_get_sticker_set_gen.go @@ -205,7 +205,6 @@ func (g *MessagesGetStickerSetRequest) GetHash() (value int) { // 406 STICKERSET_INVALID: The provided sticker set is invalid. // // See https://core.telegram.org/method/messages.getStickerSet for reference. -// Can be used by bots. func (c *Client) MessagesGetStickerSet(ctx context.Context, request *MessagesGetStickerSetRequest) (MessagesStickerSetClass, error) { var result MessagesStickerSetBox diff --git a/tg/tl_messages_get_unread_reactions_gen.go b/tg/tl_messages_get_unread_reactions_gen.go index e169053339..38b983b508 100644 --- a/tg/tl_messages_get_unread_reactions_gen.go +++ b/tg/tl_messages_get_unread_reactions_gen.go @@ -50,7 +50,11 @@ type MessagesGetUnreadReactionsRequest struct { // // Use SetTopMsgID and GetTopMsgID helpers. TopMsgID int - // SavedPeerID field of MessagesGetUnreadReactionsRequest. + // If set, must be equal to the ID of a monoforum topic¹: will affect that topic in the + // monoforum passed in peer. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID InputPeerClass diff --git a/tg/tl_messages_hide_chat_join_request_gen.go b/tg/tl_messages_hide_chat_join_request_gen.go index 72503a6952..87f7c79ac7 100644 --- a/tg/tl_messages_hide_chat_join_request_gen.go +++ b/tg/tl_messages_hide_chat_join_request_gen.go @@ -284,7 +284,6 @@ func (h *MessagesHideChatJoinRequestRequest) GetUserID() (value InputUserClass) // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/messages.hideChatJoinRequest for reference. -// Can be used by bots. func (c *Client) MessagesHideChatJoinRequest(ctx context.Context, request *MessagesHideChatJoinRequestRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_mark_dialog_unread_gen.go b/tg/tl_messages_mark_dialog_unread_gen.go index b27c074969..1454007128 100644 --- a/tg/tl_messages_mark_dialog_unread_gen.go +++ b/tg/tl_messages_mark_dialog_unread_gen.go @@ -43,7 +43,11 @@ type MessagesMarkDialogUnreadRequest struct { Flags bin.Fields // Mark as unread/read Unread bool - // ParentPeer field of MessagesMarkDialogUnreadRequest. + // If set, must be equal to the ID of a monoforum¹, and will affect the monoforum topic + // passed in peer. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetParentPeer and GetParentPeer helpers. ParentPeer InputPeerClass diff --git a/tg/tl_messages_messages_gen.go b/tg/tl_messages_messages_gen.go index c92c376f53..05acab64be 100644 --- a/tg/tl_messages_messages_gen.go +++ b/tg/tl_messages_messages_gen.go @@ -363,11 +363,16 @@ type MessagesMessagesSlice struct { // Indicates the absolute position of messages[0] within the total result set with count // count. This is useful, for example, if the result was fetched using offset_id, and we // need to display a progress/total counter (like photo 134 of 200, for all media in a - // chat, we could simply use photo ${offset_id_offset} of ${count}. + // chat, we could simply use photo ${offset_id_offset} of ${count}). // // Use SetOffsetIDOffset and GetOffsetIDOffset helpers. OffsetIDOffset int - // SearchFlood field of MessagesMessagesSlice. + // For global post searches »¹, the remaining amount of free searches, here + // query_is_free is related to the current call only, not to the next paginated call, and + // all subsequent pagination calls will always be free. + // + // Links: + // 1) https://core.telegram.org/api/search#posts-tab // // Use SetSearchFlood and GetSearchFlood helpers. SearchFlood SearchPostsFlood diff --git a/tg/tl_messages_reactions_gen.go b/tg/tl_messages_reactions_gen.go index bbb92ee916..50a1c86b0b 100644 --- a/tg/tl_messages_reactions_gen.go +++ b/tg/tl_messages_reactions_gen.go @@ -144,10 +144,11 @@ func (r *MessagesReactionsNotModified) DecodeBare(b *bin.Buffer) error { // // See https://core.telegram.org/constructor/messages.reactions for reference. type MessagesReactions struct { - // Hash used for caching, for more info click here¹ + // Hash used for caching, can also be locally regenerated using the algorithm specified + // here »¹. // // Links: - // 1) https://core.telegram.org/api/offsets#hash-generation + // 1) https://core.telegram.org/api/reactions#recent-reactions Hash int64 // Reactions Reactions []ReactionClass diff --git a/tg/tl_messages_read_history_gen.go b/tg/tl_messages_read_history_gen.go index 0136a14633..0871f23f3d 100644 --- a/tg/tl_messages_read_history_gen.go +++ b/tg/tl_messages_read_history_gen.go @@ -199,6 +199,7 @@ func (r *MessagesReadHistoryRequest) GetMaxID() (value int) { // // Possible errors: // +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 MSG_ID_INVALID: Invalid message ID provided. diff --git a/tg/tl_messages_read_message_contents_gen.go b/tg/tl_messages_read_message_contents_gen.go index 7c459f5806..7b962fb8c2 100644 --- a/tg/tl_messages_read_message_contents_gen.go +++ b/tg/tl_messages_read_message_contents_gen.go @@ -33,7 +33,10 @@ var ( // MessagesReadMessageContentsRequest represents TL type `messages.readMessageContents#36a73f77`. // Notifies the sender about the recipient having listened a voice message or watched a -// video. +// video, emitting an updateReadMessagesContents¹. +// +// Links: +// 1. https://core.telegram.org/constructor/updateReadMessagesContents // // See https://core.telegram.org/method/messages.readMessageContents for reference. type MessagesReadMessageContentsRequest struct { @@ -177,7 +180,10 @@ func (r *MessagesReadMessageContentsRequest) GetID() (value []int) { // MessagesReadMessageContents invokes method messages.readMessageContents#36a73f77 returning error if any. // Notifies the sender about the recipient having listened a voice message or watched a -// video. +// video, emitting an updateReadMessagesContents¹. +// +// Links: +// 1. https://core.telegram.org/constructor/updateReadMessagesContents // // See https://core.telegram.org/method/messages.readMessageContents for reference. func (c *Client) MessagesReadMessageContents(ctx context.Context, id []int) (*MessagesAffectedMessages, error) { diff --git a/tg/tl_messages_read_reactions_gen.go b/tg/tl_messages_read_reactions_gen.go index 15791b7d2b..7fc65c46df 100644 --- a/tg/tl_messages_read_reactions_gen.go +++ b/tg/tl_messages_read_reactions_gen.go @@ -53,7 +53,11 @@ type MessagesReadReactionsRequest struct { // // Use SetTopMsgID and GetTopMsgID helpers. TopMsgID int - // SavedPeerID field of MessagesReadReactionsRequest. + // If set, must be equal to the ID of a monoforum topic¹: will affect that topic in the + // monoforum passed in peer. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID InputPeerClass diff --git a/tg/tl_messages_read_saved_history_gen.go b/tg/tl_messages_read_saved_history_gen.go index 6bf6a845f1..4a6d92b4b8 100644 --- a/tg/tl_messages_read_saved_history_gen.go +++ b/tg/tl_messages_read_saved_history_gen.go @@ -32,14 +32,19 @@ var ( ) // MessagesReadSavedHistoryRequest represents TL type `messages.readSavedHistory#ba4a3b5b`. +// Mark messages as read in a monoforum topic »¹. +// +// Links: +// 1. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/method/messages.readSavedHistory for reference. type MessagesReadSavedHistoryRequest struct { - // ParentPeer field of MessagesReadSavedHistoryRequest. + // ID of the monoforum group. ParentPeer InputPeerClass - // Peer field of MessagesReadSavedHistoryRequest. + // ID of the topic. Peer InputPeerClass - // MaxID field of MessagesReadSavedHistoryRequest. + // If a positive value is passed, only messages with identifiers less or equal than the + // given one will be read. MaxID int } @@ -225,9 +230,17 @@ func (r *MessagesReadSavedHistoryRequest) GetMaxID() (value int) { } // MessagesReadSavedHistory invokes method messages.readSavedHistory#ba4a3b5b returning error if any. +// Mark messages as read in a monoforum topic »¹. +// +// Links: +// 1. https://core.telegram.org/api/monoforum +// +// Possible errors: +// +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 PARENT_PEER_INVALID: The specified parent_peer is invalid. // // See https://core.telegram.org/method/messages.readSavedHistory for reference. -// Can be used by bots. func (c *Client) MessagesReadSavedHistory(ctx context.Context, request *MessagesReadSavedHistoryRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_report_messages_delivery_gen.go b/tg/tl_messages_report_messages_delivery_gen.go index 4e1d92dda9..9ecb54328b 100644 --- a/tg/tl_messages_report_messages_delivery_gen.go +++ b/tg/tl_messages_report_messages_delivery_gen.go @@ -32,6 +32,15 @@ var ( ) // MessagesReportMessagesDeliveryRequest represents TL type `messages.reportMessagesDelivery#5a6d7395`. +// Used for Telegram Gateway verification messages »¹: indicate to the server that one +// or more message²s were received by the client, if requested by the message³ +// report_delivery_until_date flag or the equivalent flag in push notifications⁴. +// +// Links: +// 1. https://telegram.org/blog/star-messages-gateway-2-0-and-more#save-even-more-on-user-verification +// 2. https://core.telegram.org/constructor/message +// 3. https://core.telegram.org/constructor/message +// 4. https://core.telegram.org/api/push-updates // // See https://core.telegram.org/method/messages.reportMessagesDelivery for reference. type MessagesReportMessagesDeliveryRequest struct { @@ -40,11 +49,14 @@ type MessagesReportMessagesDeliveryRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Push field of MessagesReportMessagesDeliveryRequest. + // Must be set if the messages were received from a push notification¹. + // + // Links: + // 1) https://core.telegram.org/api/push-updates Push bool - // Peer field of MessagesReportMessagesDeliveryRequest. + // The peer where the messages were received. Peer InputPeerClass - // ID field of MessagesReportMessagesDeliveryRequest. + // The IDs of the received messages. ID []int } @@ -262,6 +274,15 @@ func (r *MessagesReportMessagesDeliveryRequest) GetID() (value []int) { } // MessagesReportMessagesDelivery invokes method messages.reportMessagesDelivery#5a6d7395 returning error if any. +// Used for Telegram Gateway verification messages »¹: indicate to the server that one +// or more message²s were received by the client, if requested by the message³ +// report_delivery_until_date flag or the equivalent flag in push notifications⁴. +// +// Links: +// 1. https://telegram.org/blog/star-messages-gateway-2-0-and-more#save-even-more-on-user-verification +// 2. https://core.telegram.org/constructor/message +// 3. https://core.telegram.org/constructor/message +// 4. https://core.telegram.org/api/push-updates // // Possible errors: // diff --git a/tg/tl_messages_request_app_web_view_gen.go b/tg/tl_messages_request_app_web_view_gen.go index 8577a7ebc3..7b0a8aafd1 100644 --- a/tg/tl_messages_request_app_web_view_gen.go +++ b/tg/tl_messages_request_app_web_view_gen.go @@ -498,6 +498,8 @@ func (r *MessagesRequestAppWebViewRequest) GetPlatform() (value string) { // 400 BOT_APP_BOT_INVALID: The bot_id passed in the inputBotAppShortName constructor is invalid. // 400 BOT_APP_INVALID: The specified bot app is invalid. // 400 BOT_APP_SHORTNAME_INVALID: The specified bot app short name is invalid. +// 400 MSG_ID_INVALID: Invalid message ID provided. +// 400 THEME_PARAMS_INVALID: The specified theme_params field is invalid. // // See https://core.telegram.org/method/messages.requestAppWebView for reference. func (c *Client) MessagesRequestAppWebView(ctx context.Context, request *MessagesRequestAppWebViewRequest) (*WebViewResultURL, error) { diff --git a/tg/tl_messages_request_encryption_gen.go b/tg/tl_messages_request_encryption_gen.go index 7a202e4e18..1ee09c0d97 100644 --- a/tg/tl_messages_request_encryption_gen.go +++ b/tg/tl_messages_request_encryption_gen.go @@ -232,6 +232,7 @@ func (r *MessagesRequestEncryptionRequest) GetGA() (value []byte) { // 400 DH_G_A_INVALID: g_a invalid. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 USER_ID_INVALID: The provided user ID is invalid. +// 403 USER_IS_BLOCKED: You were blocked by this user. // // See https://core.telegram.org/method/messages.requestEncryption for reference. func (c *Client) MessagesRequestEncryption(ctx context.Context, request *MessagesRequestEncryptionRequest) (EncryptedChatClass, error) { diff --git a/tg/tl_messages_request_web_view_gen.go b/tg/tl_messages_request_web_view_gen.go index e6e9e48575..1449e75885 100644 --- a/tg/tl_messages_request_web_view_gen.go +++ b/tg/tl_messages_request_web_view_gen.go @@ -696,6 +696,7 @@ func (r *MessagesRequestWebViewRequest) GetSendAs() (value InputPeerClass, ok bo // // 400 BOT_INVALID: This is not a valid bot. // 400 BOT_WEBVIEW_DISABLED: A webview cannot be opened in the specified conditions: emitted for example if from_bot_menu or url are set and peer is not the chat with the bot. +// 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. diff --git a/tg/tl_messages_save_default_send_as_gen.go b/tg/tl_messages_save_default_send_as_gen.go index c6b05986db..be9e1bfe55 100644 --- a/tg/tl_messages_save_default_send_as_gen.go +++ b/tg/tl_messages_save_default_send_as_gen.go @@ -205,6 +205,7 @@ func (s *MessagesSaveDefaultSendAsRequest) GetSendAs() (value InputPeerClass) { // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. // diff --git a/tg/tl_messages_save_draft_gen.go b/tg/tl_messages_save_draft_gen.go index 5abf263f1e..793cb171ba 100644 --- a/tg/tl_messages_save_draft_gen.go +++ b/tg/tl_messages_save_draft_gen.go @@ -76,7 +76,10 @@ type MessagesSaveDraftRequest struct { // // Use SetEffect and GetEffect helpers. Effect int64 - // SuggestedPost field of MessagesSaveDraftRequest. + // Used to suggest a post to a channel, see here »¹ for more info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/suggested-posts // // Use SetSuggestedPost and GetSuggestedPost helpers. SuggestedPost SuggestedPost @@ -580,6 +583,7 @@ func (s *MessagesSaveDraftRequest) MapEntities() (value MessageEntityClassArray, // Possible errors: // // 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // diff --git a/tg/tl_messages_save_prepared_inline_message_gen.go b/tg/tl_messages_save_prepared_inline_message_gen.go index 4ba0a00a13..3d5c6a7e64 100644 --- a/tg/tl_messages_save_prepared_inline_message_gen.go +++ b/tg/tl_messages_save_prepared_inline_message_gen.go @@ -312,11 +312,11 @@ func (s *MessagesSavePreparedInlineMessageRequest) MapPeerTypes() (value InlineQ // Possible errors: // // 400 RESULT_ID_INVALID: One of the specified result IDs is invalid. +// 400 SEND_MESSAGE_GAME_INVALID: An inputBotInlineMessageGame can only be contained in an inputBotInlineResultGame, not in an inputBotInlineResult/inputBotInlineResultPhoto/etc. // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/messages.savePreparedInlineMessage for reference. -// Can be used by bots. func (c *Client) MessagesSavePreparedInlineMessage(ctx context.Context, request *MessagesSavePreparedInlineMessageRequest) (*MessagesBotPreparedInlineMessage, error) { var result MessagesBotPreparedInlineMessage diff --git a/tg/tl_messages_saved_reaction_tags_gen.go b/tg/tl_messages_saved_reaction_tags_gen.go index cd7a96a2e3..936103becc 100644 --- a/tg/tl_messages_saved_reaction_tags_gen.go +++ b/tg/tl_messages_saved_reaction_tags_gen.go @@ -146,10 +146,12 @@ func (s *MessagesSavedReactionTagsNotModified) DecodeBare(b *bin.Buffer) error { type MessagesSavedReactionTags struct { // Saved reaction tags. Tags []SavedReactionTag - // Hash used for caching, for more info click here¹ + // Hash used for caching, for more info click here¹. Can also be manually regenerated, + // if needed, using the custom algorithm specified here »². // // Links: // 1) https://core.telegram.org/api/offsets#hash-generation + // 2) https://core.telegram.org/api/saved-messages#tags Hash int64 } diff --git a/tg/tl_messages_search_gen.go b/tg/tl_messages_search_gen.go index a2c260447f..fd31a87045 100644 --- a/tg/tl_messages_search_gen.go +++ b/tg/tl_messages_search_gen.go @@ -740,6 +740,7 @@ func (s *MessagesSearchRequest) MapSavedReaction() (value ReactionClassArray, ok // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 PEER_ID_NOT_SUPPORTED: The provided peer ID is not supported. // 400 SEARCH_QUERY_EMPTY: The search query is empty. +// 400 TAKEOUT_INVALID: The specified takeout ID is invalid. // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/messages.search for reference. diff --git a/tg/tl_messages_search_global_gen.go b/tg/tl_messages_search_global_gen.go index 1183e7825e..a8fc28d19d 100644 --- a/tg/tl_messages_search_global_gen.go +++ b/tg/tl_messages_search_global_gen.go @@ -68,7 +68,8 @@ type MessagesSearchGlobalRequest struct { // If a positive value was transferred, the method will return only messages with date // smaller than max_date MaxDate int - // Initially 0, then set to the next_rate parameter of messages.messagesSlice¹ + // Initially 0, then set to the next_rate parameter of messages.messagesSlice¹, or if + // that is absent, the date of the last returned message. // // Links: // 1) https://core.telegram.org/constructor/messages.messagesSlice diff --git a/tg/tl_messages_send_inline_bot_result_gen.go b/tg/tl_messages_send_inline_bot_result_gen.go index 391b7ef835..7739e55e17 100644 --- a/tg/tl_messages_send_inline_bot_result_gen.go +++ b/tg/tl_messages_send_inline_bot_result_gen.go @@ -94,7 +94,12 @@ type MessagesSendInlineBotResultRequest struct { // // Use SetQuickReplyShortcut and GetQuickReplyShortcut helpers. QuickReplyShortcut InputQuickReplyShortcutClass - // AllowPaidStars field of MessagesSendInlineBotResultRequest. + // For paid messages »¹, specifies the amount of Telegram Stars² the user has agreed + // to pay in order to send the message. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages + // 2) https://core.telegram.org/api/stars // // Use SetAllowPaidStars and GetAllowPaidStars helpers. AllowPaidStars int64 @@ -692,6 +697,7 @@ func (s *MessagesSendInlineBotResultRequest) GetAllowPaidStars() (value int64, o // // Possible errors: // +// 403 ALLOW_PAYMENT_REQUIRED_%d: This peer charges %d Telegram Stars per message, but the allow_paid_stars was not set or its value is smaller than %d. // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. @@ -713,6 +719,7 @@ func (s *MessagesSendInlineBotResultRequest) GetAllowPaidStars() (value int64, o // 400 MEDIA_EMPTY: The provided media object is invalid. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 403 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. // 400 QUERY_ID_EMPTY: The query ID is empty. // 400 QUICK_REPLIES_TOO_MUCH: A maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. @@ -721,6 +728,7 @@ func (s *MessagesSendInlineBotResultRequest) GetAllowPaidStars() (value int64, o // 400 RESULT_ID_INVALID: One of the specified result IDs is invalid. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. +// 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. // 500 SEND_MEDIA_INVALID: The specified media is invalid. // 420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat. // 400 TOPIC_DELETED: The specified topic was deleted. diff --git a/tg/tl_messages_send_media_gen.go b/tg/tl_messages_send_media_gen.go index f707dc255f..30ff4cea72 100644 --- a/tg/tl_messages_send_media_gen.go +++ b/tg/tl_messages_send_media_gen.go @@ -117,11 +117,19 @@ type MessagesSendMediaRequest struct { // // Use SetEffect and GetEffect helpers. Effect int64 - // AllowPaidStars field of MessagesSendMediaRequest. + // For paid messages »¹, specifies the amount of Telegram Stars² the user has agreed + // to pay in order to send the message. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages + // 2) https://core.telegram.org/api/stars // // Use SetAllowPaidStars and GetAllowPaidStars helpers. AllowPaidStars int64 - // SuggestedPost field of MessagesSendMediaRequest. + // Used to suggest a post to a channel, see here »¹ for more info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/suggested-posts // // Use SetSuggestedPost and GetSuggestedPost helpers. SuggestedPost SuggestedPost @@ -1027,15 +1035,19 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // // Possible errors: // +// 406 ALLOW_PAYMENT_REQUIRED: This peer only accepts paid messages »: this error is only emitted for older layers without paid messages support, so the client must be updated in order to use paid messages. . +// 403 ALLOW_PAYMENT_REQUIRED_%d: This peer charges %d Telegram Stars per message, but the allow_paid_stars was not set or its value is smaller than %d. // 400 BOT_GAMES_DISABLED: Games can't be sent to channels. // 400 BOT_PAYMENTS_DISABLED: Please enable bot payments in botfather before calling this method. // 400 BROADCAST_PUBLIC_VOTERS_FORBIDDEN: You can't forward polls with public voters. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection. // 400 BUTTON_COPY_TEXT_INVALID: The specified keyboardButtonCopy.copy_text is invalid. // 400 BUTTON_DATA_INVALID: The data of one or more of the buttons you provided is invalid. // 400 BUTTON_POS_INVALID: The position of one of the keyboard buttons is invalid (i.e. a Game or Pay button not in the first position, and so on...). // 400 BUTTON_TYPE_INVALID: The type of one or more of the buttons you provided is invalid. // 400 BUTTON_URL_INVALID: Button URL invalid. +// 400 BUTTON_USER_PRIVACY_RESTRICTED: The privacy setting of the user specified in a inputKeyboardButtonUserProfile button do not allow creating such a button. // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. @@ -1056,9 +1068,11 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 CURRENCY_TOTAL_AMOUNT_INVALID: The total amount of all prices is invalid. // 400 DOCUMENT_INVALID: The specified document is invalid. +// 400 EFFECT_ID_INVALID: The specified effect ID is invalid. // 400 EMOTICON_INVALID: The specified emoji is invalid. // 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. // 400 EXTENDED_MEDIA_AMOUNT_INVALID: The specified stars_amount of the passed inputMediaPaidMedia is invalid. +// 400 EXTENDED_MEDIA_INVALID: The specified paid media is invalid. // 400 EXTERNAL_URL_INVALID: External URL invalid. // 400 FILE_PARTS_INVALID: The number of file parts is invalid. // 400 FILE_PART_LENGTH_INVALID: The length of a file part is invalid. @@ -1076,7 +1090,7 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 400 MESSAGE_EMPTY: The provided message is empty. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PAYMENT_PROVIDER_INVALID: The specified payment provider is invalid. -// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 406 PEER_ID_INVALID: The provided peer id is invalid. // 400 PHOTO_EXT_INVALID: The extension of the photo is invalid. // 400 PHOTO_INVALID_DIMENSIONS: The photo dimensions are invalid. // 400 PHOTO_SAVE_FILE_INVALID: Internal issues, try again later. @@ -1087,6 +1101,7 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 400 POLL_QUESTION_INVALID: One of the poll questions is not acceptable. // 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // 403 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. +// 400 QUICK_REPLIES_BOT_NOT_ALLOWED: Quick replies cannot be used by bots. // 400 QUICK_REPLIES_TOO_MUCH: A maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached. // 400 QUIZ_CORRECT_ANSWERS_EMPTY: No correct quiz answer was specified. // 400 QUIZ_CORRECT_ANSWERS_TOO_MUCH: You specified too many correct answers in a quiz, quizzes can only have one right answer! @@ -1098,6 +1113,7 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 400 REPLY_MARKUP_INVALID: The provided reply markup is invalid. // 400 REPLY_MARKUP_TOO_LONG: The specified reply_markup is too long. // 400 REPLY_MESSAGES_TOO_MUCH: Each shortcut can contain a maximum of appConfig.quick_reply_messages_limit messages, the limit was reached. +// 400 REPLY_MESSAGE_ID_INVALID: The specified reply-to message ID is invalid. // 400 SCHEDULE_BOT_NOT_ALLOWED: Bots cannot schedule messages. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. @@ -1106,7 +1122,10 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 400 STARS_INVOICE_INVALID: The specified Telegram Star invoice is invalid. // 400 STORY_ID_INVALID: The specified story ID is invalid. // 400 SUBSCRIPTION_EXPORT_MISSING: You cannot send a bot subscription invoice directly, you may only create invoice links using payments.exportInvoice. +// 400 SUGGESTED_POST_PEER_INVALID: You cannot send suggested posts to non-monoforum peers. // 400 TERMS_URL_INVALID: The specified invoice.terms_url is invalid. +// 400 TODO_ITEMS_EMPTY: A checklist was specified, but no checklist items were passed. +// 400 TODO_ITEM_DUPLICATE: Duplicate checklist items detected. // 406 TOPIC_CLOSED: This topic was closed, you can't send messages to it anymore. // 406 TOPIC_DELETED: The specified topic was deleted. // 400 TTL_MEDIA_INVALID: Invalid media Time To Live was provided. @@ -1123,7 +1142,6 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 400 YOU_BLOCKED_USER: You blocked this user. // // See https://core.telegram.org/method/messages.sendMedia for reference. -// Can be used by bots. func (c *Client) MessagesSendMedia(ctx context.Context, request *MessagesSendMediaRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_send_message_gen.go b/tg/tl_messages_send_message_gen.go index cd111449b2..50375a6b53 100644 --- a/tg/tl_messages_send_message_gen.go +++ b/tg/tl_messages_send_message_gen.go @@ -117,11 +117,19 @@ type MessagesSendMessageRequest struct { // // Use SetEffect and GetEffect helpers. Effect int64 - // AllowPaidStars field of MessagesSendMessageRequest. + // For paid messages »¹, specifies the amount of Telegram Stars² the user has agreed + // to pay in order to send the message. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages + // 2) https://core.telegram.org/api/stars // // Use SetAllowPaidStars and GetAllowPaidStars helpers. AllowPaidStars int64 - // SuggestedPost field of MessagesSendMessageRequest. + // Used to suggest a post to a channel, see here »¹ for more info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/suggested-posts // // Use SetSuggestedPost and GetSuggestedPost helpers. SuggestedPost SuggestedPost @@ -1031,8 +1039,12 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // Possible errors: // // 400 ADMIN_RIGHTS_EMPTY: The chatAdminRights constructor passed in keyboardButtonRequestPeer.peer_type.user_admin_rights has no rights set (i.e. flags is 0). +// 406 ALLOW_PAYMENT_REQUIRED: This peer only accepts paid messages »: this error is only emitted for older layers without paid messages support, so the client must be updated in order to use paid messages. . +// 403 ALLOW_PAYMENT_REQUIRED_%d: This peer charges %d Telegram Stars per message, but the allow_paid_stars was not set or its value is smaller than %d. +// 400 BALANCE_TOO_LOW: The transaction cannot be completed because the current Telegram Stars balance is too low. // 400 BOT_DOMAIN_INVALID: Bot domain invalid. // 400 BOT_INVALID: This is not a valid bot. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection. // 400 BUSINESS_PEER_USAGE_MISSING: You cannot send a message to a user through a business connection if the user hasn't recently contacted us. // 400 BUTTON_COPY_TEXT_INVALID: The specified keyboardButtonCopy.copy_text is invalid. @@ -1043,8 +1055,10 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 400 BUTTON_USER_INVALID: The user_id passed to inputKeyboardButtonUserProfile is invalid! // 400 BUTTON_USER_PRIVACY_RESTRICTED: The privacy setting of the user specified in a inputKeyboardButtonUserProfile button do not allow creating such a button. // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_MONOFORUM_UNSUPPORTED: Monoforums do not support this feature. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 CHAT_FORWARDS_RESTRICTED: You can't forward messages from a protected chat. // 403 CHAT_GUEST_SEND_FORBIDDEN: You join the discussion group before commenting, see here » for more info. // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 CHAT_RESTRICTED: You can't send messages in this chat, you were restricted. @@ -1063,10 +1077,12 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 500 MSG_WAIT_FAILED: A waiting call returned an error. // 406 PAYMENT_UNSUPPORTED: A detailed description of the error will be received separately as described here ». // 404 PEER_ID_INVALID: The provided peer id is invalid. +// 400 PEER_TYPES_INVALID: The passed keyboardButtonSwitchInline.peer_types field is invalid. // 400 PINNED_DIALOGS_TOO_MUCH: Too many pinned dialogs. // 400 POLL_OPTION_INVALID: Invalid poll option provided. // 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. -// 406 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. +// 403 PRIVACY_PREMIUM_REQUIRED: You need a Telegram Premium subscription to send a message to this user. +// 400 QUICK_REPLIES_BOT_NOT_ALLOWED: Quick replies cannot be used by bots. // 400 QUICK_REPLIES_TOO_MUCH: A maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached. // 400 QUOTE_TEXT_INVALID: The specified reply_to.quote_text field is invalid. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. @@ -1075,6 +1091,7 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 400 REPLY_MESSAGES_TOO_MUCH: Each shortcut can contain a maximum of appConfig.quick_reply_messages_limit messages, the limit was reached. // 400 REPLY_MESSAGE_ID_INVALID: The specified reply-to message ID is invalid. // 400 REPLY_TO_INVALID: The specified reply_to field is invalid. +// 400 REPLY_TO_MONOFORUM_PEER_INVALID: The specified inputReplyToMonoForum.monoforum_peer_id is invalid. // 400 REPLY_TO_USER_INVALID: The replied-to user is invalid. // 400 SCHEDULE_BOT_NOT_ALLOWED: Bots cannot schedule messages. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. @@ -1082,7 +1099,10 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. // 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. // 420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat. +// 400 STORIES_NEVER_CREATED: This peer hasn't ever posted any stories. // 400 STORY_ID_INVALID: The specified story ID is invalid. +// 400 SUGGESTED_POST_AMOUNT_INVALID: The specified price for the suggested post is invalid. +// 400 SUGGESTED_POST_PEER_INVALID: You cannot send suggested posts to non-monoforum peers. // 406 TOPIC_CLOSED: This topic was closed, you can't send messages to it anymore. // 406 TOPIC_DELETED: The specified topic was deleted. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. @@ -1092,7 +1112,6 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 400 YOU_BLOCKED_USER: You blocked this user. // // See https://core.telegram.org/method/messages.sendMessage for reference. -// Can be used by bots. func (c *Client) MessagesSendMessage(ctx context.Context, request *MessagesSendMessageRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_send_multi_media_gen.go b/tg/tl_messages_send_multi_media_gen.go index 81f4205bcf..d69c50298d 100644 --- a/tg/tl_messages_send_multi_media_gen.go +++ b/tg/tl_messages_send_multi_media_gen.go @@ -109,7 +109,12 @@ type MessagesSendMultiMediaRequest struct { // // Use SetEffect and GetEffect helpers. Effect int64 - // AllowPaidStars field of MessagesSendMultiMediaRequest. + // For paid messages »¹, specifies the amount of Telegram Stars² the user has agreed + // to pay in order to send the message. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages + // 2) https://core.telegram.org/api/stars // // Use SetAllowPaidStars and GetAllowPaidStars helpers. AllowPaidStars int64 @@ -815,6 +820,8 @@ func (s *MessagesSendMultiMediaRequest) GetAllowPaidStars() (value int64, ok boo // // Possible errors: // +// 403 ALLOW_PAYMENT_REQUIRED_%d: This peer charges %d Telegram Stars per message, but the allow_paid_stars was not set or its value is smaller than %d. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection. // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. @@ -824,8 +831,9 @@ func (s *MessagesSendMultiMediaRequest) GetAllowPaidStars() (value int64, ok boo // 403 CHAT_SEND_PHOTOS_FORBIDDEN: You can't send photos in this chat. // 403 CHAT_SEND_VIDEOS_FORBIDDEN: You can't send videos in this chat. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. +// 400 EFFECT_ID_INVALID: The specified effect ID is invalid. // 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. -// 400 FILE_REFERENCE_%d_EXPIRED: The file reference of the media file at index %d in the passed media array expired, it must be refreshed. +// 400 FILE_REFERENCE_%d_EXPIRED: The file reference of the media file at index %d in the passed media array expired, it must be refreshed as specified in the documentation. . // 400 FILE_REFERENCE_%d_INVALID: The file reference of the media file at index %d in the passed media array is invalid. // 400 MEDIA_CAPTION_TOO_LONG: The caption is too long. // 400 MEDIA_EMPTY: The provided media object is invalid. @@ -833,6 +841,7 @@ func (s *MessagesSendMultiMediaRequest) GetAllowPaidStars() (value int64, ok boo // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 MULTI_MEDIA_TOO_LONG: Too many media files for album. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 QUICK_REPLIES_BOT_NOT_ALLOWED: Quick replies cannot be used by bots. // 400 QUICK_REPLIES_TOO_MUCH: A maximum of appConfig.quick_replies_limit shortcuts may be created, the limit was reached. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // 400 RANDOM_ID_EMPTY: Random ID empty. @@ -847,7 +856,6 @@ func (s *MessagesSendMultiMediaRequest) GetAllowPaidStars() (value int64, ok boo // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // // See https://core.telegram.org/method/messages.sendMultiMedia for reference. -// Can be used by bots. func (c *Client) MessagesSendMultiMedia(ctx context.Context, request *MessagesSendMultiMediaRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_send_paid_reaction_gen.go b/tg/tl_messages_send_paid_reaction_gen.go index 27631d9385..baa026748a 100644 --- a/tg/tl_messages_send_paid_reaction_gen.go +++ b/tg/tl_messages_send_paid_reaction_gen.go @@ -55,23 +55,20 @@ type MessagesSendPaidReactionRequest struct { // Links: // 1) https://core.telegram.org/api/stars Count int - // Unique client message ID required to prevent message resending + // Unique client message ID required to prevent message resending. Note: this argument + // must be composed of a 64-bit integer where the lower 32 bits are random, and the + // higher 32 bits are equal to the current unixtime, i.e. uint64_t random_id = (time() << + // 32) | ((uint64_t)random_uint32_t()): this differs from the random_id format of all + // other methods in the API, which just take 64 random bits. RandomID int64 // Each post with star reactions has a leaderboard with the top senders, but users can - // opt out of appearing there if they prefer more privacy. If the user explicitly chose - // to make their paid reaction(s) private, pass boolTrue¹ to messages.sendPaidReaction² - // private. If the user explicitly chose to make their paid reaction(s) not private, - // pass boolFalse³ to messages.sendPaidReaction⁴.private. If the user did not make - // any explicit choice about the privacy of their paid reaction(s) (i.e. when reacting by - // clicking on an existing star reaction on a message), do not populate the messages - // sendPaidReaction⁵.private flag. + // opt out of appearing there if they prefer more privacy. Not populating this field will + // use the default reaction privacy, stored on the server and synced to clients using + // updatePaidReactionPrivacy¹ (see here² for more info). // // Links: - // 1) https://core.telegram.org/constructor/boolTrue - // 2) https://core.telegram.org/method/messages.sendPaidReaction - // 3) https://core.telegram.org/constructor/boolTrue - // 4) https://core.telegram.org/method/messages.sendPaidReaction - // 5) https://core.telegram.org/method/messages.sendPaidReaction + // 1) https://core.telegram.org/constructor/updatePaidReactionPrivacy + // 2) https://core.telegram.org/api/reactions#paid-reaction-privacy // // Use SetPrivate and GetPrivate helpers. Private PaidReactionPrivacyClass @@ -353,7 +350,15 @@ func (s *MessagesSendPaidReactionRequest) GetPrivate() (value PaidReactionPrivac // // Possible errors: // +// 400 BALANCE_TOO_LOW: The transaction cannot be completed because the current Telegram Stars balance is too low. +// 400 CHANNEL_INVALID: The provided channel is invalid. +// 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 RANDOM_ID_EMPTY: Random ID empty. +// 400 RANDOM_ID_EXPIRED: The specified random_id was expired (most likely it didn't follow the required uint64_t random_id = (time() << 32) | ((uint64_t)random_uint32_t()) format, or the specified time is too far in the past). +// 400 REACTIONS_COUNT_INVALID: The specified number of reactions is invalid. +// 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. // // See https://core.telegram.org/method/messages.sendPaidReaction for reference. func (c *Client) MessagesSendPaidReaction(ctx context.Context, request *MessagesSendPaidReactionRequest) (UpdatesClass, error) { diff --git a/tg/tl_messages_send_reaction_gen.go b/tg/tl_messages_send_reaction_gen.go index 15d550cc9c..3c35f338a6 100644 --- a/tg/tl_messages_send_reaction_gen.go +++ b/tg/tl_messages_send_reaction_gen.go @@ -57,7 +57,12 @@ type MessagesSendReactionRequest struct { Peer InputPeerClass // Message ID to react to MsgID int - // A list of reactions + // A list of reactions (doesn't accept reactionPaid¹ constructors, use messages + // sendPaidReaction² to send paid reactions, instead). + // + // Links: + // 1) https://core.telegram.org/constructor/reactionPaid + // 2) https://core.telegram.org/method/messages.sendPaidReaction // // Use SetReaction and GetReaction helpers. Reaction []ReactionClass diff --git a/tg/tl_messages_send_web_view_result_message_gen.go b/tg/tl_messages_send_web_view_result_message_gen.go index 689627b1ae..91bb94ec62 100644 --- a/tg/tl_messages_send_web_view_result_message_gen.go +++ b/tg/tl_messages_send_web_view_result_message_gen.go @@ -213,7 +213,6 @@ func (s *MessagesSendWebViewResultMessageRequest) GetResult() (value InputBotInl // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.sendWebViewResultMessage for reference. -// Can be used by bots. func (c *Client) MessagesSendWebViewResultMessage(ctx context.Context, request *MessagesSendWebViewResultMessageRequest) (*WebViewMessageSent, error) { var result WebViewMessageSent diff --git a/tg/tl_messages_set_bot_callback_answer_gen.go b/tg/tl_messages_set_bot_callback_answer_gen.go index 72fabbf940..a634d4b971 100644 --- a/tg/tl_messages_set_bot_callback_answer_gen.go +++ b/tg/tl_messages_set_bot_callback_answer_gen.go @@ -351,7 +351,6 @@ func (s *MessagesSetBotCallbackAnswerRequest) GetCacheTime() (value int) { // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.setBotCallbackAnswer for reference. -// Can be used by bots. func (c *Client) MessagesSetBotCallbackAnswer(ctx context.Context, request *MessagesSetBotCallbackAnswerRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_set_bot_precheckout_results_gen.go b/tg/tl_messages_set_bot_precheckout_results_gen.go index ad80b01b20..7235ab987d 100644 --- a/tg/tl_messages_set_bot_precheckout_results_gen.go +++ b/tg/tl_messages_set_bot_precheckout_results_gen.go @@ -294,7 +294,6 @@ func (s *MessagesSetBotPrecheckoutResultsRequest) GetError() (value string, ok b // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.setBotPrecheckoutResults for reference. -// Can be used by bots. func (c *Client) MessagesSetBotPrecheckoutResults(ctx context.Context, request *MessagesSetBotPrecheckoutResultsRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_set_bot_shipping_results_gen.go b/tg/tl_messages_set_bot_shipping_results_gen.go index 356edb46e5..0a73fccc33 100644 --- a/tg/tl_messages_set_bot_shipping_results_gen.go +++ b/tg/tl_messages_set_bot_shipping_results_gen.go @@ -314,7 +314,6 @@ func (s *MessagesSetBotShippingResultsRequest) GetShippingOptions() (value []Shi // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.setBotShippingResults for reference. -// Can be used by bots. func (c *Client) MessagesSetBotShippingResults(ctx context.Context, request *MessagesSetBotShippingResultsRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_set_chat_available_reactions_gen.go b/tg/tl_messages_set_chat_available_reactions_gen.go index 05c21d173b..2cef6d5843 100644 --- a/tg/tl_messages_set_chat_available_reactions_gen.go +++ b/tg/tl_messages_set_chat_available_reactions_gen.go @@ -344,7 +344,9 @@ func (s *MessagesSetChatAvailableReactionsRequest) GetPaidEnabled() (value bool, // // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// 400 DOCUMENT_INVALID: The specified document is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 REACTION_INVALID: The specified reaction is invalid. // // See https://core.telegram.org/method/messages.setChatAvailableReactions for reference. func (c *Client) MessagesSetChatAvailableReactions(ctx context.Context, request *MessagesSetChatAvailableReactionsRequest) (UpdatesClass, error) { diff --git a/tg/tl_messages_set_chat_theme_gen.go b/tg/tl_messages_set_chat_theme_gen.go index a7560d4c8d..bf4e82a194 100644 --- a/tg/tl_messages_set_chat_theme_gen.go +++ b/tg/tl_messages_set_chat_theme_gen.go @@ -32,13 +32,16 @@ var ( ) // MessagesSetChatThemeRequest represents TL type `messages.setChatTheme#81202c9`. -// Change the chat theme of a certain chat +// Change the chat theme of a certain chat, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/themes#chat-themes // // See https://core.telegram.org/method/messages.setChatTheme for reference. type MessagesSetChatThemeRequest struct { // Private chat where to change theme Peer InputPeerClass - // Theme field of MessagesSetChatThemeRequest. + // The theme to set. Theme InputChatThemeClass } @@ -199,7 +202,10 @@ func (s *MessagesSetChatThemeRequest) GetTheme() (value InputChatThemeClass) { } // MessagesSetChatTheme invokes method messages.setChatTheme#81202c9 returning error if any. -// Change the chat theme of a certain chat +// Change the chat theme of a certain chat, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/themes#chat-themes // // Possible errors: // diff --git a/tg/tl_messages_set_game_score_gen.go b/tg/tl_messages_set_game_score_gen.go index 5a8f131ee3..0afd870bd0 100644 --- a/tg/tl_messages_set_game_score_gen.go +++ b/tg/tl_messages_set_game_score_gen.go @@ -359,7 +359,6 @@ func (s *MessagesSetGameScoreRequest) GetScore() (value int) { // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.setGameScore for reference. -// Can be used by bots. func (c *Client) MessagesSetGameScore(ctx context.Context, request *MessagesSetGameScoreRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_set_inline_bot_results_gen.go b/tg/tl_messages_set_inline_bot_results_gen.go index db2e2e0bac..943895110a 100644 --- a/tg/tl_messages_set_inline_bot_results_gen.go +++ b/tg/tl_messages_set_inline_bot_results_gen.go @@ -521,17 +521,16 @@ func (s *MessagesSetInlineBotResultsRequest) MapResults() (value InputBotInlineR // 400 SWITCH_PM_TEXT_EMPTY: The switch_pm.text field was empty. // 400 SWITCH_WEBVIEW_URL_INVALID: The URL specified in switch_webview.url is invalid! // 400 URL_INVALID: Invalid URL provided. -// 403 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // 400 VIDEO_CONTENT_TYPE_INVALID: The video's content type is invalid. // 400 VIDEO_TITLE_EMPTY: The specified video title is empty. // 400 WEBDOCUMENT_INVALID: Invalid webdocument URL provided. // 400 WEBDOCUMENT_MIME_INVALID: Invalid webdocument mime type provided. // 400 WEBDOCUMENT_SIZE_TOO_BIG: Webdocument is too big! +// 400 WEBDOCUMENT_URL_EMPTY: The passed web document URL is empty. // 400 WEBDOCUMENT_URL_INVALID: The specified webdocument URL is invalid. // // See https://core.telegram.org/method/messages.setInlineBotResults for reference. -// Can be used by bots. func (c *Client) MessagesSetInlineBotResults(ctx context.Context, request *MessagesSetInlineBotResultsRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_set_inline_game_score_gen.go b/tg/tl_messages_set_inline_game_score_gen.go index ca7b8ba568..5d9fa12b42 100644 --- a/tg/tl_messages_set_inline_game_score_gen.go +++ b/tg/tl_messages_set_inline_game_score_gen.go @@ -329,7 +329,6 @@ func (s *MessagesSetInlineGameScoreRequest) GetScore() (value int) { // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // // See https://core.telegram.org/method/messages.setInlineGameScore for reference. -// Can be used by bots. func (c *Client) MessagesSetInlineGameScore(ctx context.Context, request *MessagesSetInlineGameScoreRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_set_typing_gen.go b/tg/tl_messages_set_typing_gen.go index f69d8a6e7d..d7b1af3455 100644 --- a/tg/tl_messages_set_typing_gen.go +++ b/tg/tl_messages_set_typing_gen.go @@ -283,6 +283,7 @@ func (s *MessagesSetTypingRequest) GetAction() (value SendMessageActionClass) { // // Possible errors: // +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection. // 400 BUSINESS_PEER_USAGE_MISSING: You cannot send a message to a user through a business connection if the user hasn't recently contacted us. // 400 CHANNEL_INVALID: The provided channel is invalid. @@ -293,13 +294,12 @@ func (s *MessagesSetTypingRequest) GetAction() (value SendMessageActionClass) { // 403 GROUPCALL_FORBIDDEN: The group call has already ended. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MSG_ID_INVALID: Invalid message ID provided. -// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 406 PEER_ID_INVALID: The provided peer id is invalid. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // 403 USER_IS_BLOCKED: You were blocked by this user. // 400 USER_IS_BOT: Bots can't send messages to other bots. // // See https://core.telegram.org/method/messages.setTyping for reference. -// Can be used by bots. func (c *Client) MessagesSetTyping(ctx context.Context, request *MessagesSetTypingRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_sponsored_messages_gen.go b/tg/tl_messages_sponsored_messages_gen.go index 15fa816470..a51f4bca2b 100644 --- a/tg/tl_messages_sponsored_messages_gen.go +++ b/tg/tl_messages_sponsored_messages_gen.go @@ -46,11 +46,19 @@ type MessagesSponsoredMessages struct { // // Use SetPostsBetween and GetPostsBetween helpers. PostsBetween int - // StartDelay field of MessagesSponsoredMessages. + // For sponsored messages to show on channel videos »¹, the number of seconds to wait + // before showing the first ad. + // + // Links: + // 1) https://core.telegram.org/api/sponsored-messages#getting-sponsored-video-advertisements // // Use SetStartDelay and GetStartDelay helpers. StartDelay int - // BetweenDelay field of MessagesSponsoredMessages. + // For sponsored messages to show on channel videos »¹, the number of seconds to wait + // after the previous ad is hidden, before showing the next ad. + // + // Links: + // 1) https://core.telegram.org/api/sponsored-messages#getting-sponsored-video-advertisements // // Use SetBetweenDelay and GetBetweenDelay helpers. BetweenDelay int diff --git a/tg/tl_messages_toggle_paid_reaction_privacy_gen.go b/tg/tl_messages_toggle_paid_reaction_privacy_gen.go index 3380ee24b9..89e34d1b5a 100644 --- a/tg/tl_messages_toggle_paid_reaction_privacy_gen.go +++ b/tg/tl_messages_toggle_paid_reaction_privacy_gen.go @@ -238,6 +238,7 @@ func (t *MessagesTogglePaidReactionPrivacyRequest) GetPrivate() (value PaidReact // Possible errors: // // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 REACTION_EMPTY: Empty reaction provided. // // See https://core.telegram.org/method/messages.togglePaidReactionPrivacy for reference. func (c *Client) MessagesTogglePaidReactionPrivacy(ctx context.Context, request *MessagesTogglePaidReactionPrivacyRequest) (bool, error) { diff --git a/tg/tl_messages_toggle_suggested_post_approval_gen.go b/tg/tl_messages_toggle_suggested_post_approval_gen.go index 385109bdb6..a22d06317f 100644 --- a/tg/tl_messages_toggle_suggested_post_approval_gen.go +++ b/tg/tl_messages_toggle_suggested_post_approval_gen.go @@ -32,6 +32,10 @@ var ( ) // MessagesToggleSuggestedPostApprovalRequest represents TL type `messages.toggleSuggestedPostApproval#8107455c`. +// Approve or reject a suggested post »¹. +// +// Links: +// 1. https://core.telegram.org/api/suggested-posts // // See https://core.telegram.org/method/messages.toggleSuggestedPostApproval for reference. type MessagesToggleSuggestedPostApprovalRequest struct { @@ -40,17 +44,21 @@ type MessagesToggleSuggestedPostApprovalRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Reject field of MessagesToggleSuggestedPostApprovalRequest. + // Reject the suggested post. Reject bool - // Peer field of MessagesToggleSuggestedPostApprovalRequest. + // Both for users and channels, must contain the ID of the direct messages monoforum »¹ + // (for channels, the topic ID is extracted automatically from the msg_id). + // + // Links: + // 1) https://core.telegram.org/api/monoforum Peer InputPeerClass - // MsgID field of MessagesToggleSuggestedPostApprovalRequest. + // ID of the suggestion message. MsgID int - // ScheduleDate field of MessagesToggleSuggestedPostApprovalRequest. + // Custom scheduling date. // // Use SetScheduleDate and GetScheduleDate helpers. ScheduleDate int - // RejectComment field of MessagesToggleSuggestedPostApprovalRequest. + // Optional comment for rejections (can only be used if reject is set). // // Use SetRejectComment and GetRejectComment helpers. RejectComment string @@ -345,9 +353,16 @@ func (t *MessagesToggleSuggestedPostApprovalRequest) GetRejectComment() (value s } // MessagesToggleSuggestedPostApproval invokes method messages.toggleSuggestedPostApproval#8107455c returning error if any. +// Approve or reject a suggested post »¹. +// +// Links: +// 1. https://core.telegram.org/api/suggested-posts +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.toggleSuggestedPostApproval for reference. -// Can be used by bots. func (c *Client) MessagesToggleSuggestedPostApproval(ctx context.Context, request *MessagesToggleSuggestedPostApprovalRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_toggle_todo_completed_gen.go b/tg/tl_messages_toggle_todo_completed_gen.go index 6dbef79eb5..ec5be6cd79 100644 --- a/tg/tl_messages_toggle_todo_completed_gen.go +++ b/tg/tl_messages_toggle_todo_completed_gen.go @@ -32,16 +32,20 @@ var ( ) // MessagesToggleTodoCompletedRequest represents TL type `messages.toggleTodoCompleted#d3e03124`. +// Mark one or more items of a todo list »¹ as completed or not completed. +// +// Links: +// 1. https://core.telegram.org/api/todo // // See https://core.telegram.org/method/messages.toggleTodoCompleted for reference. type MessagesToggleTodoCompletedRequest struct { - // Peer field of MessagesToggleTodoCompletedRequest. + // Peer where the todo list was posted. Peer InputPeerClass - // MsgID field of MessagesToggleTodoCompletedRequest. + // ID of the message with the todo list. MsgID int - // Completed field of MessagesToggleTodoCompletedRequest. + // Items to mark as completed. Completed []int - // Incompleted field of MessagesToggleTodoCompletedRequest. + // Items to mark as not completed. Incompleted []int } @@ -273,9 +277,16 @@ func (t *MessagesToggleTodoCompletedRequest) GetIncompleted() (value []int) { } // MessagesToggleTodoCompleted invokes method messages.toggleTodoCompleted#d3e03124 returning error if any. +// Mark one or more items of a todo list »¹ as completed or not completed. +// +// Links: +// 1. https://core.telegram.org/api/todo +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.toggleTodoCompleted for reference. -// Can be used by bots. func (c *Client) MessagesToggleTodoCompleted(ctx context.Context, request *MessagesToggleTodoCompletedRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_transcribe_audio_gen.go b/tg/tl_messages_transcribe_audio_gen.go index fe6f65d040..a5b3d4e924 100644 --- a/tg/tl_messages_transcribe_audio_gen.go +++ b/tg/tl_messages_transcribe_audio_gen.go @@ -204,6 +204,8 @@ func (t *MessagesTranscribeAudioRequest) GetMsgID() (value int) { // // Possible errors: // +// 400 MSG_ID_INVALID: Invalid message ID provided. +// 400 MSG_VOICE_MISSING: The specified message is not a voice message. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // 400 TRANSCRIPTION_FAILED: Audio transcription failed. diff --git a/tg/tl_messages_translate_text_gen.go b/tg/tl_messages_translate_text_gen.go index b0b3f3d9dd..f184a0ecd6 100644 --- a/tg/tl_messages_translate_text_gen.go +++ b/tg/tl_messages_translate_text_gen.go @@ -381,6 +381,8 @@ func (t *MessagesTranslateTextRequest) GetToLang() (value string) { // 400 TO_LANG_INVALID: The specified destination language is invalid. // 500 TRANSLATE_REQ_FAILED: Translation failed, please try again later. // 400 TRANSLATE_REQ_QUOTA_EXCEEDED: Translation is currently unavailable due to a temporary server-side lack of resources. +// 406 TRANSLATIONS_DISABLED: Translations are unavailable, a detailed and localized description for the error will be emitted via an updateServiceNotification as specified here ». +// 500 TRANSLATION_TIMEOUT: A timeout occurred while translating the specified text. // // See https://core.telegram.org/method/messages.translateText for reference. func (c *Client) MessagesTranslateText(ctx context.Context, request *MessagesTranslateTextRequest) (*MessagesTranslateResult, error) { diff --git a/tg/tl_messages_unpin_all_messages_gen.go b/tg/tl_messages_unpin_all_messages_gen.go index cc634f4acd..3a5c46923a 100644 --- a/tg/tl_messages_unpin_all_messages_gen.go +++ b/tg/tl_messages_unpin_all_messages_gen.go @@ -53,7 +53,11 @@ type MessagesUnpinAllMessagesRequest struct { // // Use SetTopMsgID and GetTopMsgID helpers. TopMsgID int - // SavedPeerID field of MessagesUnpinAllMessagesRequest. + // If set, must be equal to the ID of a monoforum topic¹, and will unpin all messages + // pinned in the passed monoforum topic. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID InputPeerClass @@ -304,10 +308,10 @@ func (u *MessagesUnpinAllMessagesRequest) GetSavedPeerID() (value InputPeerClass // // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.unpinAllMessages for reference. -// Can be used by bots. func (c *Client) MessagesUnpinAllMessages(ctx context.Context, request *MessagesUnpinAllMessagesRequest) (*MessagesAffectedHistory, error) { var result MessagesAffectedHistory diff --git a/tg/tl_messages_update_dialog_filter_gen.go b/tg/tl_messages_update_dialog_filter_gen.go index cc95a13d6d..5a1bdc939a 100644 --- a/tg/tl_messages_update_dialog_filter_gen.go +++ b/tg/tl_messages_update_dialog_filter_gen.go @@ -257,6 +257,7 @@ func (u *MessagesUpdateDialogFilterRequest) GetFilter() (value DialogFilterClass // 400 FILTER_ID_INVALID: The specified filter ID is invalid. // 400 FILTER_INCLUDE_EMPTY: The include_peers vector of the filter is empty. // 400 FILTER_TITLE_EMPTY: The title field of the filter is empty. +// 400 MESSAGE_TOO_LONG: The provided message is too long. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // diff --git a/tg/tl_messages_update_pinned_message_gen.go b/tg/tl_messages_update_pinned_message_gen.go index d3b886fbe1..83545c4edb 100644 --- a/tg/tl_messages_update_pinned_message_gen.go +++ b/tg/tl_messages_update_pinned_message_gen.go @@ -325,17 +325,20 @@ func (u *MessagesUpdatePinnedMessageRequest) GetID() (value int) { // Possible errors: // // 400 BOT_ONESIDE_NOT_AVAIL: Bots can't pin messages in PM just for themselves. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. +// 400 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 CHAT_INVALID: Invalid chat. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. +// 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 PIN_RESTRICTED: You can't pin messages. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // // See https://core.telegram.org/method/messages.updatePinnedMessage for reference. -// Can be used by bots. func (c *Client) MessagesUpdatePinnedMessage(ctx context.Context, request *MessagesUpdatePinnedMessageRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_messages_upload_encrypted_file_gen.go b/tg/tl_messages_upload_encrypted_file_gen.go index b0048afb0a..3e01420f2c 100644 --- a/tg/tl_messages_upload_encrypted_file_gen.go +++ b/tg/tl_messages_upload_encrypted_file_gen.go @@ -32,7 +32,8 @@ var ( ) // MessagesUploadEncryptedFileRequest represents TL type `messages.uploadEncryptedFile#5057c497`. -// Upload encrypted file and associate it to a secret chat +// Upload encrypted file and associate it to a secret chat (without actually sending it +// to the chat). // // See https://core.telegram.org/method/messages.uploadEncryptedFile for reference. type MessagesUploadEncryptedFileRequest struct { @@ -199,7 +200,8 @@ func (u *MessagesUploadEncryptedFileRequest) GetFileAsNotEmpty() (NotEmptyInputE } // MessagesUploadEncryptedFile invokes method messages.uploadEncryptedFile#5057c497 returning error if any. -// Upload encrypted file and associate it to a secret chat +// Upload encrypted file and associate it to a secret chat (without actually sending it +// to the chat). // // Possible errors: // diff --git a/tg/tl_messages_upload_media_gen.go b/tg/tl_messages_upload_media_gen.go index b09f1e4b23..97a0dfbc66 100644 --- a/tg/tl_messages_upload_media_gen.go +++ b/tg/tl_messages_upload_media_gen.go @@ -33,6 +33,13 @@ var ( // MessagesUploadMediaRequest represents TL type `messages.uploadMedia#14967978`. // Upload a file and associate it to a chat (without actually sending it to the chat) +// May also be used in a business connection¹, not by wrapping the query in +// invokeWithBusinessConnection »², but rather by specifying the business connection ID +// in the business_connection_id parameter. +// +// Links: +// 1. https://core.telegram.org/api/bots/connected-business-bots +// 2. https://core.telegram.org/method/invokeWithBusinessConnection // // See https://core.telegram.org/method/messages.uploadMedia for reference. type MessagesUploadMediaRequest struct { @@ -45,7 +52,7 @@ type MessagesUploadMediaRequest struct { // directly by the bot. // // Links: - // 1) https://core.telegram.org/api/business#connected-bots + // 1) https://core.telegram.org/api/bots/connected-business-bots // // Use SetBusinessConnectionID and GetBusinessConnectionID helpers. BusinessConnectionID string @@ -280,6 +287,13 @@ func (u *MessagesUploadMediaRequest) GetMedia() (value InputMediaClass) { // MessagesUploadMedia invokes method messages.uploadMedia#14967978 returning error if any. // Upload a file and associate it to a chat (without actually sending it to the chat) +// May also be used in a business connection¹, not by wrapping the query in +// invokeWithBusinessConnection »², but rather by specifying the business connection ID +// in the business_connection_id parameter. +// +// Links: +// 1. https://core.telegram.org/api/bots/connected-business-bots +// 2. https://core.telegram.org/method/invokeWithBusinessConnection // // Possible errors: // @@ -304,7 +318,6 @@ func (u *MessagesUploadMediaRequest) GetMedia() (value InputMediaClass) { // 400 WEBPAGE_CURL_FAILED: Failure while fetching the webpage with cURL. // // See https://core.telegram.org/method/messages.uploadMedia for reference. -// Can be used by bots. func (c *Client) MessagesUploadMedia(ctx context.Context, request *MessagesUploadMediaRequest) (MessageMediaClass, error) { var result MessageMediaBox diff --git a/tg/tl_messages_web_page_preview_gen.go b/tg/tl_messages_web_page_preview_gen.go index d2dc83164e..f04c513c34 100644 --- a/tg/tl_messages_web_page_preview_gen.go +++ b/tg/tl_messages_web_page_preview_gen.go @@ -32,14 +32,19 @@ var ( ) // MessagesWebPagePreview represents TL type `messages.webPagePreview#8c9a88ac`. +// Represents a webpage preview. // // See https://core.telegram.org/constructor/messages.webPagePreview for reference. type MessagesWebPagePreview struct { - // Media field of MessagesWebPagePreview. + // The messageMediaWebPage¹ or a messageMediaEmpty² if there is no preview. + // + // Links: + // 1) https://core.telegram.org/constructor/messageMediaWebPage + // 2) https://core.telegram.org/constructor/messageMediaEmpty Media MessageMediaClass - // Chats field of MessagesWebPagePreview. + // Chats mentioned in the gift field. Chats []ChatClass - // Users field of MessagesWebPagePreview. + // Users mentioned within the media object. Users []UserClass } diff --git a/tg/tl_paid_reaction_privacy_gen.go b/tg/tl_paid_reaction_privacy_gen.go index 67a6987ee6..5ddee91a2a 100644 --- a/tg/tl_paid_reaction_privacy_gen.go +++ b/tg/tl_paid_reaction_privacy_gen.go @@ -32,6 +32,10 @@ var ( ) // PaidReactionPrivacyDefault represents TL type `paidReactionPrivacyDefault#206ad49e`. +// Uses the default reaction privacy, set using messages.togglePaidReactionPrivacy¹. +// +// Links: +// 1. https://core.telegram.org/method/messages.togglePaidReactionPrivacy // // See https://core.telegram.org/constructor/paidReactionPrivacyDefault for reference. type PaidReactionPrivacyDefault struct { @@ -133,6 +137,7 @@ func (p *PaidReactionPrivacyDefault) DecodeBare(b *bin.Buffer) error { } // PaidReactionPrivacyAnonymous represents TL type `paidReactionPrivacyAnonymous#1f0c1ad9`. +// Send paid reactions anonymously. // // See https://core.telegram.org/constructor/paidReactionPrivacyAnonymous for reference. type PaidReactionPrivacyAnonymous struct { @@ -234,10 +239,14 @@ func (p *PaidReactionPrivacyAnonymous) DecodeBare(b *bin.Buffer) error { } // PaidReactionPrivacyPeer represents TL type `paidReactionPrivacyPeer#dc6cfcf0`. +// Send paid reactions as the specified peer, fetched using channels.getSendAs¹. +// +// Links: +// 1. https://core.telegram.org/method/channels.getSendAs // // See https://core.telegram.org/constructor/paidReactionPrivacyPeer for reference. type PaidReactionPrivacyPeer struct { - // Peer field of PaidReactionPrivacyPeer. + // The peer to send reactions as. Peer InputPeerClass } diff --git a/tg/tl_payments_assign_app_store_transaction_gen.go b/tg/tl_payments_assign_app_store_transaction_gen.go index 3ed1631d68..5742cd5a2c 100644 --- a/tg/tl_payments_assign_app_store_transaction_gen.go +++ b/tg/tl_payments_assign_app_store_transaction_gen.go @@ -200,6 +200,7 @@ func (a *PaymentsAssignAppStoreTransactionRequest) GetPurpose() (value InputStor // // Possible errors: // +// 400 INPUT_PURPOSE_INVALID: The specified payment purpose is invalid. // 400 RECEIPT_EMPTY: The specified receipt is empty. // // See https://core.telegram.org/method/payments.assignAppStoreTransaction for reference. diff --git a/tg/tl_payments_bot_cancel_stars_subscription_gen.go b/tg/tl_payments_bot_cancel_stars_subscription_gen.go index 3a77033b88..44b9223296 100644 --- a/tg/tl_payments_bot_cancel_stars_subscription_gen.go +++ b/tg/tl_payments_bot_cancel_stars_subscription_gen.go @@ -271,6 +271,7 @@ func (b *PaymentsBotCancelStarsSubscriptionRequest) GetChargeID() (value string) // // Possible errors: // +// 400 CHARGE_ID_INVALID: The specified charge_id is invalid. // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/payments.botCancelStarsSubscription for reference. diff --git a/tg/tl_payments_can_purchase_store_gen.go b/tg/tl_payments_can_purchase_store_gen.go index e95a230f2f..083137f22c 100644 --- a/tg/tl_payments_can_purchase_store_gen.go +++ b/tg/tl_payments_can_purchase_store_gen.go @@ -32,10 +32,12 @@ var ( ) // PaymentsCanPurchaseStoreRequest represents TL type `payments.canPurchaseStore#4fdc5ea7`. +// Checks whether a purchase is possible. Must be called before in-store purchase, +// official apps only. // // See https://core.telegram.org/method/payments.canPurchaseStore for reference. type PaymentsCanPurchaseStoreRequest struct { - // Purpose field of PaymentsCanPurchaseStoreRequest. + // Payment purpose. Purpose InputStorePaymentPurposeClass } @@ -166,9 +168,15 @@ func (c *PaymentsCanPurchaseStoreRequest) GetPurpose() (value InputStorePaymentP } // PaymentsCanPurchaseStore invokes method payments.canPurchaseStore#4fdc5ea7 returning error if any. +// Checks whether a purchase is possible. Must be called before in-store purchase, +// official apps only. +// +// Possible errors: +// +// 400 INPUT_PURPOSE_INVALID: The specified payment purpose is invalid. +// 406 PREMIUM_CURRENTLY_UNAVAILABLE: You cannot currently purchase a Premium subscription. // // See https://core.telegram.org/method/payments.canPurchaseStore for reference. -// Can be used by bots. func (c *Client) PaymentsCanPurchaseStore(ctx context.Context, purpose InputStorePaymentPurposeClass) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_check_can_send_gift_gen.go b/tg/tl_payments_check_can_send_gift_gen.go index aa609e3ff8..f74cf4de58 100644 --- a/tg/tl_payments_check_can_send_gift_gen.go +++ b/tg/tl_payments_check_can_send_gift_gen.go @@ -32,10 +32,14 @@ var ( ) // PaymentsCheckCanSendGiftRequest represents TL type `payments.checkCanSendGift#c0c4edc9`. +// Check if the specified gift »¹ can be sent. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.checkCanSendGift for reference. type PaymentsCheckCanSendGiftRequest struct { - // GiftID field of PaymentsCheckCanSendGiftRequest. + // Gift ID. GiftID int64 } @@ -161,6 +165,14 @@ func (c *PaymentsCheckCanSendGiftRequest) GetGiftID() (value int64) { } // PaymentsCheckCanSendGift invokes method payments.checkCanSendGift#c0c4edc9 returning error if any. +// Check if the specified gift »¹ can be sent. +// +// Links: +// 1. https://core.telegram.org/api/gifts +// +// Possible errors: +// +// 400 STARGIFT_INVALID: The passed gift is invalid. // // See https://core.telegram.org/method/payments.checkCanSendGift for reference. func (c *Client) PaymentsCheckCanSendGift(ctx context.Context, giftid int64) (PaymentsCheckCanSendGiftResultClass, error) { diff --git a/tg/tl_payments_check_can_send_gift_result_gen.go b/tg/tl_payments_check_can_send_gift_result_gen.go index fb4710dbc6..8fdf2cd15c 100644 --- a/tg/tl_payments_check_can_send_gift_result_gen.go +++ b/tg/tl_payments_check_can_send_gift_result_gen.go @@ -32,6 +32,7 @@ var ( ) // PaymentsCheckCanSendGiftResultOk represents TL type `payments.checkCanSendGiftResultOk#374fa7ad`. +// The specified gift can be sent. // // See https://core.telegram.org/constructor/payments.checkCanSendGiftResultOk for reference. type PaymentsCheckCanSendGiftResultOk struct { @@ -133,10 +134,11 @@ func (c *PaymentsCheckCanSendGiftResultOk) DecodeBare(b *bin.Buffer) error { } // PaymentsCheckCanSendGiftResultFail represents TL type `payments.checkCanSendGiftResultFail#d5e58274`. +// The specified gift cannot be sent yet for the specified reason. // // See https://core.telegram.org/constructor/payments.checkCanSendGiftResultFail for reference. type PaymentsCheckCanSendGiftResultFail struct { - // Reason field of PaymentsCheckCanSendGiftResultFail. + // The reason why it can't be sent yet. Reason TextWithEntities } diff --git a/tg/tl_payments_convert_star_gift_gen.go b/tg/tl_payments_convert_star_gift_gen.go index 9adaf4847a..a2e35ebc1c 100644 --- a/tg/tl_payments_convert_star_gift_gen.go +++ b/tg/tl_payments_convert_star_gift_gen.go @@ -48,7 +48,7 @@ var ( // // See https://core.telegram.org/method/payments.convertStarGift for reference. type PaymentsConvertStarGiftRequest struct { - // Stargift field of PaymentsConvertStarGiftRequest. + // The gift to convert. Stargift InputSavedStarGiftClass } @@ -195,7 +195,10 @@ func (c *PaymentsConvertStarGiftRequest) GetStargift() (value InputSavedStarGift // // Possible errors: // +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 SAVED_ID_EMPTY: The passed inputSavedStarGiftChat.saved_id is empty. +// 400 STARGIFT_PEER_INVALID: The specified inputSavedStarGiftChat.peer is invalid. // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/payments.convertStarGift for reference. diff --git a/tg/tl_payments_create_star_gift_collection_gen.go b/tg/tl_payments_create_star_gift_collection_gen.go index dfb8b95d44..15c7e2447e 100644 --- a/tg/tl_payments_create_star_gift_collection_gen.go +++ b/tg/tl_payments_create_star_gift_collection_gen.go @@ -32,14 +32,18 @@ var ( ) // PaymentsCreateStarGiftCollectionRequest represents TL type `payments.createStarGiftCollection#1f4a0e87`. +// Create a star gift collection »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections // // See https://core.telegram.org/method/payments.createStarGiftCollection for reference. type PaymentsCreateStarGiftCollectionRequest struct { - // Peer field of PaymentsCreateStarGiftCollectionRequest. + // Peer where to create the collection. Peer InputPeerClass - // Title field of PaymentsCreateStarGiftCollectionRequest. + // Title of the collection. Title string - // Stargift field of PaymentsCreateStarGiftCollectionRequest. + // Gifts added to the collection. Stargift []InputSavedStarGiftClass } @@ -243,6 +247,14 @@ func (c *PaymentsCreateStarGiftCollectionRequest) MapStargift() (value InputSave } // PaymentsCreateStarGiftCollection invokes method payments.createStarGiftCollection#1f4a0e87 returning error if any. +// Create a star gift collection »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.createStarGiftCollection for reference. func (c *Client) PaymentsCreateStarGiftCollection(ctx context.Context, request *PaymentsCreateStarGiftCollectionRequest) (*StarGiftCollection, error) { diff --git a/tg/tl_payments_delete_star_gift_collection_gen.go b/tg/tl_payments_delete_star_gift_collection_gen.go index 1d1c31bcb8..3367ccfbd7 100644 --- a/tg/tl_payments_delete_star_gift_collection_gen.go +++ b/tg/tl_payments_delete_star_gift_collection_gen.go @@ -32,12 +32,16 @@ var ( ) // PaymentsDeleteStarGiftCollectionRequest represents TL type `payments.deleteStarGiftCollection#ad5648e8`. +// Delete a star gift collection »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections // // See https://core.telegram.org/method/payments.deleteStarGiftCollection for reference. type PaymentsDeleteStarGiftCollectionRequest struct { - // Peer field of PaymentsDeleteStarGiftCollectionRequest. + // Peer that owns the collection. Peer InputPeerClass - // CollectionID field of PaymentsDeleteStarGiftCollectionRequest. + // ID of the collection. CollectionID int } @@ -193,6 +197,14 @@ func (d *PaymentsDeleteStarGiftCollectionRequest) GetCollectionID() (value int) } // PaymentsDeleteStarGiftCollection invokes method payments.deleteStarGiftCollection#ad5648e8 returning error if any. +// Delete a star gift collection »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.deleteStarGiftCollection for reference. func (c *Client) PaymentsDeleteStarGiftCollection(ctx context.Context, request *PaymentsDeleteStarGiftCollectionRequest) (bool, error) { diff --git a/tg/tl_payments_export_invoice_gen.go b/tg/tl_payments_export_invoice_gen.go index 8646b11a45..83a8ba515f 100644 --- a/tg/tl_payments_export_invoice_gen.go +++ b/tg/tl_payments_export_invoice_gen.go @@ -177,16 +177,17 @@ func (e *PaymentsExportInvoiceRequest) GetInvoiceMedia() (value InputMediaClass) // // Possible errors: // +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 CURRENCY_TOTAL_AMOUNT_INVALID: The total amount of all prices is invalid. // 400 INVOICE_PAYLOAD_INVALID: The specified invoice payload is invalid. // 400 MEDIA_INVALID: Media invalid. // 400 PAYMENT_PROVIDER_INVALID: The specified payment provider is invalid. // 400 STARS_INVOICE_INVALID: The specified Telegram Star invoice is invalid. +// 400 USER_BOT_REQUIRED: This method can only be called by a bot. // 400 WEBDOCUMENT_MIME_INVALID: Invalid webdocument mime type provided. // 400 WEBDOCUMENT_URL_EMPTY: The passed web document URL is empty. // // See https://core.telegram.org/method/payments.exportInvoice for reference. -// Can be used by bots. func (c *Client) PaymentsExportInvoice(ctx context.Context, invoicemedia InputMediaClass) (*PaymentsExportedInvoice, error) { var result PaymentsExportedInvoice diff --git a/tg/tl_payments_get_giveaway_info_gen.go b/tg/tl_payments_get_giveaway_info_gen.go index 0c3496d87a..b710db6360 100644 --- a/tg/tl_payments_get_giveaway_info_gen.go +++ b/tg/tl_payments_get_giveaway_info_gen.go @@ -207,6 +207,7 @@ func (g *PaymentsGetGiveawayInfoRequest) GetMsgID() (value int) { // // Possible errors: // +// 400 MESSAGE_ID_INVALID: The provided message id is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getGiveawayInfo for reference. diff --git a/tg/tl_payments_get_payment_form_gen.go b/tg/tl_payments_get_payment_form_gen.go index 922e54db2a..6f638f240b 100644 --- a/tg/tl_payments_get_payment_form_gen.go +++ b/tg/tl_payments_get_payment_form_gen.go @@ -243,12 +243,32 @@ func (g *PaymentsGetPaymentFormRequest) GetThemeParams() (value DataJSON, ok boo // // Possible errors: // +// 406 API_GIFT_RESTRICTED_UPDATE_APP: Please update the app to access the gift API. // 400 BOOST_PEER_INVALID: The specified boost_peer is invalid. +// 403 BOT_ACCESS_FORBIDDEN: The specified method can be used over a business connection for some operations, but the specified query attempted an operation that is not allowed over a business connection. // 400 BOT_INVOICE_INVALID: The specified invoice is invalid. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. +// 400 GIFT_MONTHS_INVALID: The value passed in invoice.inputInvoicePremiumGiftStars.months is invalid. +// 400 INVOICE_INVALID: The specified invoice is invalid. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 MONTH_INVALID: The number of months specified in inputInvoicePremiumGiftStars.months is invalid. +// 400 NO_PAYMENT_NEEDED: The upgrade/transfer of the specified gift was already paid for or is free. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 SLUG_INVALID: The specified invoice slug is invalid. -// 400 STARGIFT_INVALID: The passed inputInvoiceStarGift is invalid. +// 400 STARGIFT_ALREADY_CONVERTED: The specified star gift was already converted to Stars. +// 400 STARGIFT_ALREADY_REFUNDED: The specified star gift was already refunded. +// 400 STARGIFT_ALREADY_UPGRADED: The specified gift was already upgraded to a collectible gift. +// 406 STARGIFT_EXPORT_IN_PROGRESS: A gift export is in progress, a detailed and localized description for the error will be emitted via an updateServiceNotification as specified here ». +// 400 STARGIFT_INVALID: The passed gift is invalid. +// 400 STARGIFT_NOT_FOUND: The specified gift was not found. +// 400 STARGIFT_OWNER_INVALID: You cannot transfer or sell a gift owned by another user. +// 400 STARGIFT_PEER_INVALID: The specified inputSavedStarGiftChat.peer is invalid. +// 400 STARGIFT_RESELL_CURRENCY_NOT_ALLOWED: You can't buy the gift using the specified currency (i.e. trying to pay in Stars for TON gifts). +// 400 STARGIFT_SLUG_INVALID: The specified gift slug is invalid. +// 400 STARGIFT_TRANSFER_TOO_EARLY_%d: You cannot transfer this gift yet, wait %d seconds. +// 400 STARGIFT_UPGRADE_UNAVAILABLE: A received gift can only be upgraded to a collectible gift if the messageActionStarGift/savedStarGift.can_upgrade flag is set. +// 406 STARS_FORM_AMOUNT_MISMATCH: The form amount has changed, please fetch the new form using payments.getPaymentForm and restart the process. +// 400 TO_ID_INVALID: The specified to_id of the passed inputInvoiceStarGiftResale or inputInvoiceStarGiftTransfer is invalid. // 400 UNTIL_DATE_INVALID: Invalid until date provided. // // See https://core.telegram.org/method/payments.getPaymentForm for reference. diff --git a/tg/tl_payments_get_resale_star_gifts_gen.go b/tg/tl_payments_get_resale_star_gifts_gen.go index cca566c36f..9f472f2fb4 100644 --- a/tg/tl_payments_get_resale_star_gifts_gen.go +++ b/tg/tl_payments_get_resale_star_gifts_gen.go @@ -32,6 +32,16 @@ var ( ) // PaymentsGetResaleStarGiftsRequest represents TL type `payments.getResaleStarGifts#7a5fa236`. +// Get collectible gifts¹ of a specific type currently on resale, see here »² for more +// info. +// sort_by_price and sort_by_num are mutually exclusive, if neither are set results are +// sorted by the unixtime (descending) when their resell price was last changed. +// See here »¹ for detailed documentation on this method. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/api/gifts#reselling-collectible-gifts +// 3. https://core.telegram.org/api/gifts#sending-gifts // // See https://core.telegram.org/method/payments.getResaleStarGifts for reference. type PaymentsGetResaleStarGiftsRequest struct { @@ -40,21 +50,36 @@ type PaymentsGetResaleStarGiftsRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // SortByPrice field of PaymentsGetResaleStarGiftsRequest. + // Sort gifts by price (ascending). SortByPrice bool - // SortByNum field of PaymentsGetResaleStarGiftsRequest. + // Sort gifts by number (ascending). SortByNum bool - // AttributesHash field of PaymentsGetResaleStarGiftsRequest. + // If a previous call to the method was made and payments.resaleStarGifts¹ + // attributes_hash was set, pass it here to avoid returning any results if they haven't + // changed. Otherwise, set this flag and pass 0 to return payments.resaleStarGifts² + // attributes_hash and payments.resaleStarGifts³.attributes, these two fields will not + // be set if this flag is not set. + // + // Links: + // 1) https://core.telegram.org/constructor/payments.resaleStarGifts + // 2) https://core.telegram.org/constructor/payments.resaleStarGifts + // 3) https://core.telegram.org/constructor/payments.resaleStarGifts // // Use SetAttributesHash and GetAttributesHash helpers. AttributesHash int64 - // GiftID field of PaymentsGetResaleStarGiftsRequest. + // Mandatory identifier of the base gift from which the collectible gift was upgraded. GiftID int64 - // Attributes field of PaymentsGetResaleStarGiftsRequest. + // Optionally filter gifts with the specified attributes. If no attributes of a specific + // type are specified, all attributes of that type are allowed. // // Use SetAttributes and GetAttributes helpers. Attributes []StarGiftAttributeIDClass - // Offset field of PaymentsGetResaleStarGiftsRequest. + // Offset for pagination. If not equal to an empty string, payments.resaleStarGifts¹ + // counters will not be set to avoid returning the counters every time a new page is + // fetched. + // + // Links: + // 1) https://core.telegram.org/constructor/payments.resaleStarGifts Offset string // Maximum number of results to return, see pagination¹ // @@ -431,9 +456,22 @@ func (g *PaymentsGetResaleStarGiftsRequest) MapAttributes() (value StarGiftAttri } // PaymentsGetResaleStarGifts invokes method payments.getResaleStarGifts#7a5fa236 returning error if any. +// Get collectible gifts¹ of a specific type currently on resale, see here »² for more +// info. +// sort_by_price and sort_by_num are mutually exclusive, if neither are set results are +// sorted by the unixtime (descending) when their resell price was last changed. +// See here »¹ for detailed documentation on this method. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/api/gifts#reselling-collectible-gifts +// 3. https://core.telegram.org/api/gifts#sending-gifts +// +// Possible errors: +// +// 400 STARGIFT_INVALID: The passed gift is invalid. // // See https://core.telegram.org/method/payments.getResaleStarGifts for reference. -// Can be used by bots. func (c *Client) PaymentsGetResaleStarGifts(ctx context.Context, request *PaymentsGetResaleStarGiftsRequest) (*PaymentsResaleStarGifts, error) { var result PaymentsResaleStarGifts diff --git a/tg/tl_payments_get_saved_star_gift_gen.go b/tg/tl_payments_get_saved_star_gift_gen.go index d68a7cf008..ef8e9c9135 100644 --- a/tg/tl_payments_get_saved_star_gift_gen.go +++ b/tg/tl_payments_get_saved_star_gift_gen.go @@ -32,10 +32,16 @@ var ( ) // PaymentsGetSavedStarGiftRequest represents TL type `payments.getSavedStarGift#b455a106`. +// Fetch info about specific gifts¹ owned by a peer we control. +// Note that unlike what the name suggests, the method can be used to fetch both "saved" +// and "unsaved" gifts (aka gifts both pinned and not pinned to the profile). +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.getSavedStarGift for reference. type PaymentsGetSavedStarGiftRequest struct { - // Stargift field of PaymentsGetSavedStarGiftRequest. + // List of gifts to fetch info about. Stargift []InputSavedStarGiftClass } @@ -184,9 +190,19 @@ func (g *PaymentsGetSavedStarGiftRequest) MapStargift() (value InputSavedStarGif } // PaymentsGetSavedStarGift invokes method payments.getSavedStarGift#b455a106 returning error if any. +// Fetch info about specific gifts¹ owned by a peer we control. +// Note that unlike what the name suggests, the method can be used to fetch both "saved" +// and "unsaved" gifts (aka gifts both pinned and not pinned to the profile). +// +// Links: +// 1. https://core.telegram.org/api/gifts +// +// Possible errors: +// +// 400 SAVED_ID_EMPTY: The passed inputSavedStarGiftChat.saved_id is empty. +// 400 STARGIFT_SLUG_INVALID: The specified gift slug is invalid. // // See https://core.telegram.org/method/payments.getSavedStarGift for reference. -// Can be used by bots. func (c *Client) PaymentsGetSavedStarGift(ctx context.Context, stargift []InputSavedStarGiftClass) (*PaymentsSavedStarGifts, error) { var result PaymentsSavedStarGifts diff --git a/tg/tl_payments_get_saved_star_gifts_gen.go b/tg/tl_payments_get_saved_star_gifts_gen.go index 2cd821a0a7..4ee211bd20 100644 --- a/tg/tl_payments_get_saved_star_gifts_gen.go +++ b/tg/tl_payments_get_saved_star_gifts_gen.go @@ -32,6 +32,13 @@ var ( ) // PaymentsGetSavedStarGiftsRequest represents TL type `payments.getSavedStarGifts#a319e569`. +// Fetch the full list of gifts¹ owned by a peer. +// Note that unlike what the name suggests, the method can be used to fetch both "saved" +// and "unsaved" gifts (aka gifts both pinned and not pinned) to the profile, depending +// on the passed flags. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.getSavedStarGifts for reference. type PaymentsGetSavedStarGiftsRequest struct { @@ -40,31 +47,58 @@ type PaymentsGetSavedStarGiftsRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ExcludeUnsaved field of PaymentsGetSavedStarGiftsRequest. + // Exclude gifts not pinned on the profile. ExcludeUnsaved bool - // ExcludeSaved field of PaymentsGetSavedStarGiftsRequest. + // Exclude gifts pinned on the profile. ExcludeSaved bool - // ExcludeUnlimited field of PaymentsGetSavedStarGiftsRequest. + // Exclude gifts that do not have the starGift¹.limited flag set. + // + // Links: + // 1) https://core.telegram.org/constructor/starGift ExcludeUnlimited bool - // ExcludeUnique field of PaymentsGetSavedStarGiftsRequest. + // Exclude collectible gifts »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts ExcludeUnique bool - // SortByValue field of PaymentsGetSavedStarGiftsRequest. + // If set, sorts the gifts by price instead of reception date. SortByValue bool - // ExcludeUpgradable field of PaymentsGetSavedStarGiftsRequest. + // Exclude gifts that can be upgraded to collectible gifts »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts ExcludeUpgradable bool - // ExcludeUnupgradable field of PaymentsGetSavedStarGiftsRequest. + // Exclude gifts that cannot be upgraded to collectible gifts »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts ExcludeUnupgradable bool // PeerColorAvailable field of PaymentsGetSavedStarGiftsRequest. PeerColorAvailable bool // ExcludeHosted field of PaymentsGetSavedStarGiftsRequest. ExcludeHosted bool - // Peer field of PaymentsGetSavedStarGiftsRequest. + // Fetch only gifts owned by the specified peer, such as: a user, with + // peer=inputPeerUser¹; a channel, with peer=inputPeerChannel²; a connected business + // user³ (when executing the method as a bot, over the business connection), with + // peer=inputPeerUser⁴. + // + // Links: + // 1) https://core.telegram.org/constructor/inputPeerUser + // 2) https://core.telegram.org/constructor/inputPeerChannel + // 3) https://core.telegram.org/api/bots/connected-business-bots + // 4) https://core.telegram.org/constructor/inputPeerUser Peer InputPeerClass - // CollectionID field of PaymentsGetSavedStarGiftsRequest. + // Only returns gifts within the specified collection »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#gift-collections // // Use SetCollectionID and GetCollectionID helpers. CollectionID int - // Offset field of PaymentsGetSavedStarGiftsRequest. + // Offset for pagination¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets Offset string // Maximum number of results to return, see pagination¹ // @@ -607,9 +641,20 @@ func (g *PaymentsGetSavedStarGiftsRequest) GetLimit() (value int) { } // PaymentsGetSavedStarGifts invokes method payments.getSavedStarGifts#a319e569 returning error if any. +// Fetch the full list of gifts¹ owned by a peer. +// Note that unlike what the name suggests, the method can be used to fetch both "saved" +// and "unsaved" gifts (aka gifts both pinned and not pinned) to the profile, depending +// on the passed flags. +// +// Links: +// 1. https://core.telegram.org/api/gifts +// +// Possible errors: +// +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getSavedStarGifts for reference. -// Can be used by bots. func (c *Client) PaymentsGetSavedStarGifts(ctx context.Context, request *PaymentsGetSavedStarGiftsRequest) (*PaymentsSavedStarGifts, error) { var result PaymentsSavedStarGifts diff --git a/tg/tl_payments_get_star_gift_collections_gen.go b/tg/tl_payments_get_star_gift_collections_gen.go index 9336c1aa34..f36bb2d515 100644 --- a/tg/tl_payments_get_star_gift_collections_gen.go +++ b/tg/tl_payments_get_star_gift_collections_gen.go @@ -32,12 +32,22 @@ var ( ) // PaymentsGetStarGiftCollectionsRequest represents TL type `payments.getStarGiftCollections#981b91dd`. +// Fetches all star gift collections »¹ of a peer. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections // // See https://core.telegram.org/method/payments.getStarGiftCollections for reference. type PaymentsGetStarGiftCollectionsRequest struct { - // Peer field of PaymentsGetStarGiftCollectionsRequest. + // The peer. Peer InputPeerClass - // Hash field of PaymentsGetStarGiftCollectionsRequest. + // Hash (generated as specified here »¹) using the starGiftCollection².hash field (not + // the collection_id field) of all collections returned by a previous method call, to + // avoid refetching the result if it hasn't changed. + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation + // 2) https://core.telegram.org/constructor/starGiftCollection Hash int64 } @@ -193,6 +203,14 @@ func (g *PaymentsGetStarGiftCollectionsRequest) GetHash() (value int64) { } // PaymentsGetStarGiftCollections invokes method payments.getStarGiftCollections#981b91dd returning error if any. +// Fetches all star gift collections »¹ of a peer. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getStarGiftCollections for reference. func (c *Client) PaymentsGetStarGiftCollections(ctx context.Context, request *PaymentsGetStarGiftCollectionsRequest) (PaymentsStarGiftCollectionsClass, error) { diff --git a/tg/tl_payments_get_star_gift_upgrade_preview_gen.go b/tg/tl_payments_get_star_gift_upgrade_preview_gen.go index e34d816923..aaa3f72e06 100644 --- a/tg/tl_payments_get_star_gift_upgrade_preview_gen.go +++ b/tg/tl_payments_get_star_gift_upgrade_preview_gen.go @@ -32,10 +32,17 @@ var ( ) // PaymentsGetStarGiftUpgradePreviewRequest represents TL type `payments.getStarGiftUpgradePreview#9c9abcb1`. +// Obtain a preview of the possible attributes (chosen randomly) a gift »¹ can receive +// after upgrading it to a collectible gift »², see here »³ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/api/gifts#collectible-gifts +// 3. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/method/payments.getStarGiftUpgradePreview for reference. type PaymentsGetStarGiftUpgradePreviewRequest struct { - // GiftID field of PaymentsGetStarGiftUpgradePreviewRequest. + // The gift to upgrade. GiftID int64 } @@ -161,6 +168,17 @@ func (g *PaymentsGetStarGiftUpgradePreviewRequest) GetGiftID() (value int64) { } // PaymentsGetStarGiftUpgradePreview invokes method payments.getStarGiftUpgradePreview#9c9abcb1 returning error if any. +// Obtain a preview of the possible attributes (chosen randomly) a gift »¹ can receive +// after upgrading it to a collectible gift »², see here »³ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/api/gifts#collectible-gifts +// 3. https://core.telegram.org/api/gifts#collectible-gifts +// +// Possible errors: +// +// 400 STARGIFT_INVALID: The passed gift is invalid. // // See https://core.telegram.org/method/payments.getStarGiftUpgradePreview for reference. func (c *Client) PaymentsGetStarGiftUpgradePreview(ctx context.Context, giftid int64) (*PaymentsStarGiftUpgradePreview, error) { diff --git a/tg/tl_payments_get_star_gift_withdrawal_url_gen.go b/tg/tl_payments_get_star_gift_withdrawal_url_gen.go index fe40fd5484..71ee26a2ae 100644 --- a/tg/tl_payments_get_star_gift_withdrawal_url_gen.go +++ b/tg/tl_payments_get_star_gift_withdrawal_url_gen.go @@ -32,12 +32,19 @@ var ( ) // PaymentsGetStarGiftWithdrawalURLRequest represents TL type `payments.getStarGiftWithdrawalUrl#d06e93a8`. +// Convert a collectible gift »¹ to an NFT on the TON blockchain. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/method/payments.getStarGiftWithdrawalUrl for reference. type PaymentsGetStarGiftWithdrawalURLRequest struct { - // Stargift field of PaymentsGetStarGiftWithdrawalURLRequest. + // The collectible gift to export. Stargift InputSavedStarGiftClass - // Password field of PaymentsGetStarGiftWithdrawalURLRequest. + // The current user's 2FA password, passed as specified here »¹. + // + // Links: + // 1) https://core.telegram.org/api/srp Password InputCheckPasswordSRPClass } @@ -203,9 +210,18 @@ func (g *PaymentsGetStarGiftWithdrawalURLRequest) GetPasswordAsNotEmpty() (*Inpu } // PaymentsGetStarGiftWithdrawalURL invokes method payments.getStarGiftWithdrawalUrl#d06e93a8 returning error if any. +// Convert a collectible gift »¹ to an NFT on the TON blockchain. +// +// Links: +// 1. https://core.telegram.org/api/gifts +// +// Possible errors: +// +// 400 PASSWORD_HASH_INVALID: The provided password hash is invalid. +// 400 PASSWORD_TOO_FRESH_%d: The password was modified less than 24 hours ago, try again in %d seconds. +// 400 SESSION_TOO_FRESH_%d: This session was created less than 24 hours ago, try again in %d seconds. // // See https://core.telegram.org/method/payments.getStarGiftWithdrawalUrl for reference. -// Can be used by bots. func (c *Client) PaymentsGetStarGiftWithdrawalURL(ctx context.Context, request *PaymentsGetStarGiftWithdrawalURLRequest) (*PaymentsStarGiftWithdrawalURL, error) { var result PaymentsStarGiftWithdrawalURL diff --git a/tg/tl_payments_get_stars_gift_options_gen.go b/tg/tl_payments_get_stars_gift_options_gen.go index daab08ca1b..281f0ab729 100644 --- a/tg/tl_payments_get_stars_gift_options_gen.go +++ b/tg/tl_payments_get_stars_gift_options_gen.go @@ -221,6 +221,7 @@ func (g *PaymentsGetStarsGiftOptionsRequest) GetUserID() (value InputUserClass, // // Possible errors: // +// 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 USER_GIFT_UNAVAILABLE: Gifts are not available in the current region (stars_gifts_enabled is equal to false). // 400 USER_ID_INVALID: The provided user ID is invalid. // diff --git a/tg/tl_payments_get_stars_revenue_stats_gen.go b/tg/tl_payments_get_stars_revenue_stats_gen.go index 3669b4e384..9e29894bbb 100644 --- a/tg/tl_payments_get_stars_revenue_stats_gen.go +++ b/tg/tl_payments_get_stars_revenue_stats_gen.go @@ -46,7 +46,7 @@ type PaymentsGetStarsRevenueStatsRequest struct { Flags bin.Fields // Whether to enable dark theme for graph colors Dark bool - // Ton field of PaymentsGetStarsRevenueStatsRequest. + // If set, fetches channel/bot ad revenue statistics in TON. Ton bool // Get statistics for the specified bot, channel or ourselves (inputPeerSelf¹). // diff --git a/tg/tl_payments_get_stars_revenue_withdrawal_url_gen.go b/tg/tl_payments_get_stars_revenue_withdrawal_url_gen.go index db9c193419..e45a9088a0 100644 --- a/tg/tl_payments_get_stars_revenue_withdrawal_url_gen.go +++ b/tg/tl_payments_get_stars_revenue_withdrawal_url_gen.go @@ -35,7 +35,7 @@ var ( // Withdraw funds from a channel or bot's star balance »¹. // // Links: -// 1. https://core.telegram.org/api/stars#withdrawing-stars +// 1. https://core.telegram.org/api/stars#withdrawing-revenue // // See https://core.telegram.org/method/payments.getStarsRevenueWithdrawalUrl for reference. type PaymentsGetStarsRevenueWithdrawalURLRequest struct { @@ -44,11 +44,11 @@ type PaymentsGetStarsRevenueWithdrawalURLRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Ton field of PaymentsGetStarsRevenueWithdrawalURLRequest. + // If set, withdraws channel/ad revenue in TON. Ton bool // Channel or bot from which to withdraw funds. Peer InputPeerClass - // Amount field of PaymentsGetStarsRevenueWithdrawalURLRequest. + // The amount of stars or nanotons to withdraw. // // Use SetAmount and GetAmount helpers. Amount int64 @@ -317,7 +317,7 @@ func (g *PaymentsGetStarsRevenueWithdrawalURLRequest) GetPasswordAsNotEmpty() (* // Withdraw funds from a channel or bot's star balance »¹. // // Links: -// 1. https://core.telegram.org/api/stars#withdrawing-stars +// 1. https://core.telegram.org/api/stars#withdrawing-revenue // // Possible errors: // diff --git a/tg/tl_payments_get_stars_status_gen.go b/tg/tl_payments_get_stars_status_gen.go index 0c43678d37..7b1912cf87 100644 --- a/tg/tl_payments_get_stars_status_gen.go +++ b/tg/tl_payments_get_stars_status_gen.go @@ -46,7 +46,7 @@ type PaymentsGetStarsStatusRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Ton field of PaymentsGetStarsStatusRequest. + // If set, returns the channel/ad revenue balance in nanotons. Ton bool // Peer of which to get the balance. Peer InputPeerClass @@ -237,6 +237,8 @@ func (g *PaymentsGetStarsStatusRequest) GetPeer() (value InputPeerClass) { // // Possible errors: // +// 403 BOT_ACCESS_FORBIDDEN: The specified method can be used over a business connection for some operations, but the specified query attempted an operation that is not allowed over a business connection. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getStarsStatus for reference. diff --git a/tg/tl_payments_get_stars_transactions_by_id_gen.go b/tg/tl_payments_get_stars_transactions_by_id_gen.go index 43d2ecff0c..5c401b3227 100644 --- a/tg/tl_payments_get_stars_transactions_by_id_gen.go +++ b/tg/tl_payments_get_stars_transactions_by_id_gen.go @@ -44,7 +44,7 @@ type PaymentsGetStarsTransactionsByIDRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Ton field of PaymentsGetStarsTransactionsByIDRequest. + // If set, returns channel/bot ad revenue transactions in nanotons. Ton bool // Channel or bot. Peer InputPeerClass diff --git a/tg/tl_payments_get_stars_transactions_gen.go b/tg/tl_payments_get_stars_transactions_gen.go index 3734be31a1..dbbd4a7830 100644 --- a/tg/tl_payments_get_stars_transactions_gen.go +++ b/tg/tl_payments_get_stars_transactions_gen.go @@ -52,7 +52,7 @@ type PaymentsGetStarsTransactionsRequest struct { Outbound bool // Return transactions in ascending order by date (instead of descending order by date). Ascending bool - // Ton field of PaymentsGetStarsTransactionsRequest. + // If set, returns the channel/ad revenue transactions in nanotons, instead. Ton bool // If set, fetches only transactions for the specified Telegram Star subscription »¹. // @@ -459,9 +459,9 @@ func (g *PaymentsGetStarsTransactionsRequest) GetLimit() (value int) { // // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 SUBSCRIPTION_ID_INVALID: The specified subscription_id is invalid. // // See https://core.telegram.org/method/payments.getStarsTransactions for reference. -// Can be used by bots. func (c *Client) PaymentsGetStarsTransactions(ctx context.Context, request *PaymentsGetStarsTransactionsRequest) (*PaymentsStarsStatus, error) { var result PaymentsStarsStatus diff --git a/tg/tl_payments_get_unique_star_gift_gen.go b/tg/tl_payments_get_unique_star_gift_gen.go index 8d4504358b..24433aa28d 100644 --- a/tg/tl_payments_get_unique_star_gift_gen.go +++ b/tg/tl_payments_get_unique_star_gift_gen.go @@ -32,10 +32,16 @@ var ( ) // PaymentsGetUniqueStarGiftRequest represents TL type `payments.getUniqueStarGift#a1974d72`. +// Obtain info about a collectible gift »¹ using a slug obtained from a collectible +// gift link »². +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/api/links#collectible-gift-link // // See https://core.telegram.org/method/payments.getUniqueStarGift for reference. type PaymentsGetUniqueStarGiftRequest struct { - // Slug field of PaymentsGetUniqueStarGiftRequest. + // The slug. Slug string } @@ -161,9 +167,18 @@ func (g *PaymentsGetUniqueStarGiftRequest) GetSlug() (value string) { } // PaymentsGetUniqueStarGift invokes method payments.getUniqueStarGift#a1974d72 returning error if any. +// Obtain info about a collectible gift »¹ using a slug obtained from a collectible +// gift link »². +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/api/links#collectible-gift-link +// +// Possible errors: +// +// 400 STARGIFT_SLUG_INVALID: The specified gift slug is invalid. // // See https://core.telegram.org/method/payments.getUniqueStarGift for reference. -// Can be used by bots. func (c *Client) PaymentsGetUniqueStarGift(ctx context.Context, slug string) (*PaymentsUniqueStarGift, error) { var result PaymentsUniqueStarGift diff --git a/tg/tl_payments_get_unique_star_gift_value_info_gen.go b/tg/tl_payments_get_unique_star_gift_value_info_gen.go index b2bbe169c7..939bdd7ca0 100644 --- a/tg/tl_payments_get_unique_star_gift_value_info_gen.go +++ b/tg/tl_payments_get_unique_star_gift_value_info_gen.go @@ -32,10 +32,17 @@ var ( ) // PaymentsGetUniqueStarGiftValueInfoRequest represents TL type `payments.getUniqueStarGiftValueInfo#4365af6b`. +// Get information about the value of a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/method/payments.getUniqueStarGiftValueInfo for reference. type PaymentsGetUniqueStarGiftValueInfoRequest struct { - // Slug field of PaymentsGetUniqueStarGiftValueInfoRequest. + // slug from a starGiftUnique¹. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftUnique Slug string } @@ -161,6 +168,14 @@ func (g *PaymentsGetUniqueStarGiftValueInfoRequest) GetSlug() (value string) { } // PaymentsGetUniqueStarGiftValueInfo invokes method payments.getUniqueStarGiftValueInfo#4365af6b returning error if any. +// Get information about the value of a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// +// Possible errors: +// +// 400 STARGIFT_SLUG_INVALID: The specified gift slug is invalid. // // See https://core.telegram.org/method/payments.getUniqueStarGiftValueInfo for reference. func (c *Client) PaymentsGetUniqueStarGiftValueInfo(ctx context.Context, slug string) (*PaymentsUniqueStarGiftValueInfo, error) { diff --git a/tg/tl_payments_refund_stars_charge_gen.go b/tg/tl_payments_refund_stars_charge_gen.go index f7bdfdbb3d..037af5a668 100644 --- a/tg/tl_payments_refund_stars_charge_gen.go +++ b/tg/tl_payments_refund_stars_charge_gen.go @@ -207,11 +207,11 @@ func (r *PaymentsRefundStarsChargeRequest) GetChargeID() (value string) { // Possible errors: // // 400 CHARGE_ALREADY_REFUNDED: The transaction was already refunded. +// 400 CHARGE_ID_EMPTY: The specified charge_id is empty. // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/payments.refundStarsCharge for reference. -// Can be used by bots. func (c *Client) PaymentsRefundStarsCharge(ctx context.Context, request *PaymentsRefundStarsChargeRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_payments_reorder_star_gift_collections_gen.go b/tg/tl_payments_reorder_star_gift_collections_gen.go index 0873a2ce15..d258eb2f1d 100644 --- a/tg/tl_payments_reorder_star_gift_collections_gen.go +++ b/tg/tl_payments_reorder_star_gift_collections_gen.go @@ -32,12 +32,16 @@ var ( ) // PaymentsReorderStarGiftCollectionsRequest represents TL type `payments.reorderStarGiftCollections#c32af4cc`. +// Reorder the star gift collections »¹ on an owned peer's profile. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections // // See https://core.telegram.org/method/payments.reorderStarGiftCollections for reference. type PaymentsReorderStarGiftCollectionsRequest struct { - // Peer field of PaymentsReorderStarGiftCollectionsRequest. + // The owned peer. Peer InputPeerClass - // Order field of PaymentsReorderStarGiftCollectionsRequest. + // New collection order. Order []int } @@ -206,6 +210,14 @@ func (r *PaymentsReorderStarGiftCollectionsRequest) GetOrder() (value []int) { } // PaymentsReorderStarGiftCollections invokes method payments.reorderStarGiftCollections#c32af4cc returning error if any. +// Reorder the star gift collections »¹ on an owned peer's profile. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.reorderStarGiftCollections for reference. func (c *Client) PaymentsReorderStarGiftCollections(ctx context.Context, request *PaymentsReorderStarGiftCollectionsRequest) (bool, error) { diff --git a/tg/tl_payments_resale_star_gifts_gen.go b/tg/tl_payments_resale_star_gifts_gen.go index b307ca2160..4f7286eb93 100644 --- a/tg/tl_payments_resale_star_gifts_gen.go +++ b/tg/tl_payments_resale_star_gifts_gen.go @@ -32,6 +32,10 @@ var ( ) // PaymentsResaleStarGifts represents TL type `payments.resaleStarGifts#947a12df`. +// List of gifts currently on resale »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#reselling-collectible-gifts // // See https://core.telegram.org/constructor/payments.resaleStarGifts for reference. type PaymentsResaleStarGifts struct { @@ -40,29 +44,48 @@ type PaymentsResaleStarGifts struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Count field of PaymentsResaleStarGifts. + // Total number of results. Count int - // Gifts field of PaymentsResaleStarGifts. + // Collectible gifts on resale (may be less than count, in which case next_offset will be + // set). Gifts []StarGiftClass - // NextOffset field of PaymentsResaleStarGifts. + // Offset for pagination, pass this to payments.getResaleStarGifts¹.offset to fetch the + // next results. + // + // Links: + // 1) https://core.telegram.org/method/payments.getResaleStarGifts // // Use SetNextOffset and GetNextOffset helpers. NextOffset string - // Attributes field of PaymentsResaleStarGifts. + // Possible gift attributes, only set if payments.getResaleStarGifts¹.attributes_hash is + // set (on the first call, it must be equal to 0). + // + // Links: + // 1) https://core.telegram.org/method/payments.getResaleStarGifts // // Use SetAttributes and GetAttributes helpers. Attributes []StarGiftAttributeClass - // AttributesHash field of PaymentsResaleStarGifts. + // Hash of the attributes field, pass this to payments.getResaleStarGifts¹ + // attributes_hash to avoid returning any attributes (flag not set) if they haven't + // changed. + // + // Links: + // 1) https://core.telegram.org/method/payments.getResaleStarGifts // // Use SetAttributesHash and GetAttributesHash helpers. AttributesHash int64 - // Chats field of PaymentsResaleStarGifts. + // Chats mentioned in the attributes. Chats []ChatClass - // Counters field of PaymentsResaleStarGifts. + // Indicates the total number of gifts that have a specific attribute, only set if + // payments.getResaleStarGifts¹.offset is empty (since this field is not related to the + // current result page but to all of them, it's only returned on the first page). + // + // Links: + // 1) https://core.telegram.org/method/payments.getResaleStarGifts // // Use SetCounters and GetCounters helpers. Counters []StarGiftAttributeCounter - // Users field of PaymentsResaleStarGifts. + // Users mentioned in the attributes. Users []UserClass } diff --git a/tg/tl_payments_save_star_gift_gen.go b/tg/tl_payments_save_star_gift_gen.go index 27fa34f458..5e855b39b7 100644 --- a/tg/tl_payments_save_star_gift_gen.go +++ b/tg/tl_payments_save_star_gift_gen.go @@ -46,7 +46,7 @@ type PaymentsSaveStarGiftRequest struct { Flags bin.Fields // If set, hides the gift from our profile. Unsave bool - // Stargift field of PaymentsSaveStarGiftRequest. + // The gift to display or remove. Stargift InputSavedStarGiftClass } @@ -234,6 +234,8 @@ func (s *PaymentsSaveStarGiftRequest) GetStargift() (value InputSavedStarGiftCla // Possible errors: // // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 SAVED_ID_EMPTY: The passed inputSavedStarGiftChat.saved_id is empty. +// 400 STARGIFT_OWNER_INVALID: You cannot transfer or sell a gift owned by another user. // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/payments.saveStarGift for reference. diff --git a/tg/tl_payments_saved_star_gifts_gen.go b/tg/tl_payments_saved_star_gifts_gen.go index a795713bf4..8f82051c29 100644 --- a/tg/tl_payments_saved_star_gifts_gen.go +++ b/tg/tl_payments_saved_star_gifts_gen.go @@ -32,6 +32,10 @@ var ( ) // PaymentsSavedStarGifts represents TL type `payments.savedStarGifts#95f389b1`. +// Represents a list of gifts¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/payments.savedStarGifts for reference. type PaymentsSavedStarGifts struct { @@ -40,21 +44,29 @@ type PaymentsSavedStarGifts struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Count field of PaymentsSavedStarGifts. + // Total number of results (can be less than the returned gifts, in which case + // next_offset will be set). Count int - // ChatNotificationsEnabled field of PaymentsSavedStarGifts. + // Ternary value: can be not set, set&true, set&false. Can only be set for channels we + // own: the value indicates whether we enabled gift notifications¹ for this channel. + // + // Links: + // 1) https://core.telegram.org/api/gifts#notifications-for-received-channel-gifts // // Use SetChatNotificationsEnabled and GetChatNotificationsEnabled helpers. ChatNotificationsEnabled bool - // Gifts field of PaymentsSavedStarGifts. + // Gifts Gifts []SavedStarGift - // NextOffset field of PaymentsSavedStarGifts. + // Offset to pass to payments.getSavedStarGifts¹ to fetch the next page of results. + // + // Links: + // 1) https://core.telegram.org/method/payments.getSavedStarGifts // // Use SetNextOffset and GetNextOffset helpers. NextOffset string - // Chats field of PaymentsSavedStarGifts. + // Channels mentioned in gifts Chats []ChatClass - // Users field of PaymentsSavedStarGifts. + // Users mentioned in gifts Users []UserClass } diff --git a/tg/tl_payments_send_payment_form_gen.go b/tg/tl_payments_send_payment_form_gen.go index b3a412f902..7aa4cd11a5 100644 --- a/tg/tl_payments_send_payment_form_gen.go +++ b/tg/tl_payments_send_payment_form_gen.go @@ -404,7 +404,10 @@ func (s *PaymentsSendPaymentFormRequest) GetTipAmount() (value int64, ok bool) { // // Possible errors: // +// 400 FORM_UNSUPPORTED: Please update your client. +// 400 INVOICE_INVALID: The specified invoice is invalid. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 PAYMENT_CREDENTIALS_INVALID: The specified payment credentials are invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 TMP_PASSWORD_INVALID: The passed tmp_password is invalid. // diff --git a/tg/tl_payments_send_stars_form_gen.go b/tg/tl_payments_send_stars_form_gen.go index 37f1dbce7a..269178e0ca 100644 --- a/tg/tl_payments_send_stars_form_gen.go +++ b/tg/tl_payments_send_stars_form_gen.go @@ -204,13 +204,30 @@ func (s *PaymentsSendStarsFormRequest) GetInvoice() (value InputInvoiceClass) { // // Possible errors: // +// 406 API_GIFT_RESTRICTED_UPDATE_APP: Please update the app to access the gift API. // 400 BALANCE_TOO_LOW: The transaction cannot be completed because the current Telegram Stars balance is too low. +// 403 BOT_ACCESS_FORBIDDEN: The specified method can be used over a business connection for some operations, but the specified query attempted an operation that is not allowed over a business connection. // 400 BOT_INVOICE_INVALID: The specified invoice is invalid. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 FORM_EXPIRED: The form was generated more than 10 minutes ago and has expired, please re-generate it using payments.getPaymentForm and pass the new form_id. // 400 FORM_ID_EMPTY: The specified form ID is empty. +// 400 FORM_SUBMIT_DUPLICATE: The same payment form was already submitted. . // 400 FORM_UNSUPPORTED: Please update your client. +// 400 GIFT_STARS_INVALID: The specified amount of stars is invalid. +// 400 MEDIA_ALREADY_PAID: You already paid for the specified media. +// 400 MONTH_INVALID: The number of months specified in inputInvoicePremiumGiftStars.months is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 406 PRECHECKOUT_FAILED: Precheckout failed, a detailed and localized description for the error will be emitted via an updateServiceNotification as specified here ». +// 400 PURPOSE_INVALID: The specified payment purpose is invalid. +// 400 STARGIFT_ALREADY_UPGRADED: The specified gift was already upgraded to a collectible gift. +// 400 STARGIFT_NOT_FOUND: The specified gift was not found. +// 400 STARGIFT_OWNER_INVALID: You cannot transfer or sell a gift owned by another user. +// 400 STARGIFT_SLUG_INVALID: The specified gift slug is invalid. // 400 STARGIFT_USAGE_LIMITED: The gift is sold out. +// 400 STARGIFT_USER_USAGE_LIMITED: You've reached the starGift.limited_per_user limit, you can't buy any more gifts of this type. +// 406 STARS_FORM_AMOUNT_MISMATCH: The form amount has changed, please fetch the new form using payments.getPaymentForm and restart the process. +// 400 TO_ID_INVALID: The specified to_id of the passed inputInvoiceStarGiftResale or inputInvoiceStarGiftTransfer is invalid. +// 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/payments.sendStarsForm for reference. func (c *Client) PaymentsSendStarsForm(ctx context.Context, request *PaymentsSendStarsFormRequest) (PaymentsPaymentResultClass, error) { diff --git a/tg/tl_payments_star_gift_collections_gen.go b/tg/tl_payments_star_gift_collections_gen.go index 6ee4c122ff..d65b6a6068 100644 --- a/tg/tl_payments_star_gift_collections_gen.go +++ b/tg/tl_payments_star_gift_collections_gen.go @@ -32,6 +32,10 @@ var ( ) // PaymentsStarGiftCollectionsNotModified represents TL type `payments.starGiftCollectionsNotModified#a0ba4f17`. +// The list of star gift collections »¹ hasn't changed. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections // // See https://core.telegram.org/constructor/payments.starGiftCollectionsNotModified for reference. type PaymentsStarGiftCollectionsNotModified struct { @@ -135,10 +139,14 @@ func (s *PaymentsStarGiftCollectionsNotModified) DecodeBare(b *bin.Buffer) error } // PaymentsStarGiftCollections represents TL type `payments.starGiftCollections#8a2932f3`. +// Represents a list of star gift collections »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections // // See https://core.telegram.org/constructor/payments.starGiftCollections for reference. type PaymentsStarGiftCollections struct { - // Collections field of PaymentsStarGiftCollections. + // Star gift collections. Collections []StarGiftCollection } diff --git a/tg/tl_payments_star_gift_upgrade_preview_gen.go b/tg/tl_payments_star_gift_upgrade_preview_gen.go index 083454adba..7b119cf8cb 100644 --- a/tg/tl_payments_star_gift_upgrade_preview_gen.go +++ b/tg/tl_payments_star_gift_upgrade_preview_gen.go @@ -32,10 +32,17 @@ var ( ) // PaymentsStarGiftUpgradePreview represents TL type `payments.starGiftUpgradePreview#3de1dfed`. +// A preview of the possible attributes (chosen randomly) a gift »¹ can receive after +// upgrading it to a collectible gift »², see here »³ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/api/gifts#collectible-gifts +// 3. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/payments.starGiftUpgradePreview for reference. type PaymentsStarGiftUpgradePreview struct { - // SampleAttributes field of PaymentsStarGiftUpgradePreview. + // Possible gift attributes SampleAttributes []StarGiftAttributeClass // Prices field of PaymentsStarGiftUpgradePreview. Prices []StarGiftUpgradePrice diff --git a/tg/tl_payments_star_gift_withdrawal_url_gen.go b/tg/tl_payments_star_gift_withdrawal_url_gen.go index f0013d924d..1c89f19206 100644 --- a/tg/tl_payments_star_gift_withdrawal_url_gen.go +++ b/tg/tl_payments_star_gift_withdrawal_url_gen.go @@ -32,10 +32,11 @@ var ( ) // PaymentsStarGiftWithdrawalURL represents TL type `payments.starGiftWithdrawalUrl#84aa3a9c`. +// A URL that can be used to import the exported NFT on Fragment. // // See https://core.telegram.org/constructor/payments.starGiftWithdrawalUrl for reference. type PaymentsStarGiftWithdrawalURL struct { - // URL field of PaymentsStarGiftWithdrawalURL. + // The URL to open. URL string } diff --git a/tg/tl_payments_star_gifts_gen.go b/tg/tl_payments_star_gifts_gen.go index 6b1b1773cc..2ef20ff01c 100644 --- a/tg/tl_payments_star_gifts_gen.go +++ b/tg/tl_payments_star_gifts_gen.go @@ -151,9 +151,9 @@ type PaymentsStarGifts struct { Hash int // List of available gifts. Gifts []StarGiftClass - // Chats field of PaymentsStarGifts. + // Chats mentioned in the gifts field. Chats []ChatClass - // Users field of PaymentsStarGifts. + // Users mentioned in the gifts field. Users []UserClass } diff --git a/tg/tl_payments_stars_revenue_stats_gen.go b/tg/tl_payments_stars_revenue_stats_gen.go index a41241f10e..9c3877f019 100644 --- a/tg/tl_payments_stars_revenue_stats_gen.go +++ b/tg/tl_payments_stars_revenue_stats_gen.go @@ -45,7 +45,7 @@ type PaymentsStarsRevenueStats struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // TopHoursGraph field of PaymentsStarsRevenueStats. + // For ad revenue statistics, ad impressions graph // // Use SetTopHoursGraph and GetTopHoursGraph helpers. TopHoursGraph StatsGraphClass diff --git a/tg/tl_payments_stars_revenue_withdrawal_url_gen.go b/tg/tl_payments_stars_revenue_withdrawal_url_gen.go index f3ff0bfbd7..8e3ec4577c 100644 --- a/tg/tl_payments_stars_revenue_withdrawal_url_gen.go +++ b/tg/tl_payments_stars_revenue_withdrawal_url_gen.go @@ -35,14 +35,14 @@ var ( // Contains the URL to use to withdraw Telegram Star revenue¹. // // Links: -// 1. https://core.telegram.org/api/stars#withdrawing-stars +// 1. https://core.telegram.org/api/stars#withdrawing-revenue // // See https://core.telegram.org/constructor/payments.starsRevenueWithdrawalUrl for reference. type PaymentsStarsRevenueWithdrawalURL struct { // Contains the URL to use to withdraw Telegram Star revenue¹. // // Links: - // 1) https://core.telegram.org/api/stars#withdrawing-stars + // 1) https://core.telegram.org/api/stars#withdrawing-revenue URL string } diff --git a/tg/tl_payments_toggle_chat_star_gift_notifications_gen.go b/tg/tl_payments_toggle_chat_star_gift_notifications_gen.go index ab0fc776f9..0770fb7da0 100644 --- a/tg/tl_payments_toggle_chat_star_gift_notifications_gen.go +++ b/tg/tl_payments_toggle_chat_star_gift_notifications_gen.go @@ -32,6 +32,13 @@ var ( ) // PaymentsToggleChatStarGiftNotificationsRequest represents TL type `payments.toggleChatStarGiftNotifications#60eaefa1`. +// Enables or disables the reception of notifications every time a gift »¹ is received +// by the specified channel, can only be invoked by admins with post_messages admin +// rights². +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/constructor/chatAdminRights // // See https://core.telegram.org/method/payments.toggleChatStarGiftNotifications for reference. type PaymentsToggleChatStarGiftNotificationsRequest struct { @@ -40,9 +47,15 @@ type PaymentsToggleChatStarGiftNotificationsRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Enabled field of PaymentsToggleChatStarGiftNotificationsRequest. + // Whether to enable or disable reception of notifications in the form of + // messageActionStarGiftUnique¹ and messageActionStarGift² service messages from the + // channel. + // + // Links: + // 1) https://core.telegram.org/constructor/messageActionStarGiftUnique + // 2) https://core.telegram.org/constructor/messageActionStarGift Enabled bool - // Peer field of PaymentsToggleChatStarGiftNotificationsRequest. + // The channel for which to receive or not receive notifications. Peer InputPeerClass } @@ -222,9 +235,19 @@ func (t *PaymentsToggleChatStarGiftNotificationsRequest) GetPeer() (value InputP } // PaymentsToggleChatStarGiftNotifications invokes method payments.toggleChatStarGiftNotifications#60eaefa1 returning error if any. +// Enables or disables the reception of notifications every time a gift »¹ is received +// by the specified channel, can only be invoked by admins with post_messages admin +// rights². +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/constructor/chatAdminRights +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.toggleChatStarGiftNotifications for reference. -// Can be used by bots. func (c *Client) PaymentsToggleChatStarGiftNotifications(ctx context.Context, request *PaymentsToggleChatStarGiftNotificationsRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_toggle_star_gifts_pinned_to_top_gen.go b/tg/tl_payments_toggle_star_gifts_pinned_to_top_gen.go index 9a568e2933..18bf7c9e5d 100644 --- a/tg/tl_payments_toggle_star_gifts_pinned_to_top_gen.go +++ b/tg/tl_payments_toggle_star_gifts_pinned_to_top_gen.go @@ -32,12 +32,17 @@ var ( ) // PaymentsToggleStarGiftsPinnedToTopRequest represents TL type `payments.toggleStarGiftsPinnedToTop#1513e7b0`. +// Pins a received gift on top of the profile of the user or owned channels by using +// payments.toggleStarGiftsPinnedToTop¹. +// +// Links: +// 1. https://core.telegram.org/method/payments.toggleStarGiftsPinnedToTop // // See https://core.telegram.org/method/payments.toggleStarGiftsPinnedToTop for reference. type PaymentsToggleStarGiftsPinnedToTopRequest struct { - // Peer field of PaymentsToggleStarGiftsPinnedToTopRequest. + // The peer where to pin the gift. Peer InputPeerClass - // Stargift field of PaymentsToggleStarGiftsPinnedToTopRequest. + // The gift to pin. Stargift []InputSavedStarGiftClass } @@ -216,9 +221,17 @@ func (t *PaymentsToggleStarGiftsPinnedToTopRequest) MapStargift() (value InputSa } // PaymentsToggleStarGiftsPinnedToTop invokes method payments.toggleStarGiftsPinnedToTop#1513e7b0 returning error if any. +// Pins a received gift on top of the profile of the user or owned channels by using +// payments.toggleStarGiftsPinnedToTop¹. +// +// Links: +// 1. https://core.telegram.org/method/payments.toggleStarGiftsPinnedToTop +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.toggleStarGiftsPinnedToTop for reference. -// Can be used by bots. func (c *Client) PaymentsToggleStarGiftsPinnedToTop(ctx context.Context, request *PaymentsToggleStarGiftsPinnedToTopRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_transfer_star_gift_gen.go b/tg/tl_payments_transfer_star_gift_gen.go index 20093934a9..d3b7258db7 100644 --- a/tg/tl_payments_transfer_star_gift_gen.go +++ b/tg/tl_payments_transfer_star_gift_gen.go @@ -32,12 +32,21 @@ var ( ) // PaymentsTransferStarGiftRequest represents TL type `payments.transferStarGift#7f18176a`. +// Transfer a collectible gift¹ to another user or channel: can only be used if transfer +// is free (i.e. messageActionStarGiftUnique².transfer_stars is not set); see here »³ +// for more info on the full flow (including the different flow to use in case the +// transfer isn't free). +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/constructor/messageActionStarGiftUnique +// 3. https://core.telegram.org/api/gifts#transferring-collectible-gifts // // See https://core.telegram.org/method/payments.transferStarGift for reference. type PaymentsTransferStarGiftRequest struct { - // Stargift field of PaymentsTransferStarGiftRequest. + // The gift to transfer. Stargift InputSavedStarGiftClass - // ToID field of PaymentsTransferStarGiftRequest. + // Destination peer. ToID InputPeerClass } @@ -198,10 +207,26 @@ func (t *PaymentsTransferStarGiftRequest) GetToID() (value InputPeerClass) { } // PaymentsTransferStarGift invokes method payments.transferStarGift#7f18176a returning error if any. +// Transfer a collectible gift¹ to another user or channel: can only be used if transfer +// is free (i.e. messageActionStarGiftUnique².transfer_stars is not set); see here »³ +// for more info on the full flow (including the different flow to use in case the +// transfer isn't free). +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/constructor/messageActionStarGiftUnique +// 3. https://core.telegram.org/api/gifts#transferring-collectible-gifts // // Possible errors: // +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 PAYMENT_REQUIRED: Payment is required for this action, see here » for more info. +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 SAVED_ID_EMPTY: The passed inputSavedStarGiftChat.saved_id is empty. +// 400 STARGIFT_NOT_FOUND: The specified gift was not found. +// 400 STARGIFT_OWNER_INVALID: You cannot transfer or sell a gift owned by another user. +// 400 STARGIFT_PEER_INVALID: The specified inputSavedStarGiftChat.peer is invalid. // // See https://core.telegram.org/method/payments.transferStarGift for reference. func (c *Client) PaymentsTransferStarGift(ctx context.Context, request *PaymentsTransferStarGiftRequest) (UpdatesClass, error) { diff --git a/tg/tl_payments_unique_star_gift_gen.go b/tg/tl_payments_unique_star_gift_gen.go index 335487fc1c..ebceefd7db 100644 --- a/tg/tl_payments_unique_star_gift_gen.go +++ b/tg/tl_payments_unique_star_gift_gen.go @@ -32,14 +32,21 @@ var ( ) // PaymentsUniqueStarGift represents TL type `payments.uniqueStarGift#416c56e8`. +// Represents a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/payments.uniqueStarGift for reference. type PaymentsUniqueStarGift struct { - // Gift field of PaymentsUniqueStarGift. + // The starGiftUnique¹ constructor. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftUnique Gift StarGiftClass - // Chats field of PaymentsUniqueStarGift. + // Chats mentioned in the gift field. Chats []ChatClass - // Users field of PaymentsUniqueStarGift. + // Users mentioned in the gift field. Users []UserClass } diff --git a/tg/tl_payments_unique_star_gift_value_info_gen.go b/tg/tl_payments_unique_star_gift_value_info_gen.go index 3cd9149153..47d8fb68aa 100644 --- a/tg/tl_payments_unique_star_gift_value_info_gen.go +++ b/tg/tl_payments_unique_star_gift_value_info_gen.go @@ -32,50 +32,67 @@ var ( ) // PaymentsUniqueStarGiftValueInfo represents TL type `payments.uniqueStarGiftValueInfo#512fe446`. +// Information about the value of a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/payments.uniqueStarGiftValueInfo for reference. type PaymentsUniqueStarGiftValueInfo struct { - // Flags field of PaymentsUniqueStarGiftValueInfo. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // LastSaleOnFragment field of PaymentsUniqueStarGiftValueInfo. + // If set, the last sale was completed on Fragment. LastSaleOnFragment bool - // ValueIsAverage field of PaymentsUniqueStarGiftValueInfo. + // If set, the value is calculated from the average value of sold gifts of the same type. + // Otherwise, it is based on the sale price of the gift. ValueIsAverage bool - // Currency field of PaymentsUniqueStarGiftValueInfo. + // Three-letter ISO 4217 currency¹ code (a localized fiat currency used to represent + // prices and price estimations in this constructor). + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Value field of PaymentsUniqueStarGiftValueInfo. + // Estimated value of the gift, in the smallest unit of the currency specified in + // currency. Value int64 - // InitialSaleDate field of PaymentsUniqueStarGiftValueInfo. + // Initial purchase date of the gift. InitialSaleDate int - // InitialSaleStars field of PaymentsUniqueStarGiftValueInfo. + // Initial purchase price in Stars. InitialSaleStars int64 - // InitialSalePrice field of PaymentsUniqueStarGiftValueInfo. + // Initial purchase price in the smallest unit of the currency specified in currency + // (automatically converted from initial_sale_stars). InitialSalePrice int64 - // LastSaleDate field of PaymentsUniqueStarGiftValueInfo. + // Last resale date of the gift. // // Use SetLastSaleDate and GetLastSaleDate helpers. LastSaleDate int - // LastSalePrice field of PaymentsUniqueStarGiftValueInfo. + // Last resale price, in the smallest unit of the currency specified in currency. // // Use SetLastSalePrice and GetLastSalePrice helpers. LastSalePrice int64 - // FloorPrice field of PaymentsUniqueStarGiftValueInfo. + // The current minimum price of collectible gifts of the same type, in the smallest unit + // of the currency specified in currency. // // Use SetFloorPrice and GetFloorPrice helpers. FloorPrice int64 - // AveragePrice field of PaymentsUniqueStarGiftValueInfo. + // The current average sale price of collectible gifts of the same type, in the smallest + // unit of the currency specified in currency. // // Use SetAveragePrice and GetAveragePrice helpers. AveragePrice int64 - // ListedCount field of PaymentsUniqueStarGiftValueInfo. + // Number of gifts of the same type currently being resold on Telegram. // // Use SetListedCount and GetListedCount helpers. ListedCount int - // FragmentListedCount field of PaymentsUniqueStarGiftValueInfo. + // Number of gifts of the same type currently being resold on fragment. // // Use SetFragmentListedCount and GetFragmentListedCount helpers. FragmentListedCount int - // FragmentListedURL field of PaymentsUniqueStarGiftValueInfo. + // Fragment link to the listing of gifts of the same type currently being resold on + // fragment. // // Use SetFragmentListedURL and GetFragmentListedURL helpers. FragmentListedURL string diff --git a/tg/tl_payments_update_star_gift_collection_gen.go b/tg/tl_payments_update_star_gift_collection_gen.go index 706e1e3e79..419b31c204 100644 --- a/tg/tl_payments_update_star_gift_collection_gen.go +++ b/tg/tl_payments_update_star_gift_collection_gen.go @@ -32,28 +32,35 @@ var ( ) // PaymentsUpdateStarGiftCollectionRequest represents TL type `payments.updateStarGiftCollection#4fddbee7`. +// Add or remove gifts from a star gift collection »¹, or rename the collection. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections // // See https://core.telegram.org/method/payments.updateStarGiftCollection for reference. type PaymentsUpdateStarGiftCollectionRequest struct { - // Flags field of PaymentsUpdateStarGiftCollectionRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of PaymentsUpdateStarGiftCollectionRequest. + // Peer that owns the collection. Peer InputPeerClass - // CollectionID field of PaymentsUpdateStarGiftCollectionRequest. + // Collection ID. CollectionID int - // Title field of PaymentsUpdateStarGiftCollectionRequest. + // Title of the collection, to rename the collection. // // Use SetTitle and GetTitle helpers. Title string - // DeleteStargift field of PaymentsUpdateStarGiftCollectionRequest. + // Can contain a list of gifts to remove from the collection. // // Use SetDeleteStargift and GetDeleteStargift helpers. DeleteStargift []InputSavedStarGiftClass - // AddStargift field of PaymentsUpdateStarGiftCollectionRequest. + // Can contain a list of gifts to add to the collection. // // Use SetAddStargift and GetAddStargift helpers. AddStargift []InputSavedStarGiftClass - // Order field of PaymentsUpdateStarGiftCollectionRequest. + // Can contain the new gift order. // // Use SetOrder and GetOrder helpers. Order []InputSavedStarGiftClass @@ -481,6 +488,14 @@ func (u *PaymentsUpdateStarGiftCollectionRequest) MapOrder() (value InputSavedSt } // PaymentsUpdateStarGiftCollection invokes method payments.updateStarGiftCollection#4fddbee7 returning error if any. +// Add or remove gifts from a star gift collection »¹, or rename the collection. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.updateStarGiftCollection for reference. func (c *Client) PaymentsUpdateStarGiftCollection(ctx context.Context, request *PaymentsUpdateStarGiftCollectionRequest) (*StarGiftCollection, error) { diff --git a/tg/tl_payments_update_star_gift_price_gen.go b/tg/tl_payments_update_star_gift_price_gen.go index a3e2ca1c7c..60b6890494 100644 --- a/tg/tl_payments_update_star_gift_price_gen.go +++ b/tg/tl_payments_update_star_gift_price_gen.go @@ -32,12 +32,19 @@ var ( ) // PaymentsUpdateStarGiftPriceRequest represents TL type `payments.updateStarGiftPrice#edbe6ccb`. +// A collectible gift we own »¹ can be put up for sale on the gift marketplace »² +// with this method, see here »³ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://telegram.org/blog/gift-marketplace-and-more +// 3. https://core.telegram.org/api/gifts#reselling-collectible-gifts // // See https://core.telegram.org/method/payments.updateStarGiftPrice for reference. type PaymentsUpdateStarGiftPriceRequest struct { - // Stargift field of PaymentsUpdateStarGiftPriceRequest. + // The gift to resell. Stargift InputSavedStarGiftClass - // ResellAmount field of PaymentsUpdateStarGiftPriceRequest. + // Resale price of the gift. ResellAmount StarsAmountClass } @@ -198,9 +205,20 @@ func (u *PaymentsUpdateStarGiftPriceRequest) GetResellAmount() (value StarsAmoun } // PaymentsUpdateStarGiftPrice invokes method payments.updateStarGiftPrice#edbe6ccb returning error if any. +// A collectible gift we own »¹ can be put up for sale on the gift marketplace »² +// with this method, see here »³ for more info. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://telegram.org/blog/gift-marketplace-and-more +// 3. https://core.telegram.org/api/gifts#reselling-collectible-gifts +// +// Possible errors: +// +// 400 SAVED_ID_EMPTY: The passed inputSavedStarGiftChat.saved_id is empty. +// 400 STARGIFT_NOT_FOUND: The specified gift was not found. // // See https://core.telegram.org/method/payments.updateStarGiftPrice for reference. -// Can be used by bots. func (c *Client) PaymentsUpdateStarGiftPrice(ctx context.Context, request *PaymentsUpdateStarGiftPriceRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_payments_upgrade_star_gift_gen.go b/tg/tl_payments_upgrade_star_gift_gen.go index ee1e4a2f9c..a69d2eee77 100644 --- a/tg/tl_payments_upgrade_star_gift_gen.go +++ b/tg/tl_payments_upgrade_star_gift_gen.go @@ -32,6 +32,14 @@ var ( ) // PaymentsUpgradeStarGiftRequest represents TL type `payments.upgradeStarGift#aed6e4f5`. +// Upgrade a gift¹ to a collectible gift²: can only be used if the upgrade was already +// paid by the gift sender; see here »³ for more info on the full flow (including the +// different flow to use in case the upgrade was not paid by the gift sender). +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/api/gifts#collectible-gifts +// 3. https://core.telegram.org/api/gifts#upgrade-a-gift-to-a-collectible-gift // // See https://core.telegram.org/method/payments.upgradeStarGift for reference. type PaymentsUpgradeStarGiftRequest struct { @@ -40,9 +48,13 @@ type PaymentsUpgradeStarGiftRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // KeepOriginalDetails field of PaymentsUpgradeStarGiftRequest. + // Set this flag to keep the original gift text, sender and receiver in the upgraded gift + // as a starGiftAttributeOriginalDetails¹ attribute. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftAttributeOriginalDetails KeepOriginalDetails bool - // Stargift field of PaymentsUpgradeStarGiftRequest. + // The gift to upgrade Stargift InputSavedStarGiftClass } @@ -222,10 +234,24 @@ func (u *PaymentsUpgradeStarGiftRequest) GetStargift() (value InputSavedStarGift } // PaymentsUpgradeStarGift invokes method payments.upgradeStarGift#aed6e4f5 returning error if any. +// Upgrade a gift¹ to a collectible gift²: can only be used if the upgrade was already +// paid by the gift sender; see here »³ for more info on the full flow (including the +// different flow to use in case the upgrade was not paid by the gift sender). +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/api/gifts#collectible-gifts +// 3. https://core.telegram.org/api/gifts#upgrade-a-gift-to-a-collectible-gift // // Possible errors: // +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 PAYMENT_REQUIRED: Payment is required for this action, see here » for more info. +// 400 SAVED_ID_EMPTY: The passed inputSavedStarGiftChat.saved_id is empty. +// 400 STARGIFT_ALREADY_CONVERTED: The specified star gift was already converted to Stars. +// 400 STARGIFT_ALREADY_UPGRADED: The specified gift was already upgraded to a collectible gift. +// 400 STARGIFT_UPGRADE_UNAVAILABLE: A received gift can only be upgraded to a collectible gift if the messageActionStarGift/savedStarGift.can_upgrade flag is set. // // See https://core.telegram.org/method/payments.upgradeStarGift for reference. func (c *Client) PaymentsUpgradeStarGift(ctx context.Context, request *PaymentsUpgradeStarGiftRequest) (UpdatesClass, error) { diff --git a/tg/tl_peer_settings_gen.go b/tg/tl_peer_settings_gen.go index 30a4c99935..a6d47bbb39 100644 --- a/tg/tl_peer_settings_gen.go +++ b/tg/tl_peer_settings_gen.go @@ -79,7 +79,7 @@ type PeerSettings struct { // toggleConnectedBotPaused »². // // Links: - // 1) https://core.telegram.org/api/business#connected-bots + // 1) https://core.telegram.org/api/bots/connected-business-bots // 2) https://core.telegram.org/method/account.toggleConnectedBotPaused BusinessBotPaused bool // This flag is set if both business_bot_id and business_bot_manage_url are set and @@ -87,8 +87,8 @@ type PeerSettings struct { // settings during initial configuration². // // Links: - // 1) https://core.telegram.org/api/business#connected-bots - // 2) https://core.telegram.org/api/business#connected-bots + // 1) https://core.telegram.org/api/bots/connected-business-bots + // 2) https://core.telegram.org/api/bots/connected-business-bots BusinessBotCanReply bool // Distance in meters between us and this peer // @@ -112,7 +112,7 @@ type PeerSettings struct { // about the bot in the action bar. // // Links: - // 1) https://core.telegram.org/api/business#connected-bots + // 1) https://core.telegram.org/api/bots/connected-business-bots // // Use SetBusinessBotID and GetBusinessBotID helpers. BusinessBotID int64 @@ -124,23 +124,30 @@ type PeerSettings struct { // // Use SetBusinessBotManageURL and GetBusinessBotManageURL helpers. BusinessBotManageURL string - // ChargePaidMessageStars field of PeerSettings. + // All users that must pay us »¹ to send us private messages will have this flag set + // only for us, containing the amount of required stars, see here »² for more info on + // paid messages. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages + // 2) https://core.telegram.org/api/paid-messages // // Use SetChargePaidMessageStars and GetChargePaidMessageStars helpers. ChargePaidMessageStars int64 - // RegistrationMonth field of PeerSettings. + // Used to display the user's registration year and month, the string is in MM.YYYY + // format, where MM is the registration month (1-12), and YYYY is the registration year. // // Use SetRegistrationMonth and GetRegistrationMonth helpers. RegistrationMonth string - // PhoneCountry field of PeerSettings. + // The country code of the user's phone number. // // Use SetPhoneCountry and GetPhoneCountry helpers. PhoneCountry string - // NameChangeDate field of PeerSettings. + // When was the user's name last changed. // // Use SetNameChangeDate and GetNameChangeDate helpers. NameChangeDate int - // PhotoChangeDate field of PeerSettings. + // When was the user's photo last changed. // // Use SetPhotoChangeDate and GetPhotoChangeDate helpers. PhotoChangeDate int diff --git a/tg/tl_pending_suggestion_gen.go b/tg/tl_pending_suggestion_gen.go index bf6d32ad7e..21867dbd5f 100644 --- a/tg/tl_pending_suggestion_gen.go +++ b/tg/tl_pending_suggestion_gen.go @@ -32,16 +32,23 @@ var ( ) // PendingSuggestion represents TL type `pendingSuggestion#e7e82e12`. +// Represents a custom pending suggestion »¹. +// +// Links: +// 1. https://core.telegram.org/api/config#custom-suggestions // // See https://core.telegram.org/constructor/pendingSuggestion for reference. type PendingSuggestion struct { - // Suggestion field of PendingSuggestion. + // The suggestion ID, can be passed to help.dismissSuggestion¹. + // + // Links: + // 1) https://core.telegram.org/method/help.dismissSuggestion Suggestion string - // Title field of PendingSuggestion. + // Title of the suggestion. Title TextWithEntities - // Description field of PendingSuggestion. + // Body of the suggestion. Description TextWithEntities - // URL field of PendingSuggestion. + // URL to open when the user clicks on the suggestion. URL string } diff --git a/tg/tl_phone_accept_call_gen.go b/tg/tl_phone_accept_call_gen.go index a42e6cbe85..b1a0f6de9d 100644 --- a/tg/tl_phone_accept_call_gen.go +++ b/tg/tl_phone_accept_call_gen.go @@ -229,6 +229,7 @@ func (a *PhoneAcceptCallRequest) GetProtocol() (value PhoneCallProtocol) { // 400 CALL_PEER_INVALID: The provided call peer object is invalid. // 406 CALL_PROTOCOL_COMPAT_LAYER_INVALID: The other side of the call does not support any of the VoIP protocols supported by the local client, as specified by the protocol.layer and protocol.library_versions fields. // 400 CALL_PROTOCOL_FLAGS_INVALID: Call protocol flags invalid. +// 400 CALL_PROTOCOL_LAYER_INVALID: The specified protocol layer version range is invalid. // // See https://core.telegram.org/method/phone.acceptCall for reference. func (c *Client) PhoneAcceptCall(ctx context.Context, request *PhoneAcceptCallRequest) (*PhonePhoneCall, error) { diff --git a/tg/tl_phone_call_discard_reason_gen.go b/tg/tl_phone_call_discard_reason_gen.go index 73ec6c2fdd..a630529f5f 100644 --- a/tg/tl_phone_call_discard_reason_gen.go +++ b/tg/tl_phone_call_discard_reason_gen.go @@ -440,10 +440,17 @@ func (p *PhoneCallDiscardReasonBusy) DecodeBare(b *bin.Buffer) error { } // PhoneCallDiscardReasonMigrateConferenceCall represents TL type `phoneCallDiscardReasonMigrateConferenceCall#9fbbf1f7`. +// This phone call was migrated to a conference call¹. +// +// Links: +// 1. https://core.telegram.org/api/end-to-end/group-calls // // See https://core.telegram.org/constructor/phoneCallDiscardReasonMigrateConferenceCall for reference. type PhoneCallDiscardReasonMigrateConferenceCall struct { - // Slug field of PhoneCallDiscardReasonMigrateConferenceCall. + // Conference link »¹ slug. + // + // Links: + // 1) https://core.telegram.org/api/links#conference-links Slug string } diff --git a/tg/tl_phone_call_gen.go b/tg/tl_phone_call_gen.go index a6e39acdd4..8ecfcf618f 100644 --- a/tg/tl_phone_call_gen.go +++ b/tg/tl_phone_call_gen.go @@ -1266,7 +1266,10 @@ type PhoneCall struct { P2PAllowed bool // Whether this is a video call Video bool - // ConferenceSupported field of PhoneCall. + // If set, the other party supports upgrading of the call to a conference call¹. + // + // Links: + // 1) https://core.telegram.org/api/end-to-end/group-calls ConferenceSupported bool // Call ID ID int64 diff --git a/tg/tl_phone_create_conference_call_gen.go b/tg/tl_phone_create_conference_call_gen.go index e118303b7c..260d444a25 100644 --- a/tg/tl_phone_create_conference_call_gen.go +++ b/tg/tl_phone_create_conference_call_gen.go @@ -32,6 +32,7 @@ var ( ) // PhoneCreateConferenceCallRequest represents TL type `phone.createConferenceCall#7d0444bb`. +// Create and optionally join a new conference call. // // See https://core.telegram.org/method/phone.createConferenceCall for reference. type PhoneCreateConferenceCallRequest struct { @@ -40,23 +41,23 @@ type PhoneCreateConferenceCallRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Muted field of PhoneCreateConferenceCallRequest. + // If set, mute our microphone when joining the call (can only be used if join is set). Muted bool - // VideoStopped field of PhoneCreateConferenceCallRequest. + // If set, our video stream is disabled (can only be used if join is set). VideoStopped bool - // Join field of PhoneCreateConferenceCallRequest. + // If set, also join the call, otherwise just create the call link. Join bool - // RandomID field of PhoneCreateConferenceCallRequest. + // Unique client message ID required to prevent creation of duplicate group calls. RandomID int - // PublicKey field of PhoneCreateConferenceCallRequest. + // Public key (can only be used if join is set). // // Use SetPublicKey and GetPublicKey helpers. PublicKey bin.Int256 - // Block field of PhoneCreateConferenceCallRequest. + // Initial blockchain block (can only be used if join is set). // // Use SetBlock and GetBlock helpers. Block []byte - // Params field of PhoneCreateConferenceCallRequest. + // Parameters from tgcalls (can only be used if join is set). // // Use SetParams and GetParams helpers. Params DataJSON @@ -431,9 +432,9 @@ func (c *PhoneCreateConferenceCallRequest) GetParams() (value DataJSON, ok bool) } // PhoneCreateConferenceCall invokes method phone.createConferenceCall#7d0444bb returning error if any. +// Create and optionally join a new conference call. // // See https://core.telegram.org/method/phone.createConferenceCall for reference. -// Can be used by bots. func (c *Client) PhoneCreateConferenceCall(ctx context.Context, request *PhoneCreateConferenceCallRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_phone_decline_conference_call_invite_gen.go b/tg/tl_phone_decline_conference_call_invite_gen.go index 7aeb4179e1..7ae32c586a 100644 --- a/tg/tl_phone_decline_conference_call_invite_gen.go +++ b/tg/tl_phone_decline_conference_call_invite_gen.go @@ -32,10 +32,14 @@ var ( ) // PhoneDeclineConferenceCallInviteRequest represents TL type `phone.declineConferenceCallInvite#3c479971`. +// Declines a conference call invite. // // See https://core.telegram.org/method/phone.declineConferenceCallInvite for reference. type PhoneDeclineConferenceCallInviteRequest struct { - // MsgID field of PhoneDeclineConferenceCallInviteRequest. + // The ID of the messageActionConferenceCall¹ to decline. + // + // Links: + // 1) https://core.telegram.org/constructor/messageActionConferenceCall MsgID int } @@ -161,9 +165,13 @@ func (d *PhoneDeclineConferenceCallInviteRequest) GetMsgID() (value int) { } // PhoneDeclineConferenceCallInvite invokes method phone.declineConferenceCallInvite#3c479971 returning error if any. +// Declines a conference call invite. +// +// Possible errors: +// +// 400 MESSAGE_ID_INVALID: The provided message id is invalid. // // See https://core.telegram.org/method/phone.declineConferenceCallInvite for reference. -// Can be used by bots. func (c *Client) PhoneDeclineConferenceCallInvite(ctx context.Context, msgid int) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_phone_delete_conference_call_participants_gen.go b/tg/tl_phone_delete_conference_call_participants_gen.go index 4c6b3cef06..a8f6b4e556 100644 --- a/tg/tl_phone_delete_conference_call_participants_gen.go +++ b/tg/tl_phone_delete_conference_call_participants_gen.go @@ -32,6 +32,8 @@ var ( ) // PhoneDeleteConferenceCallParticipantsRequest represents TL type `phone.deleteConferenceCallParticipants#8ca60525`. +// Remove participants from a conference call. +// Exactly one of the only_left and kick flags must be set. // // See https://core.telegram.org/method/phone.deleteConferenceCallParticipants for reference. type PhoneDeleteConferenceCallParticipantsRequest struct { @@ -40,15 +42,18 @@ type PhoneDeleteConferenceCallParticipantsRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // OnlyLeft field of PhoneDeleteConferenceCallParticipantsRequest. + // Whether this is a removal of members that already left the conference call. OnlyLeft bool - // Kick field of PhoneDeleteConferenceCallParticipantsRequest. + // Whether this is a forced removal of active members in a conference call. Kick bool - // Call field of PhoneDeleteConferenceCallParticipantsRequest. + // The conference call. Call InputGroupCallClass - // IDs field of PhoneDeleteConferenceCallParticipantsRequest. + // IDs of users to remove. IDs []int64 - // Block field of PhoneDeleteConferenceCallParticipantsRequest. + // The block containing an appropriate e2e.chain.changeSetGroupState event¹ + // + // Links: + // 1) https://core.telegram.org/api/end-to-end/group-calls Block []byte } @@ -324,9 +329,14 @@ func (d *PhoneDeleteConferenceCallParticipantsRequest) GetBlock() (value []byte) } // PhoneDeleteConferenceCallParticipants invokes method phone.deleteConferenceCallParticipants#8ca60525 returning error if any. +// Remove participants from a conference call. +// Exactly one of the only_left and kick flags must be set. +// +// Possible errors: +// +// 400 GROUPCALL_INVALID: The specified group call is invalid. // // See https://core.telegram.org/method/phone.deleteConferenceCallParticipants for reference. -// Can be used by bots. func (c *Client) PhoneDeleteConferenceCallParticipants(ctx context.Context, request *PhoneDeleteConferenceCallParticipantsRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_phone_get_group_call_chain_blocks_gen.go b/tg/tl_phone_get_group_call_chain_blocks_gen.go index b70c5acd2f..fb0da4113a 100644 --- a/tg/tl_phone_get_group_call_chain_blocks_gen.go +++ b/tg/tl_phone_get_group_call_chain_blocks_gen.go @@ -32,16 +32,20 @@ var ( ) // PhoneGetGroupCallChainBlocksRequest represents TL type `phone.getGroupCallChainBlocks#ee9f88a6`. +// Fetch the blocks of a conference blockchain »¹. +// +// Links: +// 1. https://core.telegram.org/api/end-to-end/group-calls // // See https://core.telegram.org/method/phone.getGroupCallChainBlocks for reference. type PhoneGetGroupCallChainBlocksRequest struct { - // Call field of PhoneGetGroupCallChainBlocksRequest. + // The conference. Call InputGroupCallClass - // SubChainID field of PhoneGetGroupCallChainBlocksRequest. + // Subchain ID. SubChainID int - // Offset field of PhoneGetGroupCallChainBlocksRequest. + // Offset for pagination. Offset int - // Maximum number of results to return, see pagination¹ + // Maximum number of blocks to return in this call, see pagination¹ // // Links: // 1) https://core.telegram.org/api/offsets @@ -250,9 +254,16 @@ func (g *PhoneGetGroupCallChainBlocksRequest) GetLimit() (value int) { } // PhoneGetGroupCallChainBlocks invokes method phone.getGroupCallChainBlocks#ee9f88a6 returning error if any. +// Fetch the blocks of a conference blockchain »¹. +// +// Links: +// 1. https://core.telegram.org/api/end-to-end/group-calls +// +// Possible errors: +// +// 400 GROUPCALL_INVALID: The specified group call is invalid. // // See https://core.telegram.org/method/phone.getGroupCallChainBlocks for reference. -// Can be used by bots. func (c *Client) PhoneGetGroupCallChainBlocks(ctx context.Context, request *PhoneGetGroupCallChainBlocksRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_phone_get_group_call_join_as_gen.go b/tg/tl_phone_get_group_call_join_as_gen.go index e878794f65..491d3afc02 100644 --- a/tg/tl_phone_get_group_call_join_as_gen.go +++ b/tg/tl_phone_get_group_call_join_as_gen.go @@ -173,6 +173,7 @@ func (g *PhoneGetGroupCallJoinAsRequest) GetPeer() (value InputPeerClass) { // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/phone.getGroupCallJoinAs for reference. diff --git a/tg/tl_phone_invite_conference_call_participant_gen.go b/tg/tl_phone_invite_conference_call_participant_gen.go index f8dc29b0e7..dd1aed561f 100644 --- a/tg/tl_phone_invite_conference_call_participant_gen.go +++ b/tg/tl_phone_invite_conference_call_participant_gen.go @@ -32,6 +32,7 @@ var ( ) // PhoneInviteConferenceCallParticipantRequest represents TL type `phone.inviteConferenceCallParticipant#bcf22685`. +// Invite a user to a conference call. // // See https://core.telegram.org/method/phone.inviteConferenceCallParticipant for reference. type PhoneInviteConferenceCallParticipantRequest struct { @@ -40,11 +41,11 @@ type PhoneInviteConferenceCallParticipantRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Video field of PhoneInviteConferenceCallParticipantRequest. + // Invite the user to also turn on their video feed. Video bool - // Call field of PhoneInviteConferenceCallParticipantRequest. + // The conference call. Call InputGroupCallClass - // UserID field of PhoneInviteConferenceCallParticipantRequest. + // The user to invite. UserID InputUserClass } @@ -254,9 +255,13 @@ func (i *PhoneInviteConferenceCallParticipantRequest) GetUserID() (value InputUs } // PhoneInviteConferenceCallParticipant invokes method phone.inviteConferenceCallParticipant#bcf22685 returning error if any. +// Invite a user to a conference call. +// +// Possible errors: +// +// 400 GROUPCALL_INVALID: The specified group call is invalid. // // See https://core.telegram.org/method/phone.inviteConferenceCallParticipant for reference. -// Can be used by bots. func (c *Client) PhoneInviteConferenceCallParticipant(ctx context.Context, request *PhoneInviteConferenceCallParticipantRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_phone_join_group_call_gen.go b/tg/tl_phone_join_group_call_gen.go index b94b35768d..2af1658283 100644 --- a/tg/tl_phone_join_group_call_gen.go +++ b/tg/tl_phone_join_group_call_gen.go @@ -57,11 +57,14 @@ type PhoneJoinGroupCallRequest struct { // // Use SetInviteHash and GetInviteHash helpers. InviteHash string - // PublicKey field of PhoneJoinGroupCallRequest. + // For conference calls, your public key. // // Use SetPublicKey and GetPublicKey helpers. PublicKey bin.Int256 - // Block field of PhoneJoinGroupCallRequest. + // The block containing an appropriate e2e.chain.changeSetGroupState event¹. + // + // Links: + // 1) https://core.telegram.org/api/end-to-end/group-calls // // Use SetBlock and GetBlock helpers. Block []byte diff --git a/tg/tl_phone_request_call_gen.go b/tg/tl_phone_request_call_gen.go index 5b53d5b1cd..4fac2a24f9 100644 --- a/tg/tl_phone_request_call_gen.go +++ b/tg/tl_phone_request_call_gen.go @@ -312,6 +312,7 @@ func (r *PhoneRequestCallRequest) GetProtocol() (value PhoneCallProtocol) { // Possible errors: // // 400 CALL_PROTOCOL_FLAGS_INVALID: Call protocol flags invalid. +// 400 CALL_PROTOCOL_LAYER_INVALID: The specified protocol layer version range is invalid. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 PARTICIPANT_VERSION_OUTDATED: The other participant does not use an up to date telegram client with support for calls. // 400 USER_ID_INVALID: The provided user ID is invalid. diff --git a/tg/tl_phone_send_conference_call_broadcast_gen.go b/tg/tl_phone_send_conference_call_broadcast_gen.go index 01ed188813..e5b69aebc5 100644 --- a/tg/tl_phone_send_conference_call_broadcast_gen.go +++ b/tg/tl_phone_send_conference_call_broadcast_gen.go @@ -32,12 +32,17 @@ var ( ) // PhoneSendConferenceCallBroadcastRequest represents TL type `phone.sendConferenceCallBroadcast#c6701900`. +// Broadcast a blockchain block to all members of a conference call, see here »¹ for +// more info. +// +// Links: +// 1. https://core.telegram.org/api/end-to-end/group-calls // // See https://core.telegram.org/method/phone.sendConferenceCallBroadcast for reference. type PhoneSendConferenceCallBroadcastRequest struct { - // Call field of PhoneSendConferenceCallBroadcastRequest. + // The conference where to broadcast the block. Call InputGroupCallClass - // Block field of PhoneSendConferenceCallBroadcastRequest. + // The block to broadcast. Block []byte } @@ -193,9 +198,17 @@ func (s *PhoneSendConferenceCallBroadcastRequest) GetBlock() (value []byte) { } // PhoneSendConferenceCallBroadcast invokes method phone.sendConferenceCallBroadcast#c6701900 returning error if any. +// Broadcast a blockchain block to all members of a conference call, see here »¹ for +// more info. +// +// Links: +// 1. https://core.telegram.org/api/end-to-end/group-calls +// +// Possible errors: +// +// 400 GROUPCALL_INVALID: The specified group call is invalid. // // See https://core.telegram.org/method/phone.sendConferenceCallBroadcast for reference. -// Can be used by bots. func (c *Client) PhoneSendConferenceCallBroadcast(ctx context.Context, request *PhoneSendConferenceCallBroadcastRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_photo_gen.go b/tg/tl_photo_gen.go index 2be924842e..a682e1a168 100644 --- a/tg/tl_photo_gen.go +++ b/tg/tl_photo_gen.go @@ -185,7 +185,7 @@ type Photo struct { // file reference¹ // // Links: - // 1) https://core.telegram.org/api/file_reference + // 1) https://core.telegram.org/api/file-references FileReference []byte // Date of upload Date int diff --git a/tg/tl_photos_get_user_photos_gen.go b/tg/tl_photos_get_user_photos_gen.go index 9634df012f..556b048395 100644 --- a/tg/tl_photos_get_user_photos_gen.go +++ b/tg/tl_photos_get_user_photos_gen.go @@ -46,7 +46,7 @@ type PhotosGetUserPhotosRequest struct { // in max_id can be fetched. // // Links: - // 1) https://core.telegram.org/api/file_reference + // 1) https://core.telegram.org/api/file-references // 2) https://core.telegram.org/constructor/photo MaxID int64 // Number of list elements to be returned @@ -264,7 +264,6 @@ func (g *PhotosGetUserPhotosRequest) GetLimit() (value int) { // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/photos.getUserPhotos for reference. -// Can be used by bots. func (c *Client) PhotosGetUserPhotos(ctx context.Context, request *PhotosGetUserPhotosRequest) (PhotosPhotosClass, error) { var result PhotosPhotosBox diff --git a/tg/tl_photos_update_profile_photo_gen.go b/tg/tl_photos_update_profile_photo_gen.go index 247e0c40f2..9f3d17c56f 100644 --- a/tg/tl_photos_update_profile_photo_gen.go +++ b/tg/tl_photos_update_profile_photo_gen.go @@ -288,6 +288,7 @@ func (u *PhotosUpdateProfilePhotoRequest) GetIDAsNotEmpty() (*InputPhoto, bool) // Possible errors: // // 400 ALBUM_PHOTOS_TOO_MANY: You have uploaded too many profile photos, delete some before retrying. +// 400 BOT_FALLBACK_UNSUPPORTED: The fallback flag can't be set for bots. // 400 FILE_PARTS_INVALID: The number of file parts is invalid. // 400 IMAGE_PROCESS_FAILED: Failure while processing image. // 400 LOCATION_INVALID: The provided location is invalid. @@ -296,7 +297,6 @@ func (u *PhotosUpdateProfilePhotoRequest) GetIDAsNotEmpty() (*InputPhoto, bool) // 400 PHOTO_ID_INVALID: Photo ID invalid. // // See https://core.telegram.org/method/photos.updateProfilePhoto for reference. -// Can be used by bots. func (c *Client) PhotosUpdateProfilePhoto(ctx context.Context, request *PhotosUpdateProfilePhotoRequest) (*PhotosPhoto, error) { var result PhotosPhoto diff --git a/tg/tl_photos_upload_profile_photo_gen.go b/tg/tl_photos_upload_profile_photo_gen.go index 4bcc23ce66..ef0079a7f6 100644 --- a/tg/tl_photos_upload_profile_photo_gen.go +++ b/tg/tl_photos_upload_profile_photo_gen.go @@ -483,7 +483,6 @@ func (u *PhotosUploadProfilePhotoRequest) GetVideoEmojiMarkup() (value VideoSize // 400 VIDEO_FILE_INVALID: The specified video file is invalid. // // See https://core.telegram.org/method/photos.uploadProfilePhoto for reference. -// Can be used by bots. func (c *Client) PhotosUploadProfilePhoto(ctx context.Context, request *PhotosUploadProfilePhotoRequest) (*PhotosPhoto, error) { var result PhotosPhoto diff --git a/tg/tl_poll_gen.go b/tg/tl_poll_gen.go index 6ccb47bf88..82818a6b72 100644 --- a/tg/tl_poll_gen.go +++ b/tg/tl_poll_gen.go @@ -58,10 +58,11 @@ type Poll struct { // 1) https://core.telegram.org/api/premium // 2) https://core.telegram.org/api/custom-emoji Question TextWithEntities - // The possible answers, vote using messages.sendVote¹. + // The possible answers (2-poll_answers_max¹), vote using messages.sendVote². // // Links: - // 1) https://core.telegram.org/method/messages.sendVote + // 1) https://core.telegram.org/api/config#poll-answers-max + // 2) https://core.telegram.org/method/messages.sendVote Answers []PollAnswer // Amount of time in seconds the poll will be active after creation, 5-600. Can't be used // together with close_date. diff --git a/tg/tl_premium_get_boosts_status_gen.go b/tg/tl_premium_get_boosts_status_gen.go index 6226dc8838..0b0ee59acc 100644 --- a/tg/tl_premium_get_boosts_status_gen.go +++ b/tg/tl_premium_get_boosts_status_gen.go @@ -178,6 +178,7 @@ func (g *PremiumGetBoostsStatusRequest) GetPeer() (value InputPeerClass) { // Possible errors: // // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/premium.getBoostsStatus for reference. diff --git a/tg/tl_premium_get_user_boosts_gen.go b/tg/tl_premium_get_user_boosts_gen.go index f4e28db288..397e5528fb 100644 --- a/tg/tl_premium_get_user_boosts_gen.go +++ b/tg/tl_premium_get_user_boosts_gen.go @@ -208,7 +208,6 @@ func (g *PremiumGetUserBoostsRequest) GetUserID() (value InputUserClass) { // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/premium.getUserBoosts for reference. -// Can be used by bots. func (c *Client) PremiumGetUserBoosts(ctx context.Context, request *PremiumGetUserBoostsRequest) (*PremiumBoostsList, error) { var result PremiumBoostsList diff --git a/tg/tl_privacy_key_gen.go b/tg/tl_privacy_key_gen.go index bbed1d63a6..b3a5035ec7 100644 --- a/tg/tl_privacy_key_gen.go +++ b/tg/tl_privacy_key_gen.go @@ -1275,6 +1275,10 @@ func (p *PrivacyKeyStarGiftsAutoSave) DecodeBare(b *bin.Buffer) error { } // PrivacyKeyNoPaidMessages represents TL type `privacyKeyNoPaidMessages#17d348d2`. +// Who can send you messages without paying, if paid messages »¹ are enabled. +// +// Links: +// 1. https://core.telegram.org/api/paid-messages // // See https://core.telegram.org/constructor/privacyKeyNoPaidMessages for reference. type PrivacyKeyNoPaidMessages struct { diff --git a/tg/tl_privacy_rule_gen.go b/tg/tl_privacy_rule_gen.go index 5aaa60b2ca..91a5f044e9 100644 --- a/tg/tl_privacy_rule_gen.go +++ b/tg/tl_privacy_rule_gen.go @@ -740,7 +740,13 @@ func (p *PrivacyValueDisallowUsers) GetUsers() (value []int64) { // // See https://core.telegram.org/constructor/privacyValueAllowChatParticipants for reference. type PrivacyValueAllowChatParticipants struct { - // Allowed chats + // Allowed chat IDs (either a chat¹ or a supergroup² ID, verbatim the way it is + // received in the constructor (i.e. unlike with bot API IDs, here group and supergroup + // IDs should be treated in the same way)). + // + // Links: + // 1) https://core.telegram.org/constructor/chat + // 2) https://core.telegram.org/constructor/channel Chats []int64 } @@ -888,7 +894,13 @@ func (p *PrivacyValueAllowChatParticipants) GetChats() (value []int64) { // // See https://core.telegram.org/constructor/privacyValueDisallowChatParticipants for reference. type PrivacyValueDisallowChatParticipants struct { - // Disallowed chats + // Disallowed chats IDs (either a chat¹ or a supergroup² ID, verbatim the way it is + // received in the constructor (i.e. unlike with bot API IDs, here group and supergroup + // IDs should be treated in the same way)). + // + // Links: + // 1) https://core.telegram.org/constructor/chat + // 2) https://core.telegram.org/constructor/channel Chats []int64 } diff --git a/tg/tl_profile_tab_gen.go b/tg/tl_profile_tab_gen.go index c4820fe5ac..18574c174d 100644 --- a/tg/tl_profile_tab_gen.go +++ b/tg/tl_profile_tab_gen.go @@ -32,6 +32,10 @@ var ( ) // ProfileTabPosts represents TL type `profileTabPosts#b98cd696`. +// Represents the stories¹ tab of a profile page. +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/profileTabPosts for reference. type ProfileTabPosts struct { @@ -133,6 +137,10 @@ func (p *ProfileTabPosts) DecodeBare(b *bin.Buffer) error { } // ProfileTabGifts represents TL type `profileTabGifts#4d4bd46a`. +// Represents the gifts¹ tab of a profile page. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/profileTabGifts for reference. type ProfileTabGifts struct { @@ -234,6 +242,7 @@ func (p *ProfileTabGifts) DecodeBare(b *bin.Buffer) error { } // ProfileTabMedia represents TL type `profileTabMedia#72c64955`. +// Represents the media tab of a profile page. // // See https://core.telegram.org/constructor/profileTabMedia for reference. type ProfileTabMedia struct { @@ -335,6 +344,7 @@ func (p *ProfileTabMedia) DecodeBare(b *bin.Buffer) error { } // ProfileTabFiles represents TL type `profileTabFiles#ab339c00`. +// Represents the shared files tab of a profile. // // See https://core.telegram.org/constructor/profileTabFiles for reference. type ProfileTabFiles struct { @@ -436,6 +446,10 @@ func (p *ProfileTabFiles) DecodeBare(b *bin.Buffer) error { } // ProfileTabMusic represents TL type `profileTabMusic#9f27d26e`. +// Represents the music¹ tab of a profile page. +// +// Links: +// 1. https://core.telegram.org/api/profile#music // // See https://core.telegram.org/constructor/profileTabMusic for reference. type ProfileTabMusic struct { @@ -537,6 +551,7 @@ func (p *ProfileTabMusic) DecodeBare(b *bin.Buffer) error { } // ProfileTabVoice represents TL type `profileTabVoice#e477092e`. +// Represents the voice messages tab of a profile page. // // See https://core.telegram.org/constructor/profileTabVoice for reference. type ProfileTabVoice struct { @@ -638,6 +653,7 @@ func (p *ProfileTabVoice) DecodeBare(b *bin.Buffer) error { } // ProfileTabLinks represents TL type `profileTabLinks#d3656499`. +// Represents the shared links tab of a profile page. // // See https://core.telegram.org/constructor/profileTabLinks for reference. type ProfileTabLinks struct { @@ -739,6 +755,7 @@ func (p *ProfileTabLinks) DecodeBare(b *bin.Buffer) error { } // ProfileTabGifs represents TL type `profileTabGifs#a2c0f695`. +// Represents the gifs tab of a profile page. // // See https://core.telegram.org/constructor/profileTabGifs for reference. type ProfileTabGifs struct { diff --git a/tg/tl_requirement_to_contact_gen.go b/tg/tl_requirement_to_contact_gen.go index 9edb9187a6..dc5eece077 100644 --- a/tg/tl_requirement_to_contact_gen.go +++ b/tg/tl_requirement_to_contact_gen.go @@ -32,6 +32,7 @@ var ( ) // RequirementToContactEmpty represents TL type `requirementToContactEmpty#50a9839`. +// This user can be freely contacted. // // See https://core.telegram.org/constructor/requirementToContactEmpty for reference. type RequirementToContactEmpty struct { @@ -133,6 +134,10 @@ func (r *RequirementToContactEmpty) DecodeBare(b *bin.Buffer) error { } // RequirementToContactPremium represents TL type `requirementToContactPremium#e581e4e9`. +// This user requires us to buy a Premium¹ subscription in order to contact them. +// +// Links: +// 1. https://core.telegram.org/api/premium // // See https://core.telegram.org/constructor/requirementToContactPremium for reference. type RequirementToContactPremium struct { @@ -234,10 +239,19 @@ func (r *RequirementToContactPremium) DecodeBare(b *bin.Buffer) error { } // RequirementToContactPaidMessages represents TL type `requirementToContactPaidMessages#b4f67e93`. +// This user requires us to pay the specified amount of Telegram Stars¹ to send them a +// message, see here »² for the full flow. +// +// Links: +// 1. https://core.telegram.org/api/stars +// 2. https://core.telegram.org/api/paid-messages // // See https://core.telegram.org/constructor/requirementToContactPaidMessages for reference. type RequirementToContactPaidMessages struct { - // StarsAmount field of RequirementToContactPaidMessages. + // The required amount of Telegram Stars¹. + // + // Links: + // 1) https://core.telegram.org/api/stars StarsAmount int64 } diff --git a/tg/tl_restriction_reason_gen.go b/tg/tl_restriction_reason_gen.go index 80c532019c..4c333296c8 100644 --- a/tg/tl_restriction_reason_gen.go +++ b/tg/tl_restriction_reason_gen.go @@ -33,17 +33,10 @@ var ( // RestrictionReason represents TL type `restrictionReason#d072acb4`. // Restriction reason. -// Contains the reason why access to a certain object must be restricted. Clients are -// supposed to deny access to the channel if the platform field is equal to all or to the -// current platform (ios, android, wp, etc.). Platforms can be concatenated (ios-android, -// ios-wp), unknown platforms are to be ignored. The text is the error message that -// should be shown to the user. -// The restriction_add_platforms »¹ client configuration parameter contains an array of -// platform identifiers that must also be treated as our own, in additional to the one -// hardcoded in the client. +// See here »¹ for the full flow to use for restricted or age-gated content. // // Links: -// 1. https://core.telegram.org/api/config#restriction-add-platforms +// 1. https://core.telegram.org/api/age-verification // // See https://core.telegram.org/constructor/restrictionReason for reference. type RestrictionReason struct { diff --git a/tg/tl_saved_dialog_gen.go b/tg/tl_saved_dialog_gen.go index 1d558f488e..13d8551488 100644 --- a/tg/tl_saved_dialog_gen.go +++ b/tg/tl_saved_dialog_gen.go @@ -258,6 +258,10 @@ func (s *SavedDialog) GetTopMessage() (value int) { } // MonoForumDialog represents TL type `monoForumDialog#64407ea7`. +// Represents a monoforum topic »¹. +// +// Links: +// 1. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/constructor/monoForumDialog for reference. type MonoForumDialog struct { @@ -266,23 +270,33 @@ type MonoForumDialog struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // UnreadMark field of MonoForumDialog. + // Whether this topic has a manually set (with messages.markDialogUnread¹) unread mark. + // + // Links: + // 1) https://core.telegram.org/method/messages.markDialogUnread UnreadMark bool - // NopaidMessagesException field of MonoForumDialog. + // If set, an admin has exempted this peer from payment to send messages using account + // toggleNoPaidMessagesException¹. + // + // Links: + // 1) https://core.telegram.org/method/account.toggleNoPaidMessagesException NopaidMessagesException bool - // Peer field of MonoForumDialog. + // The peer associated to the topic, AKA the topic ID. Peer PeerClass - // TopMessage field of MonoForumDialog. + // The latest message ID TopMessage int - // ReadInboxMaxID field of MonoForumDialog. + // Position up to which all incoming messages are read. ReadInboxMaxID int - // ReadOutboxMaxID field of MonoForumDialog. + // Position up to which all outgoing messages are read. ReadOutboxMaxID int - // UnreadCount field of MonoForumDialog. + // Number of unread messages. UnreadCount int - // UnreadReactionsCount field of MonoForumDialog. + // Number of unread reactions. UnreadReactionsCount int - // Draft field of MonoForumDialog. + // A pending message draft¹. + // + // Links: + // 1) https://core.telegram.org/api/drafts // // Use SetDraft and GetDraft helpers. Draft DraftMessageClass diff --git a/tg/tl_saved_star_gift_gen.go b/tg/tl_saved_star_gift_gen.go index 370d85b213..0064e99bb1 100644 --- a/tg/tl_saved_star_gift_gen.go +++ b/tg/tl_saved_star_gift_gen.go @@ -32,6 +32,10 @@ var ( ) // SavedStarGift represents TL type `savedStarGift#8983a452`. +// Represents a gift¹ owned by a peer. +// +// Links: +// 1. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/savedStarGift for reference. type SavedStarGift struct { @@ -40,67 +44,115 @@ type SavedStarGift struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // NameHidden field of SavedStarGift. + // If set, the gift sender in from_id and the message are set only for the receiver of + // the gift. NameHidden bool - // Unsaved field of SavedStarGift. + // If set, the gift is not pinned on the user's profile. Unsaved bool - // Refunded field of SavedStarGift. + // This gift was upgraded to a collectible gift »¹ and then re-downgraded to a regular + // gift because a request to refund the payment related to the upgrade was made, and the + // money was returned. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts Refunded bool - // CanUpgrade field of SavedStarGift. + // Only set for non-collectible gifts, if they can be upgraded to a collectible gift »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts CanUpgrade bool - // PinnedToTop field of SavedStarGift. + // Whether this gift is pinned on top of the user's profile page. PinnedToTop bool - // UpgradeSeparate field of SavedStarGift. + // If set, someone already separately pre-paid¹ for the upgrade of this gift. + // + // Links: + // 1) https://core.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade UpgradeSeparate bool - // FromID field of SavedStarGift. + // Sender of the gift (unset for anonymous gifts). // // Use SetFromID and GetFromID helpers. FromID PeerClass - // Date field of SavedStarGift. + // Reception date of the gift. Date int - // Gift field of SavedStarGift. + // The collectible gift. Gift StarGiftClass - // Message field of SavedStarGift. + // Message attached to the gift. // // Use SetMessage and GetMessage helpers. Message TextWithEntities - // MsgID field of SavedStarGift. + // For gifts received by users, ID to use in inputSavedStarGiftUser¹ constructors. + // + // Links: + // 1) https://core.telegram.org/constructor/inputSavedStarGiftUser // // Use SetMsgID and GetMsgID helpers. MsgID int - // SavedID field of SavedStarGift. + // For gifts received by channels, ID to use in inputSavedStarGiftChat¹ constructors. + // + // Links: + // 1) https://core.telegram.org/constructor/inputSavedStarGiftChat // // Use SetSavedID and GetSavedID helpers. SavedID int64 - // ConvertStars field of SavedStarGift. + // For non-collectible gifts, the receiver of this gift may convert it to this many + // Telegram Stars, instead of displaying it on their profile page. // // Use SetConvertStars and GetConvertStars helpers. ConvertStars int64 - // UpgradeStars field of SavedStarGift. + // Only for pre-paid non-collectible gifts, the number of Telegram Stars the sender has + // already paid to convert the gift into a collectible gift »¹ (this is different from + // the meaning of the flag in messageActionStarGift², where it signals the upgrade price + // for not yet upgraded gifts). + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts + // 2) https://core.telegram.org/constructor/messageActionStarGift // // Use SetUpgradeStars and GetUpgradeStars helpers. UpgradeStars int64 - // CanExportAt field of SavedStarGift. + // If set, indicates that the current gift can't be exported to the TON blockchain »¹ + // yet: the owner will be able to export it at the specified unixtime. + // + // Links: + // 1) https://core.telegram.org/api/gifts#withdraw-a-collectible-gift-to-the-ton-blockchain // // Use SetCanExportAt and GetCanExportAt helpers. CanExportAt int - // TransferStars field of SavedStarGift. + // If set, indicates that the gift can be transferred »¹ to another user by paying the + // specified amount of stars. + // + // Links: + // 1) https://core.telegram.org/api/gifts#transferring-collectible-gifts // // Use SetTransferStars and GetTransferStars helpers. TransferStars int64 - // CanTransferAt field of SavedStarGift. + // If set, indicates that the current gift can't be transferred »¹ yet: the owner will + // be able to transfer it at the specified unixtime. + // + // Links: + // 1) https://core.telegram.org/api/gifts#transferring-collectible-gifts // // Use SetCanTransferAt and GetCanTransferAt helpers. CanTransferAt int - // CanResellAt field of SavedStarGift. + // If set, indicates that the current gift can't be resold »¹ yet: the owner will be + // able to put it up for sale at the specified unixtime. + // + // Links: + // 1) https://core.telegram.org/api/gifts#reselling-collectible-gifts // // Use SetCanResellAt and GetCanResellAt helpers. CanResellAt int - // CollectionID field of SavedStarGift. + // IDs of the collections »¹ that this gift is a part of. + // + // Links: + // 1) https://core.telegram.org/api/gifts#gift-collections // // Use SetCollectionID and GetCollectionID helpers. CollectionID []int - // PrepaidUpgradeHash field of SavedStarGift. + // Hash to prepay for a gift upgrade separately »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade // // Use SetPrepaidUpgradeHash and GetPrepaidUpgradeHash helpers. PrepaidUpgradeHash string diff --git a/tg/tl_search_posts_flood_gen.go b/tg/tl_search_posts_flood_gen.go index 3ebf360dae..aabd5bb019 100644 --- a/tg/tl_search_posts_flood_gen.go +++ b/tg/tl_search_posts_flood_gen.go @@ -32,22 +32,33 @@ var ( ) // SearchPostsFlood represents TL type `searchPostsFlood#3e0b5b6a`. +// Indicates if the specified global post search »¹ requires payment. +// +// Links: +// 1. https://core.telegram.org/api/search#posts-tab // // See https://core.telegram.org/constructor/searchPostsFlood for reference. type SearchPostsFlood struct { - // Flags field of SearchPostsFlood. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // QueryIsFree field of SearchPostsFlood. + // The specified query is free (and it will not use up free search slots). QueryIsFree bool - // TotalDaily field of SearchPostsFlood. + // Total number of daily free search slots. TotalDaily int - // Remains field of SearchPostsFlood. + // Remaining number of free search slots. Remains int - // WaitTill field of SearchPostsFlood. + // If there are no more search slots, specifies the unixtime when more search slots will + // be available. // // Use SetWaitTill and GetWaitTill helpers. WaitTill int - // StarsAmount field of SearchPostsFlood. + // The number of Telegram Stars¹ to pay for each non-free search. + // + // Links: + // 1) https://core.telegram.org/api/stars StarsAmount int64 } diff --git a/tg/tl_sponsored_message_gen.go b/tg/tl_sponsored_message_gen.go index 6fea56bd39..b8b8b14f0a 100644 --- a/tg/tl_sponsored_message_gen.go +++ b/tg/tl_sponsored_message_gen.go @@ -95,11 +95,19 @@ type SponsoredMessage struct { // // Use SetAdditionalInfo and GetAdditionalInfo helpers. AdditionalInfo string - // MinDisplayDuration field of SponsoredMessage. + // For sponsored messages to show on channel videos »¹, allow the user to hide the ad + // only after the specified amount of seconds. + // + // Links: + // 1) https://core.telegram.org/api/sponsored-messages#getting-sponsored-video-advertisements // // Use SetMinDisplayDuration and GetMinDisplayDuration helpers. MinDisplayDuration int - // MaxDisplayDuration field of SponsoredMessage. + // For sponsored messages to show on channel videos »¹, autohide the ad after after the + // specified amount of seconds. + // + // Links: + // 1) https://core.telegram.org/api/sponsored-messages#getting-sponsored-video-advertisements // // Use SetMaxDisplayDuration and GetMaxDisplayDuration helpers. MaxDisplayDuration int diff --git a/tg/tl_sponsored_peer_gen.go b/tg/tl_sponsored_peer_gen.go index 3f897c7589..c676dd756c 100644 --- a/tg/tl_sponsored_peer_gen.go +++ b/tg/tl_sponsored_peer_gen.go @@ -32,6 +32,7 @@ var ( ) // SponsoredPeer represents TL type `sponsoredPeer#c69708d3`. +// A sponsored peer. // // See https://core.telegram.org/constructor/sponsoredPeer for reference. type SponsoredPeer struct { @@ -40,15 +41,25 @@ type SponsoredPeer struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // RandomID field of SponsoredPeer. + // ID of the sponsored peer, to be passed to messages.viewSponsoredMessage¹, messages + // clickSponsoredMessage² or messages.reportSponsoredMessage³ (the same methods used + // for sponsored messages »⁴). + // + // Links: + // 1) https://core.telegram.org/method/messages.viewSponsoredMessage + // 2) https://core.telegram.org/method/messages.clickSponsoredMessage + // 3) https://core.telegram.org/method/messages.reportSponsoredMessage + // 4) https://core.telegram.org/api/sponsored-messages RandomID []byte - // Peer field of SponsoredPeer. + // The sponsored peer. Peer PeerClass - // SponsorInfo field of SponsoredPeer. + // If set, contains additional information about the sponsor to be shown along with the + // peer. // // Use SetSponsorInfo and GetSponsorInfo helpers. SponsorInfo string - // AdditionalInfo field of SponsoredPeer. + // If set, contains additional information about the sponsored message to be shown along + // with the peer. // // Use SetAdditionalInfo and GetAdditionalInfo helpers. AdditionalInfo string diff --git a/tg/tl_star_gift_attribute_counter_gen.go b/tg/tl_star_gift_attribute_counter_gen.go index 3f060b02da..99cf2e2530 100644 --- a/tg/tl_star_gift_attribute_counter_gen.go +++ b/tg/tl_star_gift_attribute_counter_gen.go @@ -32,12 +32,13 @@ var ( ) // StarGiftAttributeCounter represents TL type `starGiftAttributeCounter#2eb1b658`. +// Indicates the total number of gifts that have the specified attribute. // // See https://core.telegram.org/constructor/starGiftAttributeCounter for reference. type StarGiftAttributeCounter struct { - // Attribute field of StarGiftAttributeCounter. + // The attribute (just the ID, without the attribute itself). Attribute StarGiftAttributeIDClass - // Count field of StarGiftAttributeCounter. + // Total number of gifts with this attribute. Count int } diff --git a/tg/tl_star_gift_attribute_gen.go b/tg/tl_star_gift_attribute_gen.go index d4061b6738..83c2c61173 100644 --- a/tg/tl_star_gift_attribute_gen.go +++ b/tg/tl_star_gift_attribute_gen.go @@ -32,14 +32,21 @@ var ( ) // StarGiftAttributeModel represents TL type `starGiftAttributeModel#39d99013`. +// The model of a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/starGiftAttributeModel for reference. type StarGiftAttributeModel struct { - // Name field of StarGiftAttributeModel. + // Name of the model Name string - // Document field of StarGiftAttributeModel. + // The sticker¹ representing the upgraded gift + // + // Links: + // 1) https://core.telegram.org/api/stickers Document DocumentClass - // RarityPermille field of StarGiftAttributeModel. + // The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded. RarityPermille int } @@ -225,14 +232,20 @@ func (s *StarGiftAttributeModel) GetRarityPermille() (value int) { } // StarGiftAttributePattern represents TL type `starGiftAttributePattern#13acff19`. +// A sticker¹ applied on the backdrop of a collectible gift »² using a repeating +// pattern. +// +// Links: +// 1. https://core.telegram.org/api/stickers +// 2. https://core.telegram.org/api/gifts // // See https://core.telegram.org/constructor/starGiftAttributePattern for reference. type StarGiftAttributePattern struct { - // Name field of StarGiftAttributePattern. + // Name of the symbol Name string - // Document field of StarGiftAttributePattern. + // The symbol Document DocumentClass - // RarityPermille field of StarGiftAttributePattern. + // The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded. RarityPermille int } @@ -418,22 +431,29 @@ func (s *StarGiftAttributePattern) GetRarityPermille() (value int) { } // StarGiftAttributeBackdrop represents TL type `starGiftAttributeBackdrop#d93d859c`. +// The backdrop of a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/starGiftAttributeBackdrop for reference. type StarGiftAttributeBackdrop struct { - // Name field of StarGiftAttributeBackdrop. + // Name of the backdrop Name string - // BackdropID field of StarGiftAttributeBackdrop. + // Unique ID of the backdrop BackdropID int - // CenterColor field of StarGiftAttributeBackdrop. + // Color of the center of the backdrop in RGB24 format. CenterColor int - // EdgeColor field of StarGiftAttributeBackdrop. + // Color of the edges of the backdrop in RGB24 format. EdgeColor int - // PatternColor field of StarGiftAttributeBackdrop. + // Color of the starGiftAttributePattern¹ applied on the backdrop in RGB24 format. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftAttributePattern PatternColor int - // TextColor field of StarGiftAttributeBackdrop. + // Color of the text on the backdrop in RGB24 format. TextColor int - // RarityPermille field of StarGiftAttributeBackdrop. + // The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded. RarityPermille int } @@ -714,6 +734,12 @@ func (s *StarGiftAttributeBackdrop) GetRarityPermille() (value int) { } // StarGiftAttributeOriginalDetails represents TL type `starGiftAttributeOriginalDetails#e0bff26c`. +// Info about the sender, receiver and message attached to the original gift »¹, before +// it was upgraded to a collectible gift »². +// +// Links: +// 1. https://core.telegram.org/api/gifts +// 2. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/starGiftAttributeOriginalDetails for reference. type StarGiftAttributeOriginalDetails struct { @@ -722,15 +748,15 @@ type StarGiftAttributeOriginalDetails struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // SenderID field of StarGiftAttributeOriginalDetails. + // Original sender of the gift, absent if the gift was private. // // Use SetSenderID and GetSenderID helpers. SenderID PeerClass - // RecipientID field of StarGiftAttributeOriginalDetails. + // Original receiver of the gift. RecipientID PeerClass - // Date field of StarGiftAttributeOriginalDetails. + // When was the gift sent. Date int - // Message field of StarGiftAttributeOriginalDetails. + // Original message attached to the gift, if present. // // Use SetMessage and GetMessage helpers. Message TextWithEntities diff --git a/tg/tl_star_gift_attribute_id_gen.go b/tg/tl_star_gift_attribute_id_gen.go index 6920583e04..f2f238e2e8 100644 --- a/tg/tl_star_gift_attribute_id_gen.go +++ b/tg/tl_star_gift_attribute_id_gen.go @@ -32,10 +32,17 @@ var ( ) // StarGiftAttributeIDModel represents TL type `starGiftAttributeIdModel#48aaae3c`. +// The ID of a model of a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/starGiftAttributeIdModel for reference. type StarGiftAttributeIDModel struct { - // DocumentID field of StarGiftAttributeIDModel. + // The sticker¹ representing the upgraded gift + // + // Links: + // 1) https://core.telegram.org/api/stickers DocumentID int64 } @@ -166,10 +173,17 @@ func (s *StarGiftAttributeIDModel) GetDocumentID() (value int64) { } // StarGiftAttributeIDPattern represents TL type `starGiftAttributeIdPattern#4a162433`. +// The ID of a pattern of a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/starGiftAttributeIdPattern for reference. type StarGiftAttributeIDPattern struct { - // DocumentID field of StarGiftAttributeIDPattern. + // The sticker¹ representing the symbol + // + // Links: + // 1) https://core.telegram.org/api/stickers DocumentID int64 } @@ -300,10 +314,14 @@ func (s *StarGiftAttributeIDPattern) GetDocumentID() (value int64) { } // StarGiftAttributeIDBackdrop represents TL type `starGiftAttributeIdBackdrop#1f01c757`. +// The ID of a backdrop of a collectible gift »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts // // See https://core.telegram.org/constructor/starGiftAttributeIdBackdrop for reference. type StarGiftAttributeIDBackdrop struct { - // BackdropID field of StarGiftAttributeIDBackdrop. + // Unique ID of the backdrop. BackdropID int } diff --git a/tg/tl_star_gift_collection_gen.go b/tg/tl_star_gift_collection_gen.go index aa686d9bf7..fd2f97b376 100644 --- a/tg/tl_star_gift_collection_gen.go +++ b/tg/tl_star_gift_collection_gen.go @@ -32,22 +32,33 @@ var ( ) // StarGiftCollection represents TL type `starGiftCollection#9d6b13b0`. +// Represents a star gift collection »¹. +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections // // See https://core.telegram.org/constructor/starGiftCollection for reference. type StarGiftCollection struct { - // Flags field of StarGiftCollection. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // CollectionID field of StarGiftCollection. + // The ID of the collection. CollectionID int - // Title field of StarGiftCollection. + // Title of the collection. Title string - // Icon field of StarGiftCollection. + // Optional icon for the collection, taken from the first gift in the collection. // // Use SetIcon and GetIcon helpers. Icon DocumentClass - // GiftsCount field of StarGiftCollection. + // Number of gifts in the collection. GiftsCount int - // Hash field of StarGiftCollection. + // Field to use instead of collection_id when generating the hash to pass to payments + // getStarGiftCollections¹. + // + // Links: + // 1) https://core.telegram.org/method/payments.getStarGiftCollections Hash int64 } diff --git a/tg/tl_star_gift_gen.go b/tg/tl_star_gift_gen.go index 20adcde85c..8acc2c99a7 100644 --- a/tg/tl_star_gift_gen.go +++ b/tg/tl_star_gift_gen.go @@ -50,9 +50,14 @@ type StarGift struct { SoldOut bool // Whether this is a birthday-themed gift Birthday bool - // RequirePremium field of StarGift. + // This gift can only be bought by users with a Premium¹ subscription. + // + // Links: + // 1) https://core.telegram.org/api/premium RequirePremium bool - // LimitedPerUser field of StarGift. + // If set, the maximum number of gifts of this type that can be owned by a single user is + // limited and specified in per_user_total, and the remaining slots for the current user + // in per_user_remains. LimitedPerUser bool // PeerColorAvailable field of StarGift. PeerColorAvailable bool @@ -77,7 +82,12 @@ type StarGift struct { // // Use SetAvailabilityTotal and GetAvailabilityTotal helpers. AvailabilityTotal int - // AvailabilityResale field of StarGift. + // The total number of (upgraded to collectibles¹) gifts of this type currently on + // resale² + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts + // 2) https://core.telegram.org/api/gifts#reselling-collectible-gifts // // Use SetAvailabilityResale and GetAvailabilityResale helpers. AvailabilityResale int64 @@ -94,31 +104,43 @@ type StarGift struct { // // Use SetLastSaleDate and GetLastSaleDate helpers. LastSaleDate int - // UpgradeStars field of StarGift. + // The number of Telegram Stars the user can pay to convert the gift into a collectible + // gift »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts // // Use SetUpgradeStars and GetUpgradeStars helpers. UpgradeStars int64 - // ResellMinStars field of StarGift. + // The minimum price in Stars¹ for gifts of this type currently on resale². + // + // Links: + // 1) https://core.telegram.org/api/stars + // 2) https://core.telegram.org/api/gifts#reselling-collectible-gifts // // Use SetResellMinStars and GetResellMinStars helpers. ResellMinStars int64 - // Title field of StarGift. + // Title of the gift // // Use SetTitle and GetTitle helpers. Title string - // ReleasedBy field of StarGift. + // This gift was released by the specified peer. // // Use SetReleasedBy and GetReleasedBy helpers. ReleasedBy PeerClass - // PerUserTotal field of StarGift. + // Maximum number of gifts of this type that can be owned by any user. // // Use SetPerUserTotal and GetPerUserTotal helpers. PerUserTotal int - // PerUserRemains field of StarGift. + // Remaining number of gifts of this type that can be owned by the current user. // // Use SetPerUserRemains and GetPerUserRemains helpers. PerUserRemains int - // LockedUntilDate field of StarGift. + // If set, the specified gift possibly cannot be sent until the specified date, see here + // »¹ for the full flow. + // + // Links: + // 1) https://core.telegram.org/api/gifts // // Use SetLockedUntilDate and GetLockedUntilDate helpers. LockedUntilDate int @@ -1078,6 +1100,13 @@ func (s *StarGift) GetLockedUntilDate() (value int, ok bool) { } // StarGiftUnique represents TL type `starGiftUnique#b0bf741b`. +// Represents a collectible star gift, see here »¹ for more info. +// The sticker that represents the gift is contained in a starGiftAttributeModel¹ object +// in attributes. +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/constructor/starGiftAttributeModel // // See https://core.telegram.org/constructor/starGiftUnique for reference. type StarGiftUnique struct { @@ -1086,61 +1115,91 @@ type StarGiftUnique struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // RequirePremium field of StarGiftUnique. + // This gift can only be bought by users with a Premium¹ subscription. + // + // Links: + // 1) https://core.telegram.org/api/premium RequirePremium bool - // ResaleTonOnly field of StarGiftUnique. + // Whether the gift can be bought only using Toncoins. ResaleTonOnly bool - // ThemeAvailable field of StarGiftUnique. + // A chat theme associated to this gift is available, see here »¹ for more info on how + // to use it. + // + // Links: + // 1) https://core.telegram.org/api/themes#chat-themes ThemeAvailable bool - // ID field of StarGiftUnique. + // Identifier of the collectible gift. ID int64 - // GiftID field of StarGiftUnique. + // Unique ID of the gift. GiftID int64 - // Title field of StarGiftUnique. + // Collectible title. Title string - // Slug field of StarGiftUnique. + // Slug that can be used to create a collectible gift deep link »¹, or elsewhere in the + // API where a collectible slug is accepted². + // + // Links: + // 1) https://core.telegram.org/api/links#collectible-gift-link + // 2) https://core.telegram.org/api/gifts Slug string - // Num field of StarGiftUnique. + // Unique identifier of this collectible gift among all (already upgraded) collectible + // gifts of the same type. Num int - // OwnerID field of StarGiftUnique. + // The owner of the gift. // // Use SetOwnerID and GetOwnerID helpers. OwnerID PeerClass - // OwnerName field of StarGiftUnique. + // The name of the owner if neither owner_id nor owner_address are set. // // Use SetOwnerName and GetOwnerName helpers. OwnerName string - // OwnerAddress field of StarGiftUnique. + // For NFTs on the TON blockchain¹, contains the address of the owner (append it to the + // ton_blockchain_explorer_url client configuration value »² to obtain a link with + // information about the address). + // + // Links: + // 1) https://core.telegram.org/api/gifts#withdraw-a-collectible-gift-to-the-ton-blockchain + // 2) https://core.telegram.org/api/config#ton-blockchain-explorer-url // // Use SetOwnerAddress and GetOwnerAddress helpers. OwnerAddress string - // Attributes field of StarGiftUnique. + // Collectible attributes Attributes []StarGiftAttributeClass - // AvailabilityIssued field of StarGiftUnique. + // Total number of gifts of the same type that were upgraded to a collectible gift. AvailabilityIssued int - // AvailabilityTotal field of StarGiftUnique. + // Total number of gifts of the same type that can be upgraded or were already upgraded + // to a collectible gift. AvailabilityTotal int - // GiftAddress field of StarGiftUnique. + // For NFTs on the TON blockchain¹, contains the address of the NFT (append it to the + // ton_blockchain_explorer_url client configuration value »² to obtain a link with + // information about the address). + // + // Links: + // 1) https://core.telegram.org/api/gifts#withdraw-a-collectible-gift-to-the-ton-blockchain + // 2) https://core.telegram.org/api/config#ton-blockchain-explorer-url // // Use SetGiftAddress and GetGiftAddress helpers. GiftAddress string - // ResellAmount field of StarGiftUnique. + // Resale price of the gift. // // Use SetResellAmount and GetResellAmount helpers. ResellAmount []StarsAmountClass - // ReleasedBy field of StarGiftUnique. + // This gift was released by the specified peer. // // Use SetReleasedBy and GetReleasedBy helpers. ReleasedBy PeerClass - // ValueAmount field of StarGiftUnique. + // Price of the gift. // // Use SetValueAmount and GetValueAmount helpers. ValueAmount int64 - // ValueCurrency field of StarGiftUnique. + // Currency for the gift's price. // // Use SetValueCurrency and GetValueCurrency helpers. ValueCurrency string - // ThemePeer field of StarGiftUnique. + // The current chat where the associated chat theme¹ is installed, if any (gift-based + // themes can only be installed in one chat at a time). + // + // Links: + // 1) https://core.telegram.org/api/themes#chat-themes // // Use SetThemePeer and GetThemePeer helpers. ThemePeer PeerClass @@ -2168,13 +2227,16 @@ type StarGiftClass interface { // Zero returns true if current object has a zero value. Zero() bool - // RequirePremium field of StarGift. + // This gift can only be bought by users with a Premium¹ subscription. + // + // Links: + // 1) https://core.telegram.org/api/premium GetRequirePremium() (value bool) // Identifier of the gift GetID() (value int64) - // ReleasedBy field of StarGift. + // This gift was released by the specified peer. GetReleasedBy() (value PeerClass, ok bool) } diff --git a/tg/tl_stars_amount_gen.go b/tg/tl_stars_amount_gen.go index c3f60e0a5c..471014f094 100644 --- a/tg/tl_stars_amount_gen.go +++ b/tg/tl_stars_amount_gen.go @@ -42,8 +42,8 @@ type StarsAmount struct { // The integer amount of Telegram Stars. Amount int64 // The decimal amount of Telegram Stars, expressed as nanostars (i.e. 1 nanostar is equal - // to 1/1'000'000'000th of a Telegram Star). This field may also be negative (the allowed - // range is -999999999 to 999999999). + // to 1/1'000'000'000th (one billionth) of a Telegram Star). This field may also be + // negative (the allowed range is -999999999 to 999999999). Nanos int } @@ -199,10 +199,11 @@ func (s *StarsAmount) GetNanos() (value int) { } // StarsTonAmount represents TL type `starsTonAmount#74aee3e0`. +// Describes an amount of toncoin in nanotons (i.e. 1/1_000_000_000 of a toncoin). // // See https://core.telegram.org/constructor/starsTonAmount for reference. type StarsTonAmount struct { - // Amount field of StarsTonAmount. + // The amount in nanotons. Amount int64 } diff --git a/tg/tl_stars_rating_gen.go b/tg/tl_stars_rating_gen.go index bf8e44b5f4..9b4ee1217c 100644 --- a/tg/tl_stars_rating_gen.go +++ b/tg/tl_stars_rating_gen.go @@ -32,18 +32,25 @@ var ( ) // StarsRating represents TL type `starsRating#1b0e4f07`. +// Represents the profile's star rating, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/stars#star-rating // // See https://core.telegram.org/constructor/starsRating for reference. type StarsRating struct { - // Flags field of StarsRating. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Level field of StarsRating. + // The current level, may be negative. Level int - // CurrentLevelStars field of StarsRating. + // The numerical value of the rating required for the current level. CurrentLevelStars int64 - // Stars field of StarsRating. + // Numerical value of the current rating. Stars int64 - // NextLevelStars field of StarsRating. + // The numerical value of the rating required for the next level. // // Use SetNextLevelStars and GetNextLevelStars helpers. NextLevelStars int64 diff --git a/tg/tl_stars_revenue_status_gen.go b/tg/tl_stars_revenue_status_gen.go index 8221899da7..7bef0958f4 100644 --- a/tg/tl_stars_revenue_status_gen.go +++ b/tg/tl_stars_revenue_status_gen.go @@ -47,7 +47,7 @@ type StarsRevenueStatus struct { // If set, the user may withdraw¹ up to available_balance stars. // // Links: - // 1) https://core.telegram.org/api/stars#withdrawing-stars + // 1) https://core.telegram.org/api/stars#withdrawing-revenue WithdrawalEnabled bool // Amount of not-yet-withdrawn Telegram Stars. CurrentBalance StarsAmountClass diff --git a/tg/tl_stars_transaction_gen.go b/tg/tl_stars_transaction_gen.go index b64220b844..0fe9e8f826 100644 --- a/tg/tl_stars_transaction_gen.go +++ b/tg/tl_stars_transaction_gen.go @@ -32,7 +32,7 @@ var ( ) // StarsTransaction represents TL type `starsTransaction#13659eb0`. -// Represents a Telegram Stars transaction »¹. +// Represents a Telegram Stars or TON transaction »¹. // // Links: // 1. https://core.telegram.org/api/stars @@ -57,21 +57,38 @@ type StarsTransaction struct { // Links: // 1) https://core.telegram.org/api/reactions#paid-reactions Reaction bool - // StargiftUpgrade field of StarsTransaction. + // This transaction pays for the upgrade of a gift to a collectible gift »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#collectible-gifts StargiftUpgrade bool - // BusinessTransfer field of StarsTransaction. + // This transaction transfers stars from the balance of a user account connected to a + // business bot¹, to the balance of the business bot, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/api/bots/connected-business-bots + // 2) https://core.telegram.org/api/stars#transferring-stars-from-a-business-account-to-the-business-bot BusinessTransfer bool - // StargiftResale field of StarsTransaction. + // This transaction is related to the resale of a collectible gift »¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#reselling-collectible-gifts StargiftResale bool - // PostsSearch field of StarsTransaction. + // Represents payment for a paid global post search »¹. + // + // Links: + // 1) https://core.telegram.org/api/search#posts-tab PostsSearch bool - // StargiftPrepaidUpgrade field of StarsTransaction. + // Represents payment for a separate prepaid upgrade of a gift¹. + // + // Links: + // 1) https://core.telegram.org/api/gifts#prepaying-for-someone-elses-upgrade StargiftPrepaidUpgrade bool // StargiftDropOriginalDetails field of StarsTransaction. StargiftDropOriginalDetails bool // Transaction ID. ID string - // Amount field of StarsTransaction. + // Amount of Telegram Stars or TON. Amount StarsAmountClass // Date of the transaction (unixtime). Date int @@ -188,19 +205,26 @@ type StarsTransaction struct { // // Use SetStarrefAmount and GetStarrefAmount helpers. StarrefAmount StarsAmountClass - // PaidMessages field of StarsTransaction. + // This transaction is related to the reception or transmission of a paid message »¹. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages // // Use SetPaidMessages and GetPaidMessages helpers. PaidMessages int - // PremiumGiftMonths field of StarsTransaction. + // This transaction indicates the payment for a gifted Telegram Premium subscription »¹. + // + // Links: + // 1) https://core.telegram.org/api/premium#gifting-telegram-premium // // Use SetPremiumGiftMonths and GetPremiumGiftMonths helpers. PremiumGiftMonths int - // AdsProceedsFromDate field of StarsTransaction. + // Indicates that this is payment for ad revenue from the specified unixtime (always set + // together with ads_proceeds_to_date). // // Use SetAdsProceedsFromDate and GetAdsProceedsFromDate helpers. AdsProceedsFromDate int - // AdsProceedsToDate field of StarsTransaction. + // Indicates that this is payment for ad revenue to the specified unixtime. // // Use SetAdsProceedsToDate and GetAdsProceedsToDate helpers. AdsProceedsToDate int diff --git a/tg/tl_stickers_add_sticker_to_set_gen.go b/tg/tl_stickers_add_sticker_to_set_gen.go index 7bc6744e24..ca79ae2ada 100644 --- a/tg/tl_stickers_add_sticker_to_set_gen.go +++ b/tg/tl_stickers_add_sticker_to_set_gen.go @@ -207,7 +207,6 @@ func (a *StickersAddStickerToSetRequest) GetSticker() (value InputStickerSetItem // 400 STICKER_TGS_NOTGS: Invalid TGS sticker provided. // // See https://core.telegram.org/method/stickers.addStickerToSet for reference. -// Can be used by bots. func (c *Client) StickersAddStickerToSet(ctx context.Context, request *StickersAddStickerToSetRequest) (MessagesStickerSetClass, error) { var result MessagesStickerSetBox diff --git a/tg/tl_stickers_change_sticker_gen.go b/tg/tl_stickers_change_sticker_gen.go index cf7e58988d..f34572b4bf 100644 --- a/tg/tl_stickers_change_sticker_gen.go +++ b/tg/tl_stickers_change_sticker_gen.go @@ -354,7 +354,6 @@ func (c *StickersChangeStickerRequest) GetStickerAsNotEmpty() (*InputDocument, b // 400 STICKER_INVALID: The provided sticker is invalid. // // See https://core.telegram.org/method/stickers.changeSticker for reference. -// Can be used by bots. func (c *Client) StickersChangeSticker(ctx context.Context, request *StickersChangeStickerRequest) (MessagesStickerSetClass, error) { var result MessagesStickerSetBox diff --git a/tg/tl_stickers_change_sticker_position_gen.go b/tg/tl_stickers_change_sticker_position_gen.go index 876f8f6610..8a7be32956 100644 --- a/tg/tl_stickers_change_sticker_position_gen.go +++ b/tg/tl_stickers_change_sticker_position_gen.go @@ -208,7 +208,6 @@ func (c *StickersChangeStickerPositionRequest) GetStickerAsNotEmpty() (*InputDoc // 400 STICKER_INVALID: The provided sticker is invalid. // // See https://core.telegram.org/method/stickers.changeStickerPosition for reference. -// Can be used by bots. func (c *Client) StickersChangeStickerPosition(ctx context.Context, request *StickersChangeStickerPositionRequest) (MessagesStickerSetClass, error) { var result MessagesStickerSetBox diff --git a/tg/tl_stickers_create_sticker_set_gen.go b/tg/tl_stickers_create_sticker_set_gen.go index 6d59409670..9bc1327be8 100644 --- a/tg/tl_stickers_create_sticker_set_gen.go +++ b/tg/tl_stickers_create_sticker_set_gen.go @@ -522,6 +522,7 @@ func (c *StickersCreateStickerSetRequest) GetThumbAsNotEmpty() (*InputDocument, // 400 PACK_SHORT_NAME_INVALID: Short pack name invalid. // 400 PACK_SHORT_NAME_OCCUPIED: A stickerpack with this name already exists. // 400 PACK_TITLE_INVALID: The stickerpack title is invalid. +// 400 PACK_TYPE_INVALID: The masks and emojis flags are mutually exclusive. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 STICKERS_EMPTY: No sticker provided. // 400 STICKER_EMOJI_INVALID: Sticker emoji invalid. @@ -539,7 +540,6 @@ func (c *StickersCreateStickerSetRequest) GetThumbAsNotEmpty() (*InputDocument, // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/stickers.createStickerSet for reference. -// Can be used by bots. func (c *Client) StickersCreateStickerSet(ctx context.Context, request *StickersCreateStickerSetRequest) (MessagesStickerSetClass, error) { var result MessagesStickerSetBox diff --git a/tg/tl_stickers_delete_sticker_set_gen.go b/tg/tl_stickers_delete_sticker_set_gen.go index aacf3d015b..4e9e4903f1 100644 --- a/tg/tl_stickers_delete_sticker_set_gen.go +++ b/tg/tl_stickers_delete_sticker_set_gen.go @@ -174,7 +174,6 @@ func (d *StickersDeleteStickerSetRequest) GetStickerset() (value InputStickerSet // 400 STICKERSET_INVALID: The provided sticker set is invalid. // // See https://core.telegram.org/method/stickers.deleteStickerSet for reference. -// Can be used by bots. func (c *Client) StickersDeleteStickerSet(ctx context.Context, stickerset InputStickerSetClass) (bool, error) { var result BoolBox diff --git a/tg/tl_stickers_remove_sticker_from_set_gen.go b/tg/tl_stickers_remove_sticker_from_set_gen.go index 2ceb4d27ef..7632c60d69 100644 --- a/tg/tl_stickers_remove_sticker_from_set_gen.go +++ b/tg/tl_stickers_remove_sticker_from_set_gen.go @@ -181,7 +181,6 @@ func (r *StickersRemoveStickerFromSetRequest) GetStickerAsNotEmpty() (*InputDocu // 400 STICKER_INVALID: The provided sticker is invalid. // // See https://core.telegram.org/method/stickers.removeStickerFromSet for reference. -// Can be used by bots. func (c *Client) StickersRemoveStickerFromSet(ctx context.Context, sticker InputDocumentClass) (MessagesStickerSetClass, error) { var result MessagesStickerSetBox diff --git a/tg/tl_stickers_rename_sticker_set_gen.go b/tg/tl_stickers_rename_sticker_set_gen.go index c5c73e0203..6b53969140 100644 --- a/tg/tl_stickers_rename_sticker_set_gen.go +++ b/tg/tl_stickers_rename_sticker_set_gen.go @@ -201,7 +201,6 @@ func (r *StickersRenameStickerSetRequest) GetTitle() (value string) { // 400 STICKERSET_INVALID: The provided sticker set is invalid. // // See https://core.telegram.org/method/stickers.renameStickerSet for reference. -// Can be used by bots. func (c *Client) StickersRenameStickerSet(ctx context.Context, request *StickersRenameStickerSetRequest) (MessagesStickerSetClass, error) { var result MessagesStickerSetBox diff --git a/tg/tl_stickers_replace_sticker_gen.go b/tg/tl_stickers_replace_sticker_gen.go index d3c5c64712..4963915caa 100644 --- a/tg/tl_stickers_replace_sticker_gen.go +++ b/tg/tl_stickers_replace_sticker_gen.go @@ -212,7 +212,6 @@ func (r *StickersReplaceStickerRequest) GetStickerAsNotEmpty() (*InputDocument, // 400 STICKER_INVALID: The provided sticker is invalid. // // See https://core.telegram.org/method/stickers.replaceSticker for reference. -// Can be used by bots. func (c *Client) StickersReplaceSticker(ctx context.Context, request *StickersReplaceStickerRequest) (MessagesStickerSetClass, error) { var result MessagesStickerSetBox diff --git a/tg/tl_stickers_set_sticker_set_thumb_gen.go b/tg/tl_stickers_set_sticker_set_thumb_gen.go index 0aab9bf880..a19884712b 100644 --- a/tg/tl_stickers_set_sticker_set_thumb_gen.go +++ b/tg/tl_stickers_set_sticker_set_thumb_gen.go @@ -311,7 +311,6 @@ func (s *StickersSetStickerSetThumbRequest) GetThumbAsNotEmpty() (*InputDocument // 400 STICKER_THUMB_TGS_NOTGS: Incorrect stickerset TGS thumb file provided. // // See https://core.telegram.org/method/stickers.setStickerSetThumb for reference. -// Can be used by bots. func (c *Client) StickersSetStickerSetThumb(ctx context.Context, request *StickersSetStickerSetThumbRequest) (MessagesStickerSetClass, error) { var result MessagesStickerSetBox diff --git a/tg/tl_stories_albums_gen.go b/tg/tl_stories_albums_gen.go index d3c68ba2db..96af9590fb 100644 --- a/tg/tl_stories_albums_gen.go +++ b/tg/tl_stories_albums_gen.go @@ -32,6 +32,10 @@ var ( ) // StoriesAlbumsNotModified represents TL type `stories.albumsNotModified#564edaeb`. +// The story album list »¹ hasn't changed. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums // // See https://core.telegram.org/constructor/stories.albumsNotModified for reference. type StoriesAlbumsNotModified struct { @@ -133,12 +137,20 @@ func (a *StoriesAlbumsNotModified) DecodeBare(b *bin.Buffer) error { } // StoriesAlbums represents TL type `stories.albums#c3987a3a`. +// Story albums »¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums // // See https://core.telegram.org/constructor/stories.albums for reference. type StoriesAlbums struct { - // Hash field of StoriesAlbums. + // Hash to pass to stories.getAlbums¹ to avoid returning any results if they haven't + // changed. + // + // Links: + // 1) https://core.telegram.org/method/stories.getAlbums Hash int64 - // Albums field of StoriesAlbums. + // The albums. Albums []StoryAlbum } diff --git a/tg/tl_stories_can_send_story_count_gen.go b/tg/tl_stories_can_send_story_count_gen.go index d3a235cf7e..806b367869 100644 --- a/tg/tl_stories_can_send_story_count_gen.go +++ b/tg/tl_stories_can_send_story_count_gen.go @@ -32,10 +32,16 @@ var ( ) // StoriesCanSendStoryCount represents TL type `stories.canSendStoryCount#c387c04e`. +// Contains the number of available active story slots (equal to the value of the +// story_expiring_limit_* client configuration parameter¹ minus the number of currently +// active stories). +// +// Links: +// 1. https://core.telegram.org/api/config#story-expiring-limit-default // // See https://core.telegram.org/constructor/stories.canSendStoryCount for reference. type StoriesCanSendStoryCount struct { - // CountRemains field of StoriesCanSendStoryCount. + // Remaining active story slots. CountRemains int } diff --git a/tg/tl_stories_can_send_story_gen.go b/tg/tl_stories_can_send_story_gen.go index 2a3935ddbd..a7b8ffd375 100644 --- a/tg/tl_stories_can_send_story_gen.go +++ b/tg/tl_stories_can_send_story_gen.go @@ -172,12 +172,13 @@ func (c *StoriesCanSendStoryRequest) GetPeer() (value InputPeerClass) { // Possible errors: // // 400 BOOSTS_REQUIRED: The specified channel must first be boosted by its users in order to perform this action. +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // 400 STORIES_TOO_MUCH: You have hit the maximum active stories limit as specified by the story_expiring_limit_* client configuration parameters: you should buy a Premium subscription, delete an active story, or wait for the oldest story to expire. -// 400 STORY_SEND_FLOOD_MONTHLY_%d: You've hit the monthly story limit as specified by the stories_sent_monthly_limit_* client configuration parameters: wait for the specified number of seconds before posting a new story. -// 400 STORY_SEND_FLOOD_WEEKLY_%d: You've hit the weekly story limit as specified by the stories_sent_weekly_limit_* client configuration parameters: wait for the specified number of seconds before posting a new story. +// 400 STORY_SEND_FLOOD_MONTHLY_%d: You've hit the monthly story limit as specified by the stories_sent_monthly_limit_* client configuration parameters: wait %d seconds before posting a new story. +// 400 STORY_SEND_FLOOD_WEEKLY_%d: You've hit the weekly story limit as specified by the stories_sent_weekly_limit_* client configuration parameters: wait for %d seconds before posting a new story. // // See https://core.telegram.org/method/stories.canSendStory for reference. func (c *Client) StoriesCanSendStory(ctx context.Context, peer InputPeerClass) (*StoriesCanSendStoryCount, error) { diff --git a/tg/tl_stories_create_album_gen.go b/tg/tl_stories_create_album_gen.go index 84065b6536..4942bd8494 100644 --- a/tg/tl_stories_create_album_gen.go +++ b/tg/tl_stories_create_album_gen.go @@ -32,14 +32,18 @@ var ( ) // StoriesCreateAlbumRequest represents TL type `stories.createAlbum#a36396e5`. +// Creates a story album¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums // // See https://core.telegram.org/method/stories.createAlbum for reference. type StoriesCreateAlbumRequest struct { - // Peer field of StoriesCreateAlbumRequest. + // The owned peer where to create the album. Peer InputPeerClass - // Title field of StoriesCreateAlbumRequest. + // Album name. Title string - // Stories field of StoriesCreateAlbumRequest. + // Stories to add to the album. Stories []int } @@ -233,6 +237,14 @@ func (c *StoriesCreateAlbumRequest) GetStories() (value []int) { } // StoriesCreateAlbum invokes method stories.createAlbum#a36396e5 returning error if any. +// Creates a story album¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.createAlbum for reference. func (c *Client) StoriesCreateAlbum(ctx context.Context, request *StoriesCreateAlbumRequest) (*StoryAlbum, error) { diff --git a/tg/tl_stories_delete_album_gen.go b/tg/tl_stories_delete_album_gen.go index 74c23fa3f7..639b964086 100644 --- a/tg/tl_stories_delete_album_gen.go +++ b/tg/tl_stories_delete_album_gen.go @@ -32,12 +32,16 @@ var ( ) // StoriesDeleteAlbumRequest represents TL type `stories.deleteAlbum#8d3456d0`. +// Delete a story album¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums // // See https://core.telegram.org/method/stories.deleteAlbum for reference. type StoriesDeleteAlbumRequest struct { - // Peer field of StoriesDeleteAlbumRequest. + // Owned peer where the album is located. Peer InputPeerClass - // AlbumID field of StoriesDeleteAlbumRequest. + // ID of the album to delete. AlbumID int } @@ -193,6 +197,14 @@ func (d *StoriesDeleteAlbumRequest) GetAlbumID() (value int) { } // StoriesDeleteAlbum invokes method stories.deleteAlbum#8d3456d0 returning error if any. +// Delete a story album¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.deleteAlbum for reference. func (c *Client) StoriesDeleteAlbum(ctx context.Context, request *StoriesDeleteAlbumRequest) (bool, error) { diff --git a/tg/tl_stories_delete_stories_gen.go b/tg/tl_stories_delete_stories_gen.go index 051a74b897..1d8a6a4339 100644 --- a/tg/tl_stories_delete_stories_gen.go +++ b/tg/tl_stories_delete_stories_gen.go @@ -217,6 +217,9 @@ func (d *StoriesDeleteStoriesRequest) GetID() (value []int) { // // Possible errors: // +// 403 BOT_ACCESS_FORBIDDEN: The specified method can be used over a business connection for some operations, but the specified query attempted an operation that is not allowed over a business connection. +// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 STORY_ID_EMPTY: You specified no story IDs. // diff --git a/tg/tl_stories_edit_story_gen.go b/tg/tl_stories_edit_story_gen.go index 0a772884d0..a6e3058905 100644 --- a/tg/tl_stories_edit_story_gen.go +++ b/tg/tl_stories_edit_story_gen.go @@ -33,9 +33,16 @@ var ( // StoriesEditStoryRequest represents TL type `stories.editStory#b583ba46`. // Edit an uploaded story¹ +// May also be used in a business connection¹, not by wrapping the query in +// invokeWithBusinessConnection »², but rather by specifying the ID of a controlled +// business user in peer: in this context, the method can only be used to edit stories +// posted by the same business bot on behalf of the user with stories.sendStory³. // // Links: // 1. https://core.telegram.org/api/stories +// 2. https://core.telegram.org/api/bots/connected-business-bots +// 3. https://core.telegram.org/method/invokeWithBusinessConnection +// 4. https://core.telegram.org/method/stories.sendStory // // See https://core.telegram.org/method/stories.editStory for reference. type StoriesEditStoryRequest struct { @@ -555,9 +562,16 @@ func (e *StoriesEditStoryRequest) MapPrivacyRules() (value InputPrivacyRuleClass // StoriesEditStory invokes method stories.editStory#b583ba46 returning error if any. // Edit an uploaded story¹ +// May also be used in a business connection¹, not by wrapping the query in +// invokeWithBusinessConnection »², but rather by specifying the ID of a controlled +// business user in peer: in this context, the method can only be used to edit stories +// posted by the same business bot on behalf of the user with stories.sendStory³. // // Links: // 1. https://core.telegram.org/api/stories +// 2. https://core.telegram.org/api/bots/connected-business-bots +// 3. https://core.telegram.org/method/invokeWithBusinessConnection +// 4. https://core.telegram.org/method/stories.sendStory // // Possible errors: // diff --git a/tg/tl_stories_get_album_stories_gen.go b/tg/tl_stories_get_album_stories_gen.go index b4b2dea0ff..73dcea0cb1 100644 --- a/tg/tl_stories_get_album_stories_gen.go +++ b/tg/tl_stories_get_album_stories_gen.go @@ -32,16 +32,26 @@ var ( ) // StoriesGetAlbumStoriesRequest represents TL type `stories.getAlbumStories#ac806d61`. +// Get stories in a story album »¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums // // See https://core.telegram.org/method/stories.getAlbumStories for reference. type StoriesGetAlbumStoriesRequest struct { - // Peer field of StoriesGetAlbumStoriesRequest. + // Peer where the album is posted. Peer InputPeerClass - // AlbumID field of StoriesGetAlbumStoriesRequest. + // ID of the album. AlbumID int - // Offset field of StoriesGetAlbumStoriesRequest. + // Offset for pagination¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets Offset int - // Limit field of StoriesGetAlbumStoriesRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -247,6 +257,14 @@ func (g *StoriesGetAlbumStoriesRequest) GetLimit() (value int) { } // StoriesGetAlbumStories invokes method stories.getAlbumStories#ac806d61 returning error if any. +// Get stories in a story album »¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.getAlbumStories for reference. func (c *Client) StoriesGetAlbumStories(ctx context.Context, request *StoriesGetAlbumStoriesRequest) (*StoriesStories, error) { diff --git a/tg/tl_stories_get_albums_gen.go b/tg/tl_stories_get_albums_gen.go index fb3541b3a8..04ab5765d3 100644 --- a/tg/tl_stories_get_albums_gen.go +++ b/tg/tl_stories_get_albums_gen.go @@ -32,12 +32,20 @@ var ( ) // StoriesGetAlbumsRequest represents TL type `stories.getAlbums#25b3eac7`. +// Get story albums¹ created by a peer. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums // // See https://core.telegram.org/method/stories.getAlbums for reference. type StoriesGetAlbumsRequest struct { - // Peer field of StoriesGetAlbumsRequest. + // The peer. Peer InputPeerClass - // Hash field of StoriesGetAlbumsRequest. + // The hash from a previously returned stories.albums¹, to avoid returning any results + // if they haven't changed. + // + // Links: + // 1) https://core.telegram.org/constructor/stories.albums Hash int64 } @@ -193,6 +201,14 @@ func (g *StoriesGetAlbumsRequest) GetHash() (value int64) { } // StoriesGetAlbums invokes method stories.getAlbums#25b3eac7 returning error if any. +// Get story albums¹ created by a peer. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.getAlbums for reference. func (c *Client) StoriesGetAlbums(ctx context.Context, request *StoriesGetAlbumsRequest) (StoriesAlbumsClass, error) { diff --git a/tg/tl_stories_get_pinned_stories_gen.go b/tg/tl_stories_get_pinned_stories_gen.go index 3e7240ffbc..d220c2cd09 100644 --- a/tg/tl_stories_get_pinned_stories_gen.go +++ b/tg/tl_stories_get_pinned_stories_gen.go @@ -237,6 +237,7 @@ func (g *StoriesGetPinnedStoriesRequest) GetLimit() (value int) { // // Possible errors: // +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 USER_ID_INVALID: The provided user ID is invalid. // diff --git a/tg/tl_stories_reorder_albums_gen.go b/tg/tl_stories_reorder_albums_gen.go index da16d5f22d..5a62744b7d 100644 --- a/tg/tl_stories_reorder_albums_gen.go +++ b/tg/tl_stories_reorder_albums_gen.go @@ -32,12 +32,16 @@ var ( ) // StoriesReorderAlbumsRequest represents TL type `stories.reorderAlbums#8535fbd9`. +// Reorder story albums on a profile »¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums // // See https://core.telegram.org/method/stories.reorderAlbums for reference. type StoriesReorderAlbumsRequest struct { - // Peer field of StoriesReorderAlbumsRequest. + // Peer where the albums are located. Peer InputPeerClass - // Order field of StoriesReorderAlbumsRequest. + // New order of the albums. Order []int } @@ -206,6 +210,14 @@ func (r *StoriesReorderAlbumsRequest) GetOrder() (value []int) { } // StoriesReorderAlbums invokes method stories.reorderAlbums#8535fbd9 returning error if any. +// Reorder story albums on a profile »¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.reorderAlbums for reference. func (c *Client) StoriesReorderAlbums(ctx context.Context, request *StoriesReorderAlbumsRequest) (bool, error) { diff --git a/tg/tl_stories_send_story_gen.go b/tg/tl_stories_send_story_gen.go index 5a4dc32fd6..5fafecddb6 100644 --- a/tg/tl_stories_send_story_gen.go +++ b/tg/tl_stories_send_story_gen.go @@ -33,9 +33,14 @@ var ( // StoriesSendStoryRequest represents TL type `stories.sendStory#737fc2ec`. // Uploads a Telegram Story¹. +// May also be used in a business connection¹, not by wrapping the query in +// invokeWithBusinessConnection »², but rather by specifying the ID of a controlled +// business user in peer. // // Links: // 1. https://core.telegram.org/api/stories +// 2. https://core.telegram.org/api/bots/connected-business-bots +// 3. https://core.telegram.org/method/invokeWithBusinessConnection // // See https://core.telegram.org/method/stories.sendStory for reference. type StoriesSendStoryRequest struct { @@ -103,7 +108,7 @@ type StoriesSendStoryRequest struct { // // Use SetFwdFromStory and GetFwdFromStory helpers. FwdFromStory int - // Albums field of StoriesSendStoryRequest. + // If set, adds the story to the specified albums. // // Use SetAlbums and GetAlbums helpers. Albums []int @@ -833,13 +838,21 @@ func (s *StoriesSendStoryRequest) MapPrivacyRules() (value InputPrivacyRuleClass // StoriesSendStory invokes method stories.sendStory#737fc2ec returning error if any. // Uploads a Telegram Story¹. +// May also be used in a business connection¹, not by wrapping the query in +// invokeWithBusinessConnection »², but rather by specifying the ID of a controlled +// business user in peer. // // Links: // 1. https://core.telegram.org/api/stories +// 2. https://core.telegram.org/api/bots/connected-business-bots +// 3. https://core.telegram.org/method/invokeWithBusinessConnection // // Possible errors: // // 400 BOOSTS_REQUIRED: The specified channel must first be boosted by its users in order to perform this action. +// 403 BOT_ACCESS_FORBIDDEN: The specified method can be used over a business connection for some operations, but the specified query attempted an operation that is not allowed over a business connection. +// 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 IMAGE_PROCESS_FAILED: Failure while processing image. // 400 MEDIA_EMPTY: The provided media object is invalid. // 400 MEDIA_FILE_INVALID: The specified media file is invalid. diff --git a/tg/tl_stories_update_album_gen.go b/tg/tl_stories_update_album_gen.go index 9d4f55e4a0..f4b3c136b3 100644 --- a/tg/tl_stories_update_album_gen.go +++ b/tg/tl_stories_update_album_gen.go @@ -32,28 +32,35 @@ var ( ) // StoriesUpdateAlbumRequest represents TL type `stories.updateAlbum#5e5259b6`. +// Rename a story albums »¹, or add, delete or reorder stories in it. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums // // See https://core.telegram.org/method/stories.updateAlbum for reference. type StoriesUpdateAlbumRequest struct { - // Flags field of StoriesUpdateAlbumRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of StoriesUpdateAlbumRequest. + // Peer where the album is posted. Peer InputPeerClass - // AlbumID field of StoriesUpdateAlbumRequest. + // Album ID. AlbumID int - // Title field of StoriesUpdateAlbumRequest. + // New album title. // // Use SetTitle and GetTitle helpers. Title string - // DeleteStories field of StoriesUpdateAlbumRequest. + // If set, deletes the specified stories from the album. // // Use SetDeleteStories and GetDeleteStories helpers. DeleteStories []int - // AddStories field of StoriesUpdateAlbumRequest. + // If set, adds the specified stories to the album. // // Use SetAddStories and GetAddStories helpers. AddStories []int - // Order field of StoriesUpdateAlbumRequest. + // If set, reorders the stories in the album by their IDs. // // Use SetOrder and GetOrder helpers. Order []int @@ -442,6 +449,14 @@ func (u *StoriesUpdateAlbumRequest) GetOrder() (value []int, ok bool) { } // StoriesUpdateAlbum invokes method stories.updateAlbum#5e5259b6 returning error if any. +// Rename a story albums »¹, or add, delete or reorder stories in it. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.updateAlbum for reference. func (c *Client) StoriesUpdateAlbum(ctx context.Context, request *StoriesUpdateAlbumRequest) (*StoryAlbum, error) { diff --git a/tg/tl_story_album_gen.go b/tg/tl_story_album_gen.go index 94946b4a21..777165cc00 100644 --- a/tg/tl_story_album_gen.go +++ b/tg/tl_story_album_gen.go @@ -32,20 +32,27 @@ var ( ) // StoryAlbum represents TL type `storyAlbum#9325705a`. +// Represents a story album »¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-albums // // See https://core.telegram.org/constructor/storyAlbum for reference. type StoryAlbum struct { - // Flags field of StoryAlbum. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // AlbumID field of StoryAlbum. + // ID of the album. AlbumID int - // Title field of StoryAlbum. + // Name of the album. Title string - // IconPhoto field of StoryAlbum. + // Photo from the first story of the album, if it's a photo. // // Use SetIconPhoto and GetIconPhoto helpers. IconPhoto PhotoClass - // IconVideo field of StoryAlbum. + // Video from the first story of the album, if it's a video. // // Use SetIconVideo and GetIconVideo helpers. IconVideo DocumentClass diff --git a/tg/tl_story_item_gen.go b/tg/tl_story_item_gen.go index d9df1baf6b..18e6b3b02e 100644 --- a/tg/tl_story_item_gen.go +++ b/tg/tl_story_item_gen.go @@ -516,7 +516,10 @@ type StoryItem struct { // // Use SetSentReaction and GetSentReaction helpers. SentReaction ReactionClass - // Albums field of StoryItem. + // Albums¹ this story is part of. + // + // Links: + // 1) https://core.telegram.org/api/stories#story-albums // // Use SetAlbums and GetAlbums helpers. Albums []int diff --git a/tg/tl_suggested_post_gen.go b/tg/tl_suggested_post_gen.go index 3eaa6cf0a4..de441926ad 100644 --- a/tg/tl_suggested_post_gen.go +++ b/tg/tl_suggested_post_gen.go @@ -32,6 +32,10 @@ var ( ) // SuggestedPost represents TL type `suggestedPost#e8e37e5`. +// Contains info about a suggested post »¹. +// +// Links: +// 1. https://core.telegram.org/api/suggested-posts // // See https://core.telegram.org/constructor/suggestedPost for reference. type SuggestedPost struct { @@ -40,15 +44,15 @@ type SuggestedPost struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Accepted field of SuggestedPost. + // Whether the suggested post was accepted. Accepted bool - // Rejected field of SuggestedPost. + // Whether the suggested post was rejected. Rejected bool - // Price field of SuggestedPost. + // Price of the suggested post. // // Use SetPrice and GetPrice helpers. Price StarsAmountClass - // ScheduleDate field of SuggestedPost. + // Scheduling date. // // Use SetScheduleDate and GetScheduleDate helpers. ScheduleDate int diff --git a/tg/tl_todo_completion_gen.go b/tg/tl_todo_completion_gen.go index aadf4f12dc..93fad37d0f 100644 --- a/tg/tl_todo_completion_gen.go +++ b/tg/tl_todo_completion_gen.go @@ -32,14 +32,18 @@ var ( ) // TodoCompletion represents TL type `todoCompletion#4cc120b7`. +// A completed todo list »¹ item. +// +// Links: +// 1. https://core.telegram.org/api/todo // // See https://core.telegram.org/constructor/todoCompletion for reference. type TodoCompletion struct { - // ID field of TodoCompletion. + // The ID of the completed item. ID int - // CompletedBy field of TodoCompletion. + // ID of the user that completed the item. CompletedBy int64 - // Date field of TodoCompletion. + // When was the item completed. Date int } diff --git a/tg/tl_todo_item_gen.go b/tg/tl_todo_item_gen.go index a4819b88ec..68e9fbd08f 100644 --- a/tg/tl_todo_item_gen.go +++ b/tg/tl_todo_item_gen.go @@ -32,12 +32,19 @@ var ( ) // TodoItem represents TL type `todoItem#cba9a52f`. +// An item of a todo list »¹. +// +// Links: +// 1. https://core.telegram.org/api/todo // // See https://core.telegram.org/constructor/todoItem for reference. type TodoItem struct { - // ID field of TodoItem. + // ID of the item, a positive (non-zero) integer unique within the current list. ID int - // Title field of TodoItem. + // Text of the item, maximum length equal to todo_item_length_max »¹. + // + // Links: + // 1) https://core.telegram.org/api/config#todo-item-length-max Title TextWithEntities } diff --git a/tg/tl_todo_list_gen.go b/tg/tl_todo_list_gen.go index b11ef9cf66..d425aee98f 100644 --- a/tg/tl_todo_list_gen.go +++ b/tg/tl_todo_list_gen.go @@ -32,6 +32,10 @@ var ( ) // TodoList represents TL type `todoList#49b92a26`. +// Represents a todo list »¹. +// +// Links: +// 1. https://core.telegram.org/api/todo // // See https://core.telegram.org/constructor/todoList for reference. type TodoList struct { @@ -40,13 +44,16 @@ type TodoList struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // OthersCanAppend field of TodoList. + // If set, users different from the creator of the list can append items to the list. OthersCanAppend bool - // OthersCanComplete field of TodoList. + // If set, users different from the creator of the list can complete items in the list. OthersCanComplete bool - // Title field of TodoList. + // Title of the todo list, maximum length equal to todo_title_length_max »¹. + // + // Links: + // 1) https://core.telegram.org/api/config#todo-title-length-max Title TextWithEntities - // List field of TodoList. + // Items of the list. List []TodoItem } diff --git a/tg/tl_update_gen.go b/tg/tl_update_gen.go index e657ed52f7..51683eace1 100644 --- a/tg/tl_update_gen.go +++ b/tg/tl_update_gen.go @@ -4889,10 +4889,13 @@ func (u *UpdateWebPage) GetPtsCount() (value int) { } // UpdateReadMessagesContents represents TL type `updateReadMessagesContents#f8227181`. -// Contents of messages in the common message box¹ were read +// Contents of messages in the common message box¹ were read (emitted specifically for +// messages like voice messages or video, only once the media is watched and marked as +// read using messages.readMessageContents²). // // Links: // 1. https://core.telegram.org/api/updates +// 2. https://core.telegram.org/method/messages.readMessageContents // // See https://core.telegram.org/constructor/updateReadMessagesContents for reference. type UpdateReadMessagesContents struct { @@ -9324,7 +9327,10 @@ type UpdateDraftMessage struct { // // Use SetTopMsgID and GetTopMsgID helpers. TopMsgID int - // SavedPeerID field of UpdateDraftMessage. + // If set, the draft is related to the specified monoforum topic ID »¹. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID PeerClass @@ -12185,10 +12191,13 @@ func (u *UpdateFavedStickers) DecodeBare(b *bin.Buffer) error { } // UpdateChannelReadMessagesContents represents TL type `updateChannelReadMessagesContents#25f324f7`. -// The specified channel/supergroup¹ messages were read +// The specified channel/supergroup¹ messages were read (emitted specifically for +// messages like voice messages or video, only once the media is watched and marked as +// read using channels.readMessageContents²) // // Links: // 1. https://core.telegram.org/api/channel +// 2. https://core.telegram.org/method/channels.readMessageContents // // See https://core.telegram.org/constructor/updateChannelReadMessagesContents for reference. type UpdateChannelReadMessagesContents struct { @@ -12209,7 +12218,10 @@ type UpdateChannelReadMessagesContents struct { // // Use SetTopMsgID and GetTopMsgID helpers. TopMsgID int - // SavedPeerID field of UpdateChannelReadMessagesContents. + // If set, the messages were read within the specified monoforum topic »¹. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID PeerClass @@ -12771,7 +12783,10 @@ type UpdateDialogUnreadMark struct { Unread bool // The dialog Peer DialogPeerClass - // SavedPeerID field of UpdateDialogUnreadMark. + // If set, the mark is related to the specified monoforum topic ID »¹. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID PeerClass @@ -20316,7 +20331,10 @@ type UpdateMessageReactions struct { // // Use SetTopMsgID and GetTopMsgID helpers. TopMsgID int - // SavedPeerID field of UpdateMessageReactions. + // If set, the reactions are in the specified monoforum topic »¹. + // + // Links: + // 1) https://core.telegram.org/api/monoforum // // Use SetSavedPeerID and GetSavedPeerID helpers. SavedPeerID PeerClass @@ -26145,7 +26163,7 @@ func (u *UpdateDeleteQuickReplyMessages) GetMessages() (value []int) { // the user. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // 2. https://core.telegram.org/constructor/updateBotBusinessConnect // // See https://core.telegram.org/constructor/updateBotBusinessConnect for reference. @@ -26314,7 +26332,7 @@ func (u *UpdateBotBusinessConnect) GetQts() (value int) { // A message was received via a connected business chat »¹. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/constructor/updateBotNewBusinessMessage for reference. type UpdateBotNewBusinessMessage struct { @@ -26588,7 +26606,7 @@ func (u *UpdateBotNewBusinessMessage) GetQts() (value int) { // A message was edited in a connected business chat »¹. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/constructor/updateBotEditBusinessMessage for reference. type UpdateBotEditBusinessMessage struct { @@ -26862,7 +26880,7 @@ func (u *UpdateBotEditBusinessMessage) GetQts() (value int) { // A message was deleted in a connected business chat »¹. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/constructor/updateBotDeleteBusinessMessage for reference. type UpdateBotDeleteBusinessMessage struct { @@ -27457,7 +27475,7 @@ func (u *UpdateStarsBalance) GetBalance() (value StarsAmountClass) { // was sent to the bot that created the button. // // Links: -// 1. https://core.telegram.org/api/business#connected-bots +// 1. https://core.telegram.org/api/bots/connected-business-bots // // See https://core.telegram.org/constructor/updateBusinessBotCallbackQuery for reference. type UpdateBusinessBotCallbackQuery struct { @@ -27473,7 +27491,7 @@ type UpdateBusinessBotCallbackQuery struct { // Business connection ID¹ // // Links: - // 1) https://core.telegram.org/api/business#connected-bots + // 1) https://core.telegram.org/api/bots/connected-business-bots ConnectionID string // Message that contains the keyboard (also contains info about the chat where the // message was sent). @@ -28211,7 +28229,7 @@ func (u *UpdateBotPurchasedPaidMedia) GetQts() (value int) { // // See https://core.telegram.org/constructor/updatePaidReactionPrivacy for reference. type UpdatePaidReactionPrivacy struct { - // Whether paid reaction privacy is enabled or disabled. + // Paid reaction privacy settings. Private PaidReactionPrivacyClass } @@ -28347,10 +28365,11 @@ func (u *UpdatePaidReactionPrivacy) GetPrivate() (value PaidReactionPrivacyClass } // UpdateSentPhoneCode represents TL type `updateSentPhoneCode#504aa18f`. +// A paid login SMS code was successfully sent. // // See https://core.telegram.org/constructor/updateSentPhoneCode for reference. type UpdateSentPhoneCode struct { - // SentCode field of UpdateSentPhoneCode. + // Info about the sent code. SentCode AuthSentCodeClass } @@ -28486,16 +28505,20 @@ func (u *UpdateSentPhoneCode) GetSentCode() (value AuthSentCodeClass) { } // UpdateGroupCallChainBlocks represents TL type `updateGroupCallChainBlocks#a477288f`. +// Contains updates to the blockchain of a conference call, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/end-to-end/group-calls // // See https://core.telegram.org/constructor/updateGroupCallChainBlocks for reference. type UpdateGroupCallChainBlocks struct { - // Call field of UpdateGroupCallChainBlocks. + // The conference call. Call InputGroupCallClass - // SubChainID field of UpdateGroupCallChainBlocks. + // Subchain ID. SubChainID int - // Blocks field of UpdateGroupCallChainBlocks. + // Blocks. Blocks [][]byte - // NextOffset field of UpdateGroupCallChainBlocks. + // Offset of the next block. NextOffset int } @@ -28719,14 +28742,18 @@ func (u *UpdateGroupCallChainBlocks) GetNextOffset() (value int) { } // UpdateReadMonoForumInbox represents TL type `updateReadMonoForumInbox#77b0e372`. +// Incoming messages in a monoforum topic¹ were read +// +// Links: +// 1. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/constructor/updateReadMonoForumInbox for reference. type UpdateReadMonoForumInbox struct { - // ChannelID field of UpdateReadMonoForumInbox. + // ID of the monoforum. ChannelID int64 - // SavedPeerID field of UpdateReadMonoForumInbox. + // Topic ID. SavedPeerID PeerClass - // ReadMaxID field of UpdateReadMonoForumInbox. + // Position up to which all incoming messages are read. ReadMaxID int } @@ -28912,14 +28939,18 @@ func (u *UpdateReadMonoForumInbox) GetReadMaxID() (value int) { } // UpdateReadMonoForumOutbox represents TL type `updateReadMonoForumOutbox#a4a79376`. +// Outgoing messages in a monoforum¹ were read. +// +// Links: +// 1. https://core.telegram.org/api/monoforum // // See https://core.telegram.org/constructor/updateReadMonoForumOutbox for reference. type UpdateReadMonoForumOutbox struct { - // ChannelID field of UpdateReadMonoForumOutbox. + // ID of the monoforum. ChannelID int64 - // SavedPeerID field of UpdateReadMonoForumOutbox. + // Topic ID. SavedPeerID PeerClass - // ReadMaxID field of UpdateReadMonoForumOutbox. + // Position up to which all outgoing messages are read. ReadMaxID int } @@ -29105,6 +29136,12 @@ func (u *UpdateReadMonoForumOutbox) GetReadMaxID() (value int) { } // UpdateMonoForumNoPaidException represents TL type `updateMonoForumNoPaidException#9f812b08`. +// An admin has (un)exempted this monoforum topic »¹ from payment to send messages +// using account.toggleNoPaidMessagesException². +// +// Links: +// 1. https://core.telegram.org/api/monoforum +// 2. https://core.telegram.org/method/account.toggleNoPaidMessagesException // // See https://core.telegram.org/constructor/updateMonoForumNoPaidException for reference. type UpdateMonoForumNoPaidException struct { @@ -29113,11 +29150,11 @@ type UpdateMonoForumNoPaidException struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Exception field of UpdateMonoForumNoPaidException. + // If set, an admin has exempted this peer, otherwise the peer was unexempted. Exception bool - // ChannelID field of UpdateMonoForumNoPaidException. + // The monoforum ID. ChannelID int64 - // SavedPeerID field of UpdateMonoForumNoPaidException. + // The peer/topic ID. SavedPeerID PeerClass } diff --git a/tg/tl_updates_get_channel_difference_gen.go b/tg/tl_updates_get_channel_difference_gen.go index f62933a263..494b836edd 100644 --- a/tg/tl_updates_get_channel_difference_gen.go +++ b/tg/tl_updates_get_channel_difference_gen.go @@ -332,8 +332,10 @@ func (g *UpdatesGetChannelDifferenceRequest) GetFilterAsNotEmpty() (*ChannelMess // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHANNEL_PUBLIC_GROUP_NA: channel/supergroup not available. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 FROM_MESSAGE_BOT_DISABLED: Bots can't use fromMessage min constructors. +// 400 FROZEN_PARTICIPANT_MISSING: The current account is frozen, and cannot access the specified peer. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PERSISTENT_TIMESTAMP_EMPTY: Persistent timestamp empty. // 400 PERSISTENT_TIMESTAMP_INVALID: Persistent timestamp invalid. @@ -343,7 +345,6 @@ func (g *UpdatesGetChannelDifferenceRequest) GetFilterAsNotEmpty() (*ChannelMess // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // // See https://core.telegram.org/method/updates.getChannelDifference for reference. -// Can be used by bots. func (c *Client) UpdatesGetChannelDifference(ctx context.Context, request *UpdatesGetChannelDifferenceRequest) (UpdatesChannelDifferenceClass, error) { var result UpdatesChannelDifferenceBox diff --git a/tg/tl_updates_get_difference_gen.go b/tg/tl_updates_get_difference_gen.go index 82d9c1c6ed..3cbf7aacb6 100644 --- a/tg/tl_updates_get_difference_gen.go +++ b/tg/tl_updates_get_difference_gen.go @@ -409,6 +409,7 @@ func (g *UpdatesGetDifferenceRequest) GetQtsLimit() (value int, ok bool) { // 400 CDN_METHOD_INVALID: You can't call this method in a CDN DC. // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 DATE_EMPTY: Date empty. // 400 MSG_ID_INVALID: Invalid message ID provided. @@ -419,7 +420,6 @@ func (g *UpdatesGetDifferenceRequest) GetQtsLimit() (value int, ok bool) { // 400 USER_NOT_PARTICIPANT: You're not a member of this supergroup/channel. // // See https://core.telegram.org/method/updates.getDifference for reference. -// Can be used by bots. func (c *Client) UpdatesGetDifference(ctx context.Context, request *UpdatesGetDifferenceRequest) (UpdatesDifferenceClass, error) { var result UpdatesDifferenceBox diff --git a/tg/tl_updates_get_state_gen.go b/tg/tl_updates_get_state_gen.go index 489bbf7e67..39d8e2cc1f 100644 --- a/tg/tl_updates_get_state_gen.go +++ b/tg/tl_updates_get_state_gen.go @@ -132,7 +132,6 @@ func (g *UpdatesGetStateRequest) DecodeBare(b *bin.Buffer) error { // Returns a current state of updates. // // See https://core.telegram.org/method/updates.getState for reference. -// Can be used by bots. func (c *Client) UpdatesGetState(ctx context.Context) (*UpdatesState, error) { var result UpdatesState diff --git a/tg/tl_upload_get_cdn_file_gen.go b/tg/tl_upload_get_cdn_file_gen.go index e58c0408e9..072eac1a82 100644 --- a/tg/tl_upload_get_cdn_file_gen.go +++ b/tg/tl_upload_get_cdn_file_gen.go @@ -227,6 +227,7 @@ func (g *UploadGetCDNFileRequest) GetLimit() (value int) { // Possible errors: // // 400 FILE_TOKEN_INVALID: The master DC did not accept the file_token (e.g., the token has expired). Continue downloading the file from the master DC using upload.getFile. +// 404 METHOD_INVALID: The specified method is invalid. // // See https://core.telegram.org/method/upload.getCdnFile for reference. func (c *Client) UploadGetCDNFile(ctx context.Context, request *UploadGetCDNFileRequest) (UploadCDNFileClass, error) { diff --git a/tg/tl_upload_get_cdn_file_hashes_gen.go b/tg/tl_upload_get_cdn_file_hashes_gen.go index 066b05eb92..35e8c684bd 100644 --- a/tg/tl_upload_get_cdn_file_hashes_gen.go +++ b/tg/tl_upload_get_cdn_file_hashes_gen.go @@ -204,7 +204,6 @@ func (g *UploadGetCDNFileHashesRequest) GetOffset() (value int64) { // 400 RSA_DECRYPT_FAILED: Internal RSA decryption failed. // // See https://core.telegram.org/method/upload.getCdnFileHashes for reference. -// Can be used by bots. func (c *Client) UploadGetCDNFileHashes(ctx context.Context, request *UploadGetCDNFileHashesRequest) ([]FileHash, error) { var result FileHashVector diff --git a/tg/tl_upload_get_file_gen.go b/tg/tl_upload_get_file_gen.go index a0353a16d3..028d28103e 100644 --- a/tg/tl_upload_get_file_gen.go +++ b/tg/tl_upload_get_file_gen.go @@ -327,6 +327,7 @@ func (g *UploadGetFileRequest) GetLimit() (value int) { // 400 FILE_ID_INVALID: The provided file id is invalid. // 400 FILE_REFERENCE_EMPTY: An empty file reference was specified. // 400 FILE_REFERENCE_EXPIRED: File reference expired, it must be refetched as described in the documentation. +// 400 FILE_REFERENCE_INVALID: The specified file reference is invalid. // 420 FLOOD_PREMIUM_WAIT_%d: Please wait %d seconds before repeating the action, or purchase a Telegram Premium subscription to remove this rate limit. // 400 LIMIT_INVALID: The provided limit is invalid. // 400 LOCATION_INVALID: The provided location is invalid. @@ -335,7 +336,6 @@ func (g *UploadGetFileRequest) GetLimit() (value int) { // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/upload.getFile for reference. -// Can be used by bots. func (c *Client) UploadGetFile(ctx context.Context, request *UploadGetFileRequest) (UploadFileClass, error) { var result UploadFileBox diff --git a/tg/tl_upload_get_file_hashes_gen.go b/tg/tl_upload_get_file_hashes_gen.go index b5ced8bf18..af8960f8e6 100644 --- a/tg/tl_upload_get_file_hashes_gen.go +++ b/tg/tl_upload_get_file_hashes_gen.go @@ -201,7 +201,6 @@ func (g *UploadGetFileHashesRequest) GetOffset() (value int64) { // 400 LOCATION_INVALID: The provided location is invalid. // // See https://core.telegram.org/method/upload.getFileHashes for reference. -// Can be used by bots. func (c *Client) UploadGetFileHashes(ctx context.Context, request *UploadGetFileHashesRequest) ([]FileHash, error) { var result FileHashVector diff --git a/tg/tl_upload_reupload_cdn_file_gen.go b/tg/tl_upload_reupload_cdn_file_gen.go index 0c7528e8d5..35401f0232 100644 --- a/tg/tl_upload_reupload_cdn_file_gen.go +++ b/tg/tl_upload_reupload_cdn_file_gen.go @@ -207,7 +207,6 @@ func (r *UploadReuploadCDNFileRequest) GetRequestToken() (value []byte) { // 400 RSA_DECRYPT_FAILED: Internal RSA decryption failed. // // See https://core.telegram.org/method/upload.reuploadCdnFile for reference. -// Can be used by bots. func (c *Client) UploadReuploadCDNFile(ctx context.Context, request *UploadReuploadCDNFileRequest) ([]FileHash, error) { var result FileHashVector diff --git a/tg/tl_upload_save_big_file_part_gen.go b/tg/tl_upload_save_big_file_part_gen.go index 14e9bb5200..d77d370acb 100644 --- a/tg/tl_upload_save_big_file_part_gen.go +++ b/tg/tl_upload_save_big_file_part_gen.go @@ -258,7 +258,6 @@ func (s *UploadSaveBigFilePartRequest) GetBytes() (value []byte) { // 400 FILE_PART_TOO_SMALL: The size of the uploaded file part is too small, please see the documentation for the allowed sizes. // // See https://core.telegram.org/method/upload.saveBigFilePart for reference. -// Can be used by bots. func (c *Client) UploadSaveBigFilePart(ctx context.Context, request *UploadSaveBigFilePartRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_upload_save_file_part_gen.go b/tg/tl_upload_save_file_part_gen.go index 5ad5098b63..f36029e4bf 100644 --- a/tg/tl_upload_save_file_part_gen.go +++ b/tg/tl_upload_save_file_part_gen.go @@ -225,7 +225,6 @@ func (s *UploadSaveFilePartRequest) GetBytes() (value []byte) { // 400 MSG_ID_INVALID: Invalid message ID provided. // // See https://core.telegram.org/method/upload.saveFilePart for reference. -// Can be used by bots. func (c *Client) UploadSaveFilePart(ctx context.Context, request *UploadSaveFilePartRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_user_full_gen.go b/tg/tl_user_full_gen.go index 875296948f..9b1aad032a 100644 --- a/tg/tl_user_full_gen.go +++ b/tg/tl_user_full_gen.go @@ -129,7 +129,16 @@ type UserFull struct { // Links: // 1) https://core.telegram.org/api/emoji-status#setting-an-emoji-status-from-a-bot BotCanManageEmojiStatus bool - // DisplayGiftsButton field of UserFull. + // If this flag is set for both us and another user (changed through + // globalPrivacySettings¹), a gift button should always be displayed in the text field + // in private chats with the other user: once clicked, the gift UI should be displayed, + // offering the user options to gift Telegram Premium »² subscriptions or Telegram + // Gifts »³. + // + // Links: + // 1) https://core.telegram.org/constructor/globalPrivacySettings + // 2) https://core.telegram.org/api/premium + // 3) https://core.telegram.org/api/gifts DisplayGiftsButton bool // User ID ID int64 @@ -179,7 +188,10 @@ type UserFull struct { // // Use SetTTLPeriod and GetTTLPeriod helpers. TTLPeriod int - // Theme field of UserFull. + // The chat theme associated with this user »¹. + // + // Links: + // 1) https://core.telegram.org/api/themes#chat-themes // // Use SetTheme and GetTheme helpers. Theme ChatThemeClass @@ -292,35 +304,63 @@ type UserFull struct { // // Use SetStarrefProgram and GetStarrefProgram helpers. StarrefProgram StarRefProgram - // BotVerification field of UserFull. + // Describes a bot verification icon »¹. + // + // Links: + // 1) https://core.telegram.org/api/bots/verification // // Use SetBotVerification and GetBotVerification helpers. BotVerification BotVerification - // SendPaidMessagesStars field of UserFull. + // If set and bigger than 0, this user has enabled paid messages »¹ and we must pay the + // specified amount of Stars² to send messages to them, see here »³ for the full flow. + // If set and equal to 0, the user requires payment in general but we were exempted from + // paying for any of the reasons specified in the docs »⁴. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages + // 2) https://core.telegram.org/api/stars + // 3) https://core.telegram.org/api/paid-messages + // 4) https://core.telegram.org/api/paid-messages // // Use SetSendPaidMessagesStars and GetSendPaidMessagesStars helpers. SendPaidMessagesStars int64 - // DisallowedGifts field of UserFull. + // Disallows the reception of specific gift types. // // Use SetDisallowedGifts and GetDisallowedGifts helpers. DisallowedGifts DisallowedGiftsSettings - // StarsRating field of UserFull. + // The user's star rating¹. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-rating // // Use SetStarsRating and GetStarsRating helpers. StarsRating StarsRating - // StarsMyPendingRating field of UserFull. + // Our pending star rating¹, only visible for ourselves. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-rating // // Use SetStarsMyPendingRating and GetStarsMyPendingRating helpers. StarsMyPendingRating StarsRating - // StarsMyPendingRatingDate field of UserFull. + // When the pending star rating¹ will be applied, only visible for ourselves. + // + // Links: + // 1) https://core.telegram.org/api/stars#star-rating // // Use SetStarsMyPendingRatingDate and GetStarsMyPendingRatingDate helpers. StarsMyPendingRatingDate int - // MainTab field of UserFull. + // The main tab for the user's profile, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/profile#tabs // // Use SetMainTab and GetMainTab helpers. MainTab ProfileTabClass - // SavedMusic field of UserFull. + // The first song on the music tab of the profile, see here »¹ for more info on the + // music profile tab. + // + // Links: + // 1) https://core.telegram.org/api/profile#music // // Use SetSavedMusic and GetSavedMusic helpers. SavedMusic DocumentClass diff --git a/tg/tl_user_gen.go b/tg/tl_user_gen.go index 59e4eaf4c0..f8b5c0f3ba 100644 --- a/tg/tl_user_gen.go +++ b/tg/tl_user_gen.go @@ -294,33 +294,15 @@ type User struct { StoriesHidden bool // No stories from this user are visible. StoriesUnavailable bool - // If set, we can only write to this user if they have already sent some messages to us, - // if we are subscribed to Telegram Premium¹, or if they're a mutual contact (user² - // mutual_contact). All the secondary conditions listed above must be checked separately - // to verify whether we can still write to the user, even if this flag is set (i.e. a - // mutual contact will have this flag set even if we can still write to them, and so on.. - // ); to avoid doing these extra checks if we haven't yet cached all the required - // information (for example while displaying the chat list in the sharing UI) the users - // getIsPremiumRequiredToContact³ method may be invoked instead, passing the list of - // users currently visible in the UI, returning a list of booleans that directly specify - // whether we can or cannot write to each user; alternatively, the userFull⁴ - // contact_require_premium flag contains the same (fully checked, i.e. it's not just a - // copy of this flag) info returned by users.getIsPremiumRequiredToContact⁵. To set - // this flag for ourselves invoke account.setGlobalPrivacySettings⁶, setting the - // settings.new_noncontact_peers_require_premium flag. + // See here for more info on this flag »¹. // // Links: - // 1) https://core.telegram.org/api/premium - // 2) https://core.telegram.org/constructor/user - // 3) https://core.telegram.org/method/users.getIsPremiumRequiredToContact - // 4) https://core.telegram.org/constructor/userFull - // 5) https://core.telegram.org/method/users.getIsPremiumRequiredToContact - // 6) https://core.telegram.org/method/account.setGlobalPrivacySettings + // 1) https://core.telegram.org/api/privacy#require-premium-for-new-non-contact-users ContactRequirePremium bool // Whether this bot can be connected to a user as specified here »¹. // // Links: - // 1) https://core.telegram.org/api/business#connected-bots + // 1) https://core.telegram.org/api/bots/connected-business-bots BotBusiness bool // If set, this bot has configured a Main Mini App »¹. // @@ -329,7 +311,7 @@ type User struct { BotHasMainApp bool // BotForumView field of User. BotForumView bool - // ID of the user, see here »¹ for more info. + // ID of the user, see here »¹ for more info and the available ID range. // // Links: // 1) https://core.telegram.org/api/peers#peer-id @@ -484,11 +466,24 @@ type User struct { // // Use SetBotActiveUsers and GetBotActiveUsers helpers. BotActiveUsers int - // BotVerificationIcon field of User. + // Describes a bot verification icon »¹. + // + // Links: + // 1) https://core.telegram.org/api/bots/verification // // Use SetBotVerificationIcon and GetBotVerificationIcon helpers. BotVerificationIcon int64 - // SendPaidMessagesStars field of User. + // If set, the user has enabled paid messages »¹, we might need to pay the specified + // amount of Stars² to send them messages, depending on the configured exceptions: check + // userFull³.send_paid_messages_stars or users.getRequirementsToContact⁴ to see if the + // currently logged in user actually has to pay or not, see here »⁵ for the full flow. + // + // Links: + // 1) https://core.telegram.org/api/paid-messages + // 2) https://core.telegram.org/api/stars + // 3) https://core.telegram.org/constructor/userFull + // 4) https://core.telegram.org/method/users.getRequirementsToContact + // 5) https://core.telegram.org/api/paid-messages // // Use SetSendPaidMessagesStars and GetSendPaidMessagesStars helpers. SendPaidMessagesStars int64 diff --git a/tg/tl_users_get_full_user_gen.go b/tg/tl_users_get_full_user_gen.go index 5323b5b2fd..849f534962 100644 --- a/tg/tl_users_get_full_user_gen.go +++ b/tg/tl_users_get_full_user_gen.go @@ -178,7 +178,6 @@ func (g *UsersGetFullUserRequest) GetID() (value InputUserClass) { // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/users.getFullUser for reference. -// Can be used by bots. func (c *Client) UsersGetFullUser(ctx context.Context, id InputUserClass) (*UsersUserFull, error) { var result UsersUserFull diff --git a/tg/tl_users_get_requirements_to_contact_gen.go b/tg/tl_users_get_requirements_to_contact_gen.go index 4cda89e8ef..0e155c1f1c 100644 --- a/tg/tl_users_get_requirements_to_contact_gen.go +++ b/tg/tl_users_get_requirements_to_contact_gen.go @@ -32,10 +32,19 @@ var ( ) // UsersGetRequirementsToContactRequest represents TL type `users.getRequirementsToContact#d89a83a3`. +// Check whether we can write to the specified users, used to implement bulk checks for +// Premium-only messages »¹ and paid messages »². +// For each input user, returns a RequirementToContact¹ constructor (at the same offset +// in the vector) containing requirements to contact them. +// +// Links: +// 1. https://core.telegram.org/api/privacy#require-premium-for-new-non-contact-users +// 2. https://core.telegram.org/api/paid-messages +// 3. https://core.telegram.org/type/RequirementToContact // // See https://core.telegram.org/method/users.getRequirementsToContact for reference. type UsersGetRequirementsToContactRequest struct { - // ID field of UsersGetRequirementsToContactRequest. + // Users to check. ID []InputUserClass } @@ -184,9 +193,17 @@ func (g *UsersGetRequirementsToContactRequest) MapID() (value InputUserClassArra } // UsersGetRequirementsToContact invokes method users.getRequirementsToContact#d89a83a3 returning error if any. +// Check whether we can write to the specified users, used to implement bulk checks for +// Premium-only messages »¹ and paid messages »². +// For each input user, returns a RequirementToContact¹ constructor (at the same offset +// in the vector) containing requirements to contact them. +// +// Links: +// 1. https://core.telegram.org/api/privacy#require-premium-for-new-non-contact-users +// 2. https://core.telegram.org/api/paid-messages +// 3. https://core.telegram.org/type/RequirementToContact // // See https://core.telegram.org/method/users.getRequirementsToContact for reference. -// Can be used by bots. func (c *Client) UsersGetRequirementsToContact(ctx context.Context, id []InputUserClass) ([]RequirementToContactClass, error) { var result RequirementToContactClassVector diff --git a/tg/tl_users_get_saved_music_by_id_gen.go b/tg/tl_users_get_saved_music_by_id_gen.go index 7df0d883f8..eac89bfb48 100644 --- a/tg/tl_users_get_saved_music_by_id_gen.go +++ b/tg/tl_users_get_saved_music_by_id_gen.go @@ -32,12 +32,17 @@ var ( ) // UsersGetSavedMusicByIDRequest represents TL type `users.getSavedMusicByID#7573a4e9`. +// Check if the passed songs are still pinned to the user's profile, or refresh the file +// references of songs pinned on a user's profile see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#music // // See https://core.telegram.org/method/users.getSavedMusicByID for reference. type UsersGetSavedMusicByIDRequest struct { - // ID field of UsersGetSavedMusicByIDRequest. + // The ID of the user. ID InputUserClass - // Documents field of UsersGetSavedMusicByIDRequest. + // The songs (here, file_reference can be empty to refresh file references). Documents []InputDocumentClass } @@ -216,6 +221,15 @@ func (g *UsersGetSavedMusicByIDRequest) MapDocuments() (value InputDocumentClass } // UsersGetSavedMusicByID invokes method users.getSavedMusicByID#7573a4e9 returning error if any. +// Check if the passed songs are still pinned to the user's profile, or refresh the file +// references of songs pinned on a user's profile see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#music +// +// Possible errors: +// +// 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/users.getSavedMusicByID for reference. func (c *Client) UsersGetSavedMusicByID(ctx context.Context, request *UsersGetSavedMusicByIDRequest) (UsersSavedMusicClass, error) { diff --git a/tg/tl_users_get_saved_music_gen.go b/tg/tl_users_get_saved_music_gen.go index 65298d4562..36c20af412 100644 --- a/tg/tl_users_get_saved_music_gen.go +++ b/tg/tl_users_get_saved_music_gen.go @@ -32,16 +32,27 @@ var ( ) // UsersGetSavedMusicRequest represents TL type `users.getSavedMusic#788d7fe3`. +// Get songs pinned to the user's profile, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#music // // See https://core.telegram.org/method/users.getSavedMusic for reference. type UsersGetSavedMusicRequest struct { - // ID field of UsersGetSavedMusicRequest. + // The ID of the user. ID InputUserClass - // Offset field of UsersGetSavedMusicRequest. + // Offset for pagination. Offset int - // Limit field of UsersGetSavedMusicRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int - // Hash field of UsersGetSavedMusicRequest. + // Hash »¹ of the IDs of previously added songs, to avoid returning any result if there + // was no change. + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } @@ -247,6 +258,14 @@ func (g *UsersGetSavedMusicRequest) GetHash() (value int64) { } // UsersGetSavedMusic invokes method users.getSavedMusic#788d7fe3 returning error if any. +// Get songs pinned to the user's profile, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#music +// +// Possible errors: +// +// 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/users.getSavedMusic for reference. func (c *Client) UsersGetSavedMusic(ctx context.Context, request *UsersGetSavedMusicRequest) (UsersSavedMusicClass, error) { diff --git a/tg/tl_users_get_users_gen.go b/tg/tl_users_get_users_gen.go index c03f76c5c9..f03ee9092e 100644 --- a/tg/tl_users_get_users_gen.go +++ b/tg/tl_users_get_users_gen.go @@ -197,7 +197,6 @@ func (g *UsersGetUsersRequest) MapID() (value InputUserClassArray) { // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // // See https://core.telegram.org/method/users.getUsers for reference. -// Can be used by bots. func (c *Client) UsersGetUsers(ctx context.Context, id []InputUserClass) ([]UserClass, error) { var result UserClassVector diff --git a/tg/tl_users_saved_music_gen.go b/tg/tl_users_saved_music_gen.go index 3cd85f4e02..dda884afa9 100644 --- a/tg/tl_users_saved_music_gen.go +++ b/tg/tl_users_saved_music_gen.go @@ -32,10 +32,15 @@ var ( ) // UsersSavedMusicNotModified represents TL type `users.savedMusicNotModified#e3878aa4`. +// This subset of the songs currently pinned on a user's profile hasn't changed, see here +// »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#music // // See https://core.telegram.org/constructor/users.savedMusicNotModified for reference. type UsersSavedMusicNotModified struct { - // Count field of UsersSavedMusicNotModified. + // Total number of songs on the user's profile. Count int } @@ -166,12 +171,17 @@ func (s *UsersSavedMusicNotModified) GetCount() (value int) { } // UsersSavedMusic represents TL type `users.savedMusic#34a2f297`. +// List of songs currently pinned on a user's profile, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/profile#music // // See https://core.telegram.org/constructor/users.savedMusic for reference. type UsersSavedMusic struct { - // Count field of UsersSavedMusic. + // Total number of songs (can be bigger than documents depending on the passed limit, and + // the default maximum limit in which case pagination is required). Count int - // Documents field of UsersSavedMusic. + // Songs. Documents []DocumentClass } @@ -389,7 +399,7 @@ type UsersSavedMusicClass interface { // Zero returns true if current object has a zero value. Zero() bool - // Count field of UsersSavedMusicNotModified. + // Total number of songs on the user's profile. GetCount() (value int) // AsModified tries to map UsersSavedMusicClass to UsersSavedMusic. diff --git a/tg/tl_users_set_secure_value_errors_gen.go b/tg/tl_users_set_secure_value_errors_gen.go index 8cdddbafbd..d6c97e5d81 100644 --- a/tg/tl_users_set_secure_value_errors_gen.go +++ b/tg/tl_users_set_secure_value_errors_gen.go @@ -239,12 +239,12 @@ func (s *UsersSetSecureValueErrorsRequest) MapErrors() (value SecureValueErrorCl // // Possible errors: // -// 403 USER_BOT_INVALID: User accounts must provide the bot method parameter when calling this method. If there is no such method parameter, this method can only be invoked by bot accounts. +// 400 DATA_HASH_SIZE_INVALID: The size of the specified secureValueErrorData.data_hash is invalid. +// 400 HASH_SIZE_INVALID: The size of the specified secureValueError.hash is invalid. // 400 USER_BOT_REQUIRED: This method can only be called by a bot. // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/users.setSecureValueErrors for reference. -// Can be used by bots. func (c *Client) UsersSetSecureValueErrors(ctx context.Context, request *UsersSetSecureValueErrorsRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_users_users_gen.go b/tg/tl_users_users_gen.go index 579f62baf1..659475617f 100644 --- a/tg/tl_users_users_gen.go +++ b/tg/tl_users_users_gen.go @@ -32,10 +32,11 @@ var ( ) // UsersUsers represents TL type `users.users#62d706b8`. +// Describes a list of users (or bots). // // See https://core.telegram.org/constructor/users.users for reference. type UsersUsers struct { - // Users field of UsersUsers. + // Users Users []UserClass } @@ -189,12 +190,13 @@ func (u *UsersUsers) MapUsers() (value UserClassArray) { } // UsersUsersSlice represents TL type `users.usersSlice#315a4974`. +// Describes a partial list of users. // // See https://core.telegram.org/constructor/users.usersSlice for reference. type UsersUsersSlice struct { - // Count field of UsersUsersSlice. + // Total number of users (bigger than the users specified in users) Count int - // Users field of UsersUsersSlice. + // Subset of users. Users []UserClass } @@ -412,9 +414,9 @@ type UsersUsersClass interface { // Zero returns true if current object has a zero value. Zero() bool - // Users field of UsersUsers. + // Users GetUsers() (value []UserClass) - // Users field of UsersUsers. + // Users MapUsers() (value UserClassArray) } diff --git a/tg/tl_web_page_attribute_gen.go b/tg/tl_web_page_attribute_gen.go index d37815b8b3..5b4a7a2a34 100644 --- a/tg/tl_web_page_attribute_gen.go +++ b/tg/tl_web_page_attribute_gen.go @@ -792,10 +792,21 @@ func (w *WebPageAttributeStickerSet) MapStickers() (value DocumentClassArray) { } // WebPageAttributeUniqueStarGift represents TL type `webPageAttributeUniqueStarGift#cf6f6db8`. +// Contains info about collectible gift »¹ for a webPage² preview of a collectible +// gift »³ (the webPage⁴ will have a type of telegram_nft). +// +// Links: +// 1. https://core.telegram.org/api/gifts#collectible-gifts +// 2. https://core.telegram.org/constructor/webPage +// 3. https://core.telegram.org/api/gifts#collectible-gifts +// 4. https://core.telegram.org/constructor/webPage // // See https://core.telegram.org/constructor/webPageAttributeUniqueStarGift for reference. type WebPageAttributeUniqueStarGift struct { - // Gift field of WebPageAttributeUniqueStarGift. + // The starGiftUnique¹ constructor. + // + // Links: + // 1) https://core.telegram.org/constructor/starGiftUnique Gift StarGiftClass } @@ -931,10 +942,18 @@ func (w *WebPageAttributeUniqueStarGift) GetGift() (value StarGiftClass) { } // WebPageAttributeStarGiftCollection represents TL type `webPageAttributeStarGiftCollection#31cad303`. +// Contains info about a gift collection »¹ for a webPage² preview of a gift +// collection »³ (the webPage⁴ will have a type of telegram_collection). +// +// Links: +// 1. https://core.telegram.org/api/gifts#gift-collections +// 2. https://core.telegram.org/constructor/webPage +// 3. https://core.telegram.org/api/gifts#gift-collections +// 4. https://core.telegram.org/constructor/webPage // // See https://core.telegram.org/constructor/webPageAttributeStarGiftCollection for reference. type WebPageAttributeStarGiftCollection struct { - // Icons field of WebPageAttributeStarGiftCollection. + // Gifts in the collection. Icons []DocumentClass } diff --git a/tg/tl_web_page_gen.go b/tg/tl_web_page_gen.go index 4618e7c740..7575464cd0 100644 --- a/tg/tl_web_page_gen.go +++ b/tg/tl_web_page_gen.go @@ -478,7 +478,10 @@ type WebPage struct { Flags bin.Fields // Whether the size of the media in the preview can be changed. HasLargeMedia bool - // VideoCoverPhoto field of WebPage. + // Represents a custom video cover¹. + // + // Links: + // 1) https://core.telegram.org/api/files#video-covers VideoCoverPhoto bool // Preview ID ID int64 @@ -491,13 +494,14 @@ type WebPage struct { // Links: // 1) https://core.telegram.org/api/offsets#hash-generation Hash int - // Type of the web page. One of the following: - video- gif- photo- document- profile- - // telegram_background- telegram_theme- telegram_story- telegram_channel- - // telegram_channel_request- telegram_megagroup- telegram_chat- - // telegram_megagroup_request- telegram_chat_request- telegram_album- telegram_message- - // telegram_bot- telegram_voicechat- telegram_livestream- telegram_call- telegram_user- - // telegram_botapp- telegram_channel_boost- telegram_group_boost- telegram_giftcode- - // telegram_stickerset + // Type of the web page. One of the following: - app- article- document- gif- photo- + // profile- telegram_album- telegram_background- telegram_bot- telegram_botapp- + // telegram_call- telegram_channel- telegram_channel_boost- telegram_channel_direct- + // telegram_channel_request- telegram_chat- telegram_chat_request- telegram_chatlist- + // telegram_collection- telegram_community- telegram_giftcode- telegram_group_boost- + // telegram_livestream- telegram_megagroup- telegram_megagroup_request- telegram_message- + // telegram_nft- telegram_stickerset- telegram_story- telegram_story_album- + // telegram_theme- telegram_user- telegram_videochat- telegram_voicechat- video // // Use SetType and GetType helpers. Type string