diff --git a/go.mod b/go.mod index cd6db8e65c..53dc811faf 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/go-faster/jx v0.39.0 github.com/go-faster/xor v0.3.0 github.com/go-openapi/inflect v0.19.0 - github.com/gotd/getdoc v0.12.0 + github.com/gotd/getdoc v0.13.0 github.com/gotd/ige v0.2.2 github.com/gotd/neo v0.1.5 github.com/gotd/tl v0.4.0 @@ -23,7 +23,7 @@ require ( go.uber.org/multierr v1.8.0 go.uber.org/zap v1.22.0 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 - golang.org/x/net v0.0.0-20220722155237-a158d28d115b + golang.org/x/net v0.0.0-20220812174116-3211cb980234 golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 golang.org/x/tools v0.1.12 nhooyr.io/websocket v1.8.7 @@ -45,7 +45,7 @@ require ( github.com/sergi/go-diff v1.1.0 // indirect go.uber.org/ratelimit v0.2.0 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect + golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/errgo.v2 v2.1.0 // indirect diff --git a/go.sum b/go.sum index f5aa299aa7..4e03ece070 100644 --- a/go.sum +++ b/go.sum @@ -49,8 +49,8 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gotd/getdoc v0.12.0 h1:rqhnK8VoGdIOPOxptQ5te3qy8yK7xV/FU5v9MzacFm4= -github.com/gotd/getdoc v0.12.0/go.mod h1:+tt6hA1p7ldqydZJqLE33fMi+qjXp/iG2kNZMJoCRxE= +github.com/gotd/getdoc v0.13.0 h1:KRWKZk7UjvlC0osvLgRcDEXW1TxZC3gilVyHuSCI5vM= +github.com/gotd/getdoc v0.13.0/go.mod h1:+tt6hA1p7ldqydZJqLE33fMi+qjXp/iG2kNZMJoCRxE= 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= @@ -145,8 +145,9 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220812174116-3211cb980234 h1:RDqmgfe7SvlMWoqC3xwQ2blLO3fcWcxMa3eBLRdRW7E= +golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -164,8 +165,9 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/tg/tl_account_get_saved_ringtones_gen.go b/tg/tl_account_get_saved_ringtones_gen.go index 60af4f7574..ee2a560287 100644 --- a/tg/tl_account_get_saved_ringtones_gen.go +++ b/tg/tl_account_get_saved_ringtones_gen.go @@ -32,10 +32,14 @@ var ( ) // AccountGetSavedRingtonesRequest represents TL type `account.getSavedRingtones#e1902288`. +// Fetch saved notification sounds // // See https://core.telegram.org/method/account.getSavedRingtones for reference. type AccountGetSavedRingtonesRequest struct { + // Hash for pagination, for more info click here¹ // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } @@ -161,9 +165,9 @@ func (g *AccountGetSavedRingtonesRequest) GetHash() (value int64) { } // AccountGetSavedRingtones invokes method account.getSavedRingtones#e1902288 returning error if any. +// Fetch saved notification sounds // // See https://core.telegram.org/method/account.getSavedRingtones for reference. -// Can be used by bots. func (c *Client) AccountGetSavedRingtones(ctx context.Context, hash int64) (AccountSavedRingtonesClass, error) { var result AccountSavedRingtonesBox diff --git a/tg/tl_account_save_ringtone_gen.go b/tg/tl_account_save_ringtone_gen.go index 8b26390630..621e8a1a31 100644 --- a/tg/tl_account_save_ringtone_gen.go +++ b/tg/tl_account_save_ringtone_gen.go @@ -32,12 +32,27 @@ var ( ) // AccountSaveRingtoneRequest represents TL type `account.saveRingtone#3dea5b03`. +// Save or remove saved notification sound. +// If the notification sound is already in MP3 format, account.savedRingtone¹ will be +// returned. +// Otherwise, it will be automatically converted and a account.savedRingtoneConverted² +// will be returned, containing a new document³ object that should be used to refer to +// the ringtone from now on (ie when deleting it using the unsave parameter, or when +// downloading it). +// +// Links: +// 1. https://core.telegram.org/constructor/account.savedRingtone +// 2. https://core.telegram.org/constructor/account.savedRingtoneConverted +// 3. https://core.telegram.org/constructor/document // // See https://core.telegram.org/method/account.saveRingtone for reference. type AccountSaveRingtoneRequest struct { + // Notification sound uploaded using account.uploadRingtone¹ // + // Links: + // 1) https://core.telegram.org/method/account.uploadRingtone ID InputDocumentClass - // + // Whether to add or delete the notification sound Unsave bool } @@ -198,9 +213,20 @@ func (s *AccountSaveRingtoneRequest) GetIDAsNotEmpty() (*InputDocument, bool) { } // AccountSaveRingtone invokes method account.saveRingtone#3dea5b03 returning error if any. +// Save or remove saved notification sound. +// If the notification sound is already in MP3 format, account.savedRingtone¹ will be +// returned. +// Otherwise, it will be automatically converted and a account.savedRingtoneConverted² +// will be returned, containing a new document³ object that should be used to refer to +// the ringtone from now on (ie when deleting it using the unsave parameter, or when +// downloading it). +// +// Links: +// 1. https://core.telegram.org/constructor/account.savedRingtone +// 2. https://core.telegram.org/constructor/account.savedRingtoneConverted +// 3. https://core.telegram.org/constructor/document // // See https://core.telegram.org/method/account.saveRingtone for reference. -// Can be used by bots. func (c *Client) AccountSaveRingtone(ctx context.Context, request *AccountSaveRingtoneRequest) (AccountSavedRingtoneClass, error) { var result AccountSavedRingtoneBox diff --git a/tg/tl_account_upload_ringtone_gen.go b/tg/tl_account_upload_ringtone_gen.go index 0cfe309430..78f13e4e02 100644 --- a/tg/tl_account_upload_ringtone_gen.go +++ b/tg/tl_account_upload_ringtone_gen.go @@ -32,14 +32,19 @@ var ( ) // AccountUploadRingtoneRequest represents TL type `account.uploadRingtone#831a83a2`. +// Upload notification sound, use account.saveRingtone¹ to convert it and add it to the +// list of saved notification sounds. +// +// Links: +// 1. https://core.telegram.org/method/account.saveRingtone // // See https://core.telegram.org/method/account.uploadRingtone for reference. type AccountUploadRingtoneRequest struct { - // + // Notification sound File InputFileClass - // + // File name FileName string - // + // MIME type of file MimeType string } @@ -220,9 +225,13 @@ func (u *AccountUploadRingtoneRequest) GetMimeType() (value string) { } // AccountUploadRingtone invokes method account.uploadRingtone#831a83a2 returning error if any. +// Upload notification sound, use account.saveRingtone¹ to convert it and add it to the +// list of saved notification sounds. +// +// Links: +// 1. https://core.telegram.org/method/account.saveRingtone // // See https://core.telegram.org/method/account.uploadRingtone for reference. -// Can be used by bots. func (c *Client) AccountUploadRingtone(ctx context.Context, request *AccountUploadRingtoneRequest) (DocumentClass, error) { var result DocumentBox diff --git a/tg/tl_bots_answer_webhook_json_query_gen.go b/tg/tl_bots_answer_webhook_json_query_gen.go index c1cd57e715..44ead3934c 100644 --- a/tg/tl_bots_answer_webhook_json_query_gen.go +++ b/tg/tl_bots_answer_webhook_json_query_gen.go @@ -193,6 +193,7 @@ func (a *BotsAnswerWebhookJSONQueryRequest) GetData() (value DataJSON) { // // Possible errors: // +// 400 DATA_JSON_INVALID: The provided JSON data is invalid. // 400 QUERY_ID_INVALID: The query ID is invalid. // 403 USER_BOT_INVALID: This method can only be called by a bot. // diff --git a/tg/tl_bots_get_bot_menu_button_gen.go b/tg/tl_bots_get_bot_menu_button_gen.go index 9737ee7a1e..66be294d85 100644 --- a/tg/tl_bots_get_bot_menu_button_gen.go +++ b/tg/tl_bots_get_bot_menu_button_gen.go @@ -32,10 +32,16 @@ var ( ) // BotsGetBotMenuButtonRequest represents TL type `bots.getBotMenuButton#9c60eb28`. +// Gets the menu button action for a given user or for all users, previously set using +// bots.setBotMenuButton¹; users can see this information in the botInfo² constructor. +// +// Links: +// 1. https://core.telegram.org/method/bots.setBotMenuButton +// 2. https://core.telegram.org/constructor/botInfo // // See https://core.telegram.org/method/bots.getBotMenuButton for reference. type BotsGetBotMenuButtonRequest struct { - // + // User ID or empty for the default menu button. UserID InputUserClass } @@ -166,6 +172,12 @@ func (g *BotsGetBotMenuButtonRequest) GetUserID() (value InputUserClass) { } // BotsGetBotMenuButton invokes method bots.getBotMenuButton#9c60eb28 returning error if any. +// Gets the menu button action for a given user or for all users, previously set using +// bots.setBotMenuButton¹; users can see this information in the botInfo² constructor. +// +// Links: +// 1. https://core.telegram.org/method/bots.setBotMenuButton +// 2. https://core.telegram.org/constructor/botInfo // // Possible errors: // diff --git a/tg/tl_bots_send_custom_request_gen.go b/tg/tl_bots_send_custom_request_gen.go index 0dfec0acba..55dab981a8 100644 --- a/tg/tl_bots_send_custom_request_gen.go +++ b/tg/tl_bots_send_custom_request_gen.go @@ -193,6 +193,7 @@ func (s *BotsSendCustomRequestRequest) GetParams() (value DataJSON) { // // Possible errors: // +// 400 DATA_JSON_INVALID: The provided JSON data is invalid. // 400 METHOD_INVALID: The specified method is invalid. // 403 USER_BOT_INVALID: This method can only be called by a bot. // 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 d59fe90e24..d7463cebe0 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 @@ -32,10 +32,11 @@ var ( ) // BotsSetBotBroadcastDefaultAdminRightsRequest represents TL type `bots.setBotBroadcastDefaultAdminRights#788464e1`. +// Set the default suggested admin rights for bots being added as admins to channels. // // See https://core.telegram.org/method/bots.setBotBroadcastDefaultAdminRights for reference. type BotsSetBotBroadcastDefaultAdminRightsRequest struct { - // + // Admin rights AdminRights ChatAdminRights } @@ -161,6 +162,11 @@ func (s *BotsSetBotBroadcastDefaultAdminRightsRequest) GetAdminRights() (value C } // BotsSetBotBroadcastDefaultAdminRights invokes method bots.setBotBroadcastDefaultAdminRights#788464e1 returning error if any. +// Set the default suggested admin rights for bots being added as admins to channels. +// +// Possible errors: +// +// 400 RIGHTS_NOT_MODIFIED: // // See https://core.telegram.org/method/bots.setBotBroadcastDefaultAdminRights for reference. // Can be used by bots. 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 b7900edc7c..15dd53f2d5 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 @@ -32,10 +32,11 @@ var ( ) // BotsSetBotGroupDefaultAdminRightsRequest represents TL type `bots.setBotGroupDefaultAdminRights#925ec9ea`. +// Set the default suggested admin rights for bots being added as admins to groups. // // See https://core.telegram.org/method/bots.setBotGroupDefaultAdminRights for reference. type BotsSetBotGroupDefaultAdminRightsRequest struct { - // + // Admin rights AdminRights ChatAdminRights } @@ -161,6 +162,11 @@ func (s *BotsSetBotGroupDefaultAdminRightsRequest) GetAdminRights() (value ChatA } // BotsSetBotGroupDefaultAdminRights invokes method bots.setBotGroupDefaultAdminRights#925ec9ea returning error if any. +// Set the default suggested admin rights for bots being added as admins to groups. +// +// Possible errors: +// +// 400 RIGHTS_NOT_MODIFIED: // // See https://core.telegram.org/method/bots.setBotGroupDefaultAdminRights for reference. // Can be used by bots. diff --git a/tg/tl_bots_set_bot_menu_button_gen.go b/tg/tl_bots_set_bot_menu_button_gen.go index 48dadc5e3e..2d32089fc7 100644 --- a/tg/tl_bots_set_bot_menu_button_gen.go +++ b/tg/tl_bots_set_bot_menu_button_gen.go @@ -32,12 +32,13 @@ var ( ) // BotsSetBotMenuButtonRequest represents TL type `bots.setBotMenuButton#4504d54f`. +// Sets the menu button action for a given user or for all users // // See https://core.telegram.org/method/bots.setBotMenuButton for reference. type BotsSetBotMenuButtonRequest struct { - // + // User ID UserID InputUserClass - // + // Bot menu button action Button BotMenuButtonClass } @@ -198,6 +199,7 @@ func (s *BotsSetBotMenuButtonRequest) GetButton() (value BotMenuButtonClass) { } // BotsSetBotMenuButton invokes method bots.setBotMenuButton#4504d54f returning error if any. +// Sets the menu button action for a given user or for all users // // See https://core.telegram.org/method/bots.setBotMenuButton for reference. // Can be used by bots. diff --git a/tg/tl_channels_delete_history_gen.go b/tg/tl_channels_delete_history_gen.go index 090d5fcbe1..be1e95d659 100644 --- a/tg/tl_channels_delete_history_gen.go +++ b/tg/tl_channels_delete_history_gen.go @@ -44,7 +44,7 @@ type ChannelsDeleteHistoryRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // + // Whether the history should be deleted for everyone ForEveryone bool // Supergroup¹ whose history must be deleted // diff --git a/tg/tl_channels_delete_participant_history_gen.go b/tg/tl_channels_delete_participant_history_gen.go index 4526ca7f94..d1d2a7a617 100644 --- a/tg/tl_channels_delete_participant_history_gen.go +++ b/tg/tl_channels_delete_participant_history_gen.go @@ -216,7 +216,6 @@ func (d *ChannelsDeleteParticipantHistoryRequest) GetChannelAsNotEmpty() (NotEmp // 400 PARTICIPANT_ID_INVALID: The specified participant ID is invalid. // // See https://core.telegram.org/method/channels.deleteParticipantHistory for reference. -// Can be used by bots. func (c *Client) ChannelsDeleteParticipantHistory(ctx context.Context, request *ChannelsDeleteParticipantHistoryRequest) (*MessagesAffectedHistory, error) { var result MessagesAffectedHistory diff --git a/tg/tl_channels_get_send_as_gen.go b/tg/tl_channels_get_send_as_gen.go index d68e4e5b59..73a493234f 100644 --- a/tg/tl_channels_get_send_as_gen.go +++ b/tg/tl_channels_get_send_as_gen.go @@ -175,7 +175,6 @@ func (g *ChannelsGetSendAsRequest) GetPeer() (value InputPeerClass) { // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/channels.getSendAs for reference. -// Can be used by bots. func (c *Client) ChannelsGetSendAs(ctx context.Context, peer InputPeerClass) (*ChannelsSendAsPeers, error) { var result ChannelsSendAsPeers diff --git a/tg/tl_channels_toggle_join_request_gen.go b/tg/tl_channels_toggle_join_request_gen.go index c6bba695ff..6a1a8c301d 100644 --- a/tg/tl_channels_toggle_join_request_gen.go +++ b/tg/tl_channels_toggle_join_request_gen.go @@ -32,12 +32,16 @@ var ( ) // ChannelsToggleJoinRequestRequest represents TL type `channels.toggleJoinRequest#4c2985b6`. +// Set whether all users should request admin approval to join the group »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#join-requests // // See https://core.telegram.org/method/channels.toggleJoinRequest for reference. type ChannelsToggleJoinRequestRequest struct { - // + // Group Channel InputChannelClass - // + // Toggle Enabled bool } @@ -198,9 +202,12 @@ func (t *ChannelsToggleJoinRequestRequest) GetChannelAsNotEmpty() (NotEmptyInput } // ChannelsToggleJoinRequest invokes method channels.toggleJoinRequest#4c2985b6 returning error if any. +// Set whether all users should request admin approval to join the group »¹. +// +// Links: +// 1. https://core.telegram.org/api/invites#join-requests // // See https://core.telegram.org/method/channels.toggleJoinRequest for reference. -// Can be used by bots. func (c *Client) ChannelsToggleJoinRequest(ctx context.Context, request *ChannelsToggleJoinRequestRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_channels_toggle_join_to_send_gen.go b/tg/tl_channels_toggle_join_to_send_gen.go index e0f8cc8b59..de99490137 100644 --- a/tg/tl_channels_toggle_join_to_send_gen.go +++ b/tg/tl_channels_toggle_join_to_send_gen.go @@ -32,12 +32,17 @@ var ( ) // ChannelsToggleJoinToSendRequest represents TL type `channels.toggleJoinToSend#e4cb9580`. +// Set whether all users should join a discussion group in order to comment on a post +// »¹ +// +// Links: +// 1. https://core.telegram.org/api/discussion#requiring-users-to-join-the-group // // See https://core.telegram.org/method/channels.toggleJoinToSend for reference. type ChannelsToggleJoinToSendRequest struct { - // + // Discussion group Channel InputChannelClass - // + // Toggle Enabled bool } @@ -198,9 +203,13 @@ func (t *ChannelsToggleJoinToSendRequest) GetChannelAsNotEmpty() (NotEmptyInputC } // ChannelsToggleJoinToSend invokes method channels.toggleJoinToSend#e4cb9580 returning error if any. +// Set whether all users should join a discussion group in order to comment on a post +// »¹ +// +// Links: +// 1. https://core.telegram.org/api/discussion#requiring-users-to-join-the-group // // See https://core.telegram.org/method/channels.toggleJoinToSend for reference. -// Can be used by bots. func (c *Client) ChannelsToggleJoinToSend(ctx context.Context, request *ChannelsToggleJoinToSendRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_chat_gen.go b/tg/tl_chat_gen.go index 61ce1c038d..457e3974eb 100644 --- a/tg/tl_chat_gen.go +++ b/tg/tl_chat_gen.go @@ -1057,9 +1057,19 @@ type Channel struct { // Links: // 1) https://telegram.org/blog/protected-content-delete-by-date-and-more Noforwards bool + // Whether a user needs to join the supergroup before they can send messages: can be + // false only for discussion groups »¹, toggle using channels.toggleJoinToSend² // + // Links: + // 1) https://core.telegram.org/api/discussion + // 2) https://core.telegram.org/method/channels.toggleJoinToSend JoinToSend bool + // Whether a user's join request will have to be approved by administrators¹, toggle + // using channels.toggleJoinToSend² // + // Links: + // 1) https://core.telegram.org/api/invites#join-requests + // 2) https://core.telegram.org/method/channels.toggleJoinRequest JoinRequest bool // ID of the channel ID int64 diff --git a/tg/tl_document_attribute_gen.go b/tg/tl_document_attribute_gen.go index bbae244dab..eeac07a80b 100644 --- a/tg/tl_document_attribute_gen.go +++ b/tg/tl_document_attribute_gen.go @@ -1419,6 +1419,7 @@ func (d *DocumentAttributeHasStickers) DecodeBare(b *bin.Buffer) error { } // DocumentAttributeCustomEmoji represents TL type `documentAttributeCustomEmoji#fd149899`. +// Info about a custom emoji // // See https://core.telegram.org/constructor/documentAttributeCustomEmoji for reference. type DocumentAttributeCustomEmoji struct { @@ -1429,9 +1430,9 @@ type DocumentAttributeCustomEmoji struct { Flags bin.Fields // Free bool - // + // The actual emoji Alt string - // + // The emoji stickerset to which this emoji belongs. Stickerset InputStickerSetClass } diff --git a/tg/tl_errors_gen.go b/tg/tl_errors_gen.go index 5b0c269e9a..e56b004ddb 100644 --- a/tg/tl_errors_gen.go +++ b/tg/tl_errors_gen.go @@ -349,6 +349,7 @@ const ( ErrResultIDInvalid = "RESULT_ID_INVALID" ErrResultTypeInvalid = "RESULT_TYPE_INVALID" ErrRevoteNotAllowed = "REVOTE_NOT_ALLOWED" + ErrRightsNotModified = "RIGHTS_NOT_MODIFIED" ErrRightForbidden = "RIGHT_FORBIDDEN" ErrRsaDecryptFailed = "RSA_DECRYPT_FAILED" ErrScheduleBotNotAllowed = "SCHEDULE_BOT_NOT_ALLOWED" @@ -2049,6 +2050,11 @@ func IsRevoteNotAllowed(err error) bool { return tgerr.Is(err, ErrRevoteNotAllowed) } +// IsRightsNotModified reports whether err is RIGHTS_NOT_MODIFIED. +func IsRightsNotModified(err error) bool { + return tgerr.Is(err, ErrRightsNotModified) +} + // IsRightForbidden reports whether err is RIGHT_FORBIDDEN. func IsRightForbidden(err error) bool { return tgerr.Is(err, ErrRightForbidden) diff --git a/tg/tl_help_get_premium_promo_gen.go b/tg/tl_help_get_premium_promo_gen.go index 31f2427f29..2bece3f391 100644 --- a/tg/tl_help_get_premium_promo_gen.go +++ b/tg/tl_help_get_premium_promo_gen.go @@ -32,6 +32,7 @@ var ( ) // HelpGetPremiumPromoRequest represents TL type `help.getPremiumPromo#b81b93d4`. +// Get Telegram Premim promotion information // // See https://core.telegram.org/method/help.getPremiumPromo for reference. type HelpGetPremiumPromoRequest struct { @@ -128,9 +129,9 @@ func (g *HelpGetPremiumPromoRequest) DecodeBare(b *bin.Buffer) error { } // HelpGetPremiumPromo invokes method help.getPremiumPromo#b81b93d4 returning error if any. +// Get Telegram Premim promotion information // // See https://core.telegram.org/method/help.getPremiumPromo for reference. -// Can be used by bots. func (c *Client) HelpGetPremiumPromo(ctx context.Context) (*HelpPremiumPromo, error) { var result HelpPremiumPromo diff --git a/tg/tl_input_privacy_key_gen.go b/tg/tl_input_privacy_key_gen.go index 89a4246b81..8223f8fc70 100644 --- a/tg/tl_input_privacy_key_gen.go +++ b/tg/tl_input_privacy_key_gen.go @@ -32,7 +32,7 @@ var ( ) // InputPrivacyKeyStatusTimestamp represents TL type `inputPrivacyKeyStatusTimestamp#4f96cb18`. -// Whether we can see the exact last online timestamp of the user +// Whether people will be able to see your exact last online timestamp // // See https://core.telegram.org/constructor/inputPrivacyKeyStatusTimestamp for reference. type InputPrivacyKeyStatusTimestamp struct { @@ -134,7 +134,7 @@ func (i *InputPrivacyKeyStatusTimestamp) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyChatInvite represents TL type `inputPrivacyKeyChatInvite#bdfb0426`. -// Whether the user can be invited to chats +// Whether people will be able to invite you to chats // // See https://core.telegram.org/constructor/inputPrivacyKeyChatInvite for reference. type InputPrivacyKeyChatInvite struct { @@ -236,7 +236,7 @@ func (i *InputPrivacyKeyChatInvite) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyPhoneCall represents TL type `inputPrivacyKeyPhoneCall#fabadc5f`. -// Whether the user will accept phone calls +// Whether you will accept phone calls // // See https://core.telegram.org/constructor/inputPrivacyKeyPhoneCall for reference. type InputPrivacyKeyPhoneCall struct { @@ -338,7 +338,7 @@ func (i *InputPrivacyKeyPhoneCall) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyPhoneP2P represents TL type `inputPrivacyKeyPhoneP2P#db9e70d2`. -// Whether the user allows P2P communication during VoIP calls +// Whether to allow P2P communication during VoIP calls // // See https://core.telegram.org/constructor/inputPrivacyKeyPhoneP2P for reference. type InputPrivacyKeyPhoneP2P struct { @@ -440,7 +440,7 @@ func (i *InputPrivacyKeyPhoneP2P) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyForwards represents TL type `inputPrivacyKeyForwards#a4dd4c08`. -// Whether messages forwarded from this user will be anonymous¹ +// Whether messages forwarded from you will be anonymous¹ // // Links: // 1. https://telegram.org/blog/unsend-privacy-emoji#anonymous-forwarding @@ -545,7 +545,7 @@ func (i *InputPrivacyKeyForwards) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyProfilePhoto represents TL type `inputPrivacyKeyProfilePhoto#5719bacc`. -// Whether people will be able to see the user's profile picture +// Whether people will be able to see your profile picture // // See https://core.telegram.org/constructor/inputPrivacyKeyProfilePhoto for reference. type InputPrivacyKeyProfilePhoto struct { @@ -647,7 +647,7 @@ func (i *InputPrivacyKeyProfilePhoto) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyPhoneNumber represents TL type `inputPrivacyKeyPhoneNumber#352dafa`. -// Whether people will be able to see the user's phone number +// Whether people will be able to see your phone number // // See https://core.telegram.org/constructor/inputPrivacyKeyPhoneNumber for reference. type InputPrivacyKeyPhoneNumber struct { diff --git a/tg/tl_message_entity_gen.go b/tg/tl_message_entity_gen.go index 750e21f23d..22391b8acb 100644 --- a/tg/tl_message_entity_gen.go +++ b/tg/tl_message_entity_gen.go @@ -3534,14 +3534,25 @@ func (m *MessageEntitySpoiler) GetLength() (value int) { } // MessageEntityCustomEmoji represents TL type `messageEntityCustomEmoji#c8cf05f8`. +// Represents a custom emoji // // See https://core.telegram.org/constructor/messageEntityCustomEmoji for reference. type MessageEntityCustomEmoji struct { + // Offset of message entity within message (in UTF-16 code units¹) // + // Links: + // 1) https://core.telegram.org/api/entities#entity-length Offset int + // Length of message entity within message (in UTF-16 code units¹) // + // Links: + // 1) https://core.telegram.org/api/entities#entity-length Length int + // Document ID of the custom emoji, use messages.getCustomEmojiDocuments¹ to fetch the + // emoji animation and the actual emoji it represents. // + // Links: + // 1) https://core.telegram.org/method/messages.getCustomEmojiDocuments DocumentID int64 } diff --git a/tg/tl_messages_get_archived_stickers_gen.go b/tg/tl_messages_get_archived_stickers_gen.go index 5297a5da66..4706fa1324 100644 --- a/tg/tl_messages_get_archived_stickers_gen.go +++ b/tg/tl_messages_get_archived_stickers_gen.go @@ -43,7 +43,7 @@ type MessagesGetArchivedStickersRequest struct { Flags bin.Fields // Get mask stickers Masks bool - // + // Get custom emoji stickers Emojis bool // Offsets for pagination, for more info click here¹ // diff --git a/tg/tl_messages_get_attach_menu_bot_gen.go b/tg/tl_messages_get_attach_menu_bot_gen.go index daf33b73b8..8545409abe 100644 --- a/tg/tl_messages_get_attach_menu_bot_gen.go +++ b/tg/tl_messages_get_attach_menu_bot_gen.go @@ -32,10 +32,15 @@ var ( ) // MessagesGetAttachMenuBotRequest represents TL type `messages.getAttachMenuBot#77216192`. +// Returns attachment menu entry for a bot web app that can be launched from the +// attachment menu »¹ +// +// Links: +// 1. https://core.telegram.org/bots/webapps#launching-web-apps-from-the-attachment-menu // // See https://core.telegram.org/method/messages.getAttachMenuBot for reference. type MessagesGetAttachMenuBotRequest struct { - // + // Bot ID Bot InputUserClass } @@ -166,13 +171,17 @@ func (g *MessagesGetAttachMenuBotRequest) GetBot() (value InputUserClass) { } // MessagesGetAttachMenuBot invokes method messages.getAttachMenuBot#77216192 returning error if any. +// Returns attachment menu entry for a bot web app that can be launched from the +// attachment menu »¹ +// +// Links: +// 1. https://core.telegram.org/bots/webapps#launching-web-apps-from-the-attachment-menu // // Possible errors: // // 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/messages.getAttachMenuBot for reference. -// Can be used by bots. func (c *Client) MessagesGetAttachMenuBot(ctx context.Context, bot InputUserClass) (*AttachMenuBotsBot, error) { var result AttachMenuBotsBot diff --git a/tg/tl_messages_get_attach_menu_bots_gen.go b/tg/tl_messages_get_attach_menu_bots_gen.go index b53fea9b37..c375dba9ac 100644 --- a/tg/tl_messages_get_attach_menu_bots_gen.go +++ b/tg/tl_messages_get_attach_menu_bots_gen.go @@ -32,10 +32,17 @@ var ( ) // MessagesGetAttachMenuBotsRequest represents TL type `messages.getAttachMenuBots#16fcc2cb`. +// Returns installed attachment menu bot web apps »¹ +// +// Links: +// 1. https://core.telegram.org/bots/webapps#launching-web-apps-from-the-attachment-menu // // See https://core.telegram.org/method/messages.getAttachMenuBots for reference. type MessagesGetAttachMenuBotsRequest struct { + // Hash for pagination, for more info click here¹ // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } @@ -161,9 +168,12 @@ func (g *MessagesGetAttachMenuBotsRequest) GetHash() (value int64) { } // MessagesGetAttachMenuBots invokes method messages.getAttachMenuBots#16fcc2cb returning error if any. +// Returns installed attachment menu bot web apps »¹ +// +// Links: +// 1. https://core.telegram.org/bots/webapps#launching-web-apps-from-the-attachment-menu // // See https://core.telegram.org/method/messages.getAttachMenuBots for reference. -// Can be used by bots. func (c *Client) MessagesGetAttachMenuBots(ctx context.Context, hash int64) (AttachMenuBotsClass, error) { var result AttachMenuBotsBox diff --git a/tg/tl_messages_get_custom_emoji_documents_gen.go b/tg/tl_messages_get_custom_emoji_documents_gen.go index dd22d6c7bb..406114f35e 100644 --- a/tg/tl_messages_get_custom_emoji_documents_gen.go +++ b/tg/tl_messages_get_custom_emoji_documents_gen.go @@ -32,10 +32,21 @@ var ( ) // MessagesGetCustomEmojiDocumentsRequest represents TL type `messages.getCustomEmojiDocuments#d9ab0f54`. +// Fetch info about custom emojis. +// Returns a list of documents¹ with the animated custom emoji in TGS format, and a +// documentAttributeCustomEmoji² attribute with the original emoji and info about the +// emoji stickerset this custom emoji belongs to. +// +// Links: +// 1. https://core.telegram.org/constructor/document +// 2. https://core.telegram.org/constructor/documentAttributeCustomEmoji // // See https://core.telegram.org/method/messages.getCustomEmojiDocuments for reference. type MessagesGetCustomEmojiDocumentsRequest struct { + // Custom emoji IDs from a messageEntityCustomEmoji¹. // + // Links: + // 1) https://core.telegram.org/constructor/messageEntityCustomEmoji DocumentID []int64 } @@ -174,6 +185,14 @@ func (g *MessagesGetCustomEmojiDocumentsRequest) GetDocumentID() (value []int64) } // MessagesGetCustomEmojiDocuments invokes method messages.getCustomEmojiDocuments#d9ab0f54 returning error if any. +// Fetch info about custom emojis. +// Returns a list of documents¹ with the animated custom emoji in TGS format, and a +// documentAttributeCustomEmoji² attribute with the original emoji and info about the +// emoji stickerset this custom emoji belongs to. +// +// Links: +// 1. https://core.telegram.org/constructor/document +// 2. https://core.telegram.org/constructor/documentAttributeCustomEmoji // // See https://core.telegram.org/method/messages.getCustomEmojiDocuments for reference. // Can be used by bots. diff --git a/tg/tl_messages_get_emoji_stickers_gen.go b/tg/tl_messages_get_emoji_stickers_gen.go index c02cde42df..d9559ca8db 100644 --- a/tg/tl_messages_get_emoji_stickers_gen.go +++ b/tg/tl_messages_get_emoji_stickers_gen.go @@ -32,10 +32,14 @@ var ( ) // MessagesGetEmojiStickersRequest represents TL type `messages.getEmojiStickers#fbfca18f`. +// Gets the list of currently installed custom emoji stickersets. // // See https://core.telegram.org/method/messages.getEmojiStickers for reference. type MessagesGetEmojiStickersRequest struct { + // Hash for pagination, for more info click here¹ // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } @@ -161,9 +165,9 @@ func (g *MessagesGetEmojiStickersRequest) GetHash() (value int64) { } // MessagesGetEmojiStickers invokes method messages.getEmojiStickers#fbfca18f returning error if any. +// Gets the list of currently installed custom emoji stickersets. // // See https://core.telegram.org/method/messages.getEmojiStickers for reference. -// Can be used by bots. func (c *Client) MessagesGetEmojiStickers(ctx context.Context, hash int64) (MessagesAllStickersClass, error) { var result MessagesAllStickersBox diff --git a/tg/tl_messages_get_featured_emoji_stickers_gen.go b/tg/tl_messages_get_featured_emoji_stickers_gen.go index 39846aa51b..4f039938d6 100644 --- a/tg/tl_messages_get_featured_emoji_stickers_gen.go +++ b/tg/tl_messages_get_featured_emoji_stickers_gen.go @@ -32,10 +32,14 @@ var ( ) // MessagesGetFeaturedEmojiStickersRequest represents TL type `messages.getFeaturedEmojiStickers#ecf6736`. +// Gets featured custom emoji stickersets. // // See https://core.telegram.org/method/messages.getFeaturedEmojiStickers for reference. type MessagesGetFeaturedEmojiStickersRequest struct { + // Hash for pagination, for more info click here¹ // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } @@ -161,9 +165,9 @@ func (g *MessagesGetFeaturedEmojiStickersRequest) GetHash() (value int64) { } // MessagesGetFeaturedEmojiStickers invokes method messages.getFeaturedEmojiStickers#ecf6736 returning error if any. +// Gets featured custom emoji stickersets. // // See https://core.telegram.org/method/messages.getFeaturedEmojiStickers for reference. -// Can be used by bots. func (c *Client) MessagesGetFeaturedEmojiStickers(ctx context.Context, hash int64) (MessagesFeaturedStickersClass, error) { var result MessagesFeaturedStickersBox diff --git a/tg/tl_messages_get_unread_reactions_gen.go b/tg/tl_messages_get_unread_reactions_gen.go index 33f73af98c..b02d40e733 100644 --- a/tg/tl_messages_get_unread_reactions_gen.go +++ b/tg/tl_messages_get_unread_reactions_gen.go @@ -314,7 +314,6 @@ func (g *MessagesGetUnreadReactionsRequest) GetMinID() (value int) { // Get unread reactions to messages you sent // // See https://core.telegram.org/method/messages.getUnreadReactions for reference. -// Can be used by bots. func (c *Client) MessagesGetUnreadReactions(ctx context.Context, request *MessagesGetUnreadReactionsRequest) (MessagesMessagesClass, error) { var result MessagesMessagesBox diff --git a/tg/tl_messages_prolong_web_view_gen.go b/tg/tl_messages_prolong_web_view_gen.go index 9435e27ac4..dc20b67153 100644 --- a/tg/tl_messages_prolong_web_view_gen.go +++ b/tg/tl_messages_prolong_web_view_gen.go @@ -384,7 +384,6 @@ func (p *MessagesProlongWebViewRequest) GetSendAs() (value InputPeerClass, ok bo // MessagesProlongWebView invokes method messages.prolongWebView#ea5fbcce returning error if any. // // See https://core.telegram.org/method/messages.prolongWebView for reference. -// Can be used by bots. func (c *Client) MessagesProlongWebView(ctx context.Context, request *MessagesProlongWebViewRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_rate_transcribed_audio_gen.go b/tg/tl_messages_rate_transcribed_audio_gen.go index 43c4c47cf1..92c983c161 100644 --- a/tg/tl_messages_rate_transcribed_audio_gen.go +++ b/tg/tl_messages_rate_transcribed_audio_gen.go @@ -32,16 +32,17 @@ var ( ) // MessagesRateTranscribedAudioRequest represents TL type `messages.rateTranscribedAudio#7f1d072f`. +// Rate transcribed voice message // // See https://core.telegram.org/method/messages.rateTranscribedAudio for reference. type MessagesRateTranscribedAudioRequest struct { - // + // Peer where the voice message was sent Peer InputPeerClass - // + // Message ID MsgID int - // + // Transcription ID TranscriptionID int64 - // + // Whether the transcription was correct Good bool } @@ -247,9 +248,9 @@ func (r *MessagesRateTranscribedAudioRequest) GetGood() (value bool) { } // MessagesRateTranscribedAudio invokes method messages.rateTranscribedAudio#7f1d072f returning error if any. +// Rate transcribed voice message // // See https://core.telegram.org/method/messages.rateTranscribedAudio for reference. -// Can be used by bots. func (c *Client) MessagesRateTranscribedAudio(ctx context.Context, request *MessagesRateTranscribedAudioRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_read_reactions_gen.go b/tg/tl_messages_read_reactions_gen.go index 92b4307e33..b44ef0b4e0 100644 --- a/tg/tl_messages_read_reactions_gen.go +++ b/tg/tl_messages_read_reactions_gen.go @@ -176,7 +176,6 @@ func (r *MessagesReadReactionsRequest) GetPeer() (value InputPeerClass) { // 1. https://core.telegram.org/api/reactions // // See https://core.telegram.org/method/messages.readReactions for reference. -// Can be used by bots. func (c *Client) MessagesReadReactions(ctx context.Context, peer InputPeerClass) (*MessagesAffectedHistory, error) { var result MessagesAffectedHistory diff --git a/tg/tl_messages_reorder_sticker_sets_gen.go b/tg/tl_messages_reorder_sticker_sets_gen.go index 74c089f48c..6f578c9ff7 100644 --- a/tg/tl_messages_reorder_sticker_sets_gen.go +++ b/tg/tl_messages_reorder_sticker_sets_gen.go @@ -43,7 +43,7 @@ type MessagesReorderStickerSetsRequest struct { Flags bin.Fields // Reorder mask stickersets Masks bool - // + // Reorder custom emoji stickersets Emojis bool // New stickerset order by stickerset IDs Order []int64 diff --git a/tg/tl_messages_request_simple_web_view_gen.go b/tg/tl_messages_request_simple_web_view_gen.go index c1c808fd02..ebdb91f346 100644 --- a/tg/tl_messages_request_simple_web_view_gen.go +++ b/tg/tl_messages_request_simple_web_view_gen.go @@ -264,7 +264,6 @@ func (r *MessagesRequestSimpleWebViewRequest) GetThemeParams() (value DataJSON, // MessagesRequestSimpleWebView invokes method messages.requestSimpleWebView#6abb2f73 returning error if any. // // See https://core.telegram.org/method/messages.requestSimpleWebView for reference. -// Can be used by bots. func (c *Client) MessagesRequestSimpleWebView(ctx context.Context, request *MessagesRequestSimpleWebViewRequest) (*SimpleWebViewResultURL, error) { var result SimpleWebViewResultURL diff --git a/tg/tl_messages_request_web_view_gen.go b/tg/tl_messages_request_web_view_gen.go index e2bcbcb9ba..3a4df550d1 100644 --- a/tg/tl_messages_request_web_view_gen.go +++ b/tg/tl_messages_request_web_view_gen.go @@ -536,7 +536,6 @@ func (r *MessagesRequestWebViewRequest) GetSendAs() (value InputPeerClass, ok bo // MessagesRequestWebView invokes method messages.requestWebView#91b15831 returning error if any. // // See https://core.telegram.org/method/messages.requestWebView for reference. -// Can be used by bots. func (c *Client) MessagesRequestWebView(ctx context.Context, request *MessagesRequestWebViewRequest) (*WebViewResultURL, error) { var result WebViewResultURL diff --git a/tg/tl_messages_send_web_view_data_gen.go b/tg/tl_messages_send_web_view_data_gen.go index 672b7fc934..b8d668fcbf 100644 --- a/tg/tl_messages_send_web_view_data_gen.go +++ b/tg/tl_messages_send_web_view_data_gen.go @@ -249,7 +249,6 @@ func (s *MessagesSendWebViewDataRequest) GetData() (value string) { // MessagesSendWebViewData invokes method messages.sendWebViewData#dc0242c8 returning error if any. // // See https://core.telegram.org/method/messages.sendWebViewData for reference. -// Can be used by bots. func (c *Client) MessagesSendWebViewData(ctx context.Context, request *MessagesSendWebViewDataRequest) (UpdatesClass, error) { var result UpdatesBox 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 6d5b0aba16..465b47efdd 100644 --- a/tg/tl_messages_send_web_view_result_message_gen.go +++ b/tg/tl_messages_send_web_view_result_message_gen.go @@ -194,6 +194,10 @@ func (s *MessagesSendWebViewResultMessageRequest) GetResult() (value InputBotInl // MessagesSendWebViewResultMessage invokes method messages.sendWebViewResultMessage#a4314f5 returning error if any. // +// Possible errors: +// +// 400 QUERY_ID_INVALID: The query ID is invalid. +// // 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) { diff --git a/tg/tl_messages_toggle_bot_in_attach_menu_gen.go b/tg/tl_messages_toggle_bot_in_attach_menu_gen.go index 01b481545b..ec01b9408a 100644 --- a/tg/tl_messages_toggle_bot_in_attach_menu_gen.go +++ b/tg/tl_messages_toggle_bot_in_attach_menu_gen.go @@ -32,12 +32,16 @@ var ( ) // MessagesToggleBotInAttachMenuRequest represents TL type `messages.toggleBotInAttachMenu#1aee33af`. +// Enable or disable web bot attachment menu »¹ +// +// Links: +// 1. https://core.telegram.org/bots/webapps#launching-web-apps-from-the-attachment-menu // // See https://core.telegram.org/method/messages.toggleBotInAttachMenu for reference. type MessagesToggleBotInAttachMenuRequest struct { - // + // Bot ID Bot InputUserClass - // + // Toggle Enabled bool } @@ -193,9 +197,12 @@ func (t *MessagesToggleBotInAttachMenuRequest) GetEnabled() (value bool) { } // MessagesToggleBotInAttachMenu invokes method messages.toggleBotInAttachMenu#1aee33af returning error if any. +// Enable or disable web bot attachment menu »¹ +// +// Links: +// 1. https://core.telegram.org/bots/webapps#launching-web-apps-from-the-attachment-menu // // See https://core.telegram.org/method/messages.toggleBotInAttachMenu for reference. -// Can be used by bots. func (c *Client) MessagesToggleBotInAttachMenu(ctx context.Context, request *MessagesToggleBotInAttachMenuRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_messages_transcribe_audio_gen.go b/tg/tl_messages_transcribe_audio_gen.go index 2d0874fc42..8e4aa88b89 100644 --- a/tg/tl_messages_transcribe_audio_gen.go +++ b/tg/tl_messages_transcribe_audio_gen.go @@ -32,12 +32,13 @@ var ( ) // MessagesTranscribeAudioRequest represents TL type `messages.transcribeAudio#269e9a49`. +// Transcribe voice message // // See https://core.telegram.org/method/messages.transcribeAudio for reference. type MessagesTranscribeAudioRequest struct { - // + // Peer ID where the voice message was sent Peer InputPeerClass - // + // Voice message ID MsgID int } @@ -193,9 +194,9 @@ func (t *MessagesTranscribeAudioRequest) GetMsgID() (value int) { } // MessagesTranscribeAudio invokes method messages.transcribeAudio#269e9a49 returning error if any. +// Transcribe voice message // // See https://core.telegram.org/method/messages.transcribeAudio for reference. -// Can be used by bots. func (c *Client) MessagesTranscribeAudio(ctx context.Context, request *MessagesTranscribeAudioRequest) (*MessagesTranscribedAudio, error) { var result MessagesTranscribedAudio diff --git a/tg/tl_notification_sound_gen.go b/tg/tl_notification_sound_gen.go index 31f49fc631..f53a90754e 100644 --- a/tg/tl_notification_sound_gen.go +++ b/tg/tl_notification_sound_gen.go @@ -32,6 +32,7 @@ var ( ) // NotificationSoundDefault represents TL type `notificationSoundDefault#97e8bebe`. +// Indicates the default notification sound should be used // // See https://core.telegram.org/constructor/notificationSoundDefault for reference. type NotificationSoundDefault struct { @@ -133,6 +134,7 @@ func (n *NotificationSoundDefault) DecodeBare(b *bin.Buffer) error { } // NotificationSoundNone represents TL type `notificationSoundNone#6f0c34df`. +// No notification sound should be used // // See https://core.telegram.org/constructor/notificationSoundNone for reference. type NotificationSoundNone struct { @@ -234,12 +236,14 @@ func (n *NotificationSoundNone) DecodeBare(b *bin.Buffer) error { } // NotificationSoundLocal represents TL type `notificationSoundLocal#830b9ae4`. +// Indicates a specific local notification sound should be used // // See https://core.telegram.org/constructor/notificationSoundLocal for reference. type NotificationSoundLocal struct { - // + // Notification sound title Title string - // + // Notification sound identifier (arbitrary data used by the client to identify a + // specific local notification sound) Data string } @@ -395,10 +399,14 @@ func (n *NotificationSoundLocal) GetData() (value string) { } // NotificationSoundRingtone represents TL type `notificationSoundRingtone#ff6c8049`. +// A specific previously uploaded notification sound should be used // // See https://core.telegram.org/constructor/notificationSoundRingtone for reference. type NotificationSoundRingtone struct { + // Document ID of notification sound uploaded using account.uploadRingtone¹ // + // Links: + // 1) https://core.telegram.org/method/account.uploadRingtone ID int64 } diff --git a/tg/tl_payment_form_method_gen.go b/tg/tl_payment_form_method_gen.go index c8e8aaf468..7e60271934 100644 --- a/tg/tl_payment_form_method_gen.go +++ b/tg/tl_payment_form_method_gen.go @@ -32,6 +32,7 @@ var ( ) // PaymentFormMethod represents TL type `paymentFormMethod#88f8f21b`. +// Represents a payment method // // See https://core.telegram.org/constructor/paymentFormMethod for reference. type PaymentFormMethod struct { diff --git a/tg/tl_payments_assign_app_store_transaction_gen.go b/tg/tl_payments_assign_app_store_transaction_gen.go index 2a7e9afb86..11f360b4e6 100644 --- a/tg/tl_payments_assign_app_store_transaction_gen.go +++ b/tg/tl_payments_assign_app_store_transaction_gen.go @@ -195,7 +195,6 @@ func (a *PaymentsAssignAppStoreTransactionRequest) GetPurpose() (value InputStor // PaymentsAssignAppStoreTransaction invokes method payments.assignAppStoreTransaction#80ed747d returning error if any. // // See https://core.telegram.org/method/payments.assignAppStoreTransaction for reference. -// Can be used by bots. func (c *Client) PaymentsAssignAppStoreTransaction(ctx context.Context, request *PaymentsAssignAppStoreTransactionRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_payments_assign_play_market_transaction_gen.go b/tg/tl_payments_assign_play_market_transaction_gen.go index d283d5bc2d..38218a2787 100644 --- a/tg/tl_payments_assign_play_market_transaction_gen.go +++ b/tg/tl_payments_assign_play_market_transaction_gen.go @@ -195,7 +195,6 @@ func (a *PaymentsAssignPlayMarketTransactionRequest) GetPurpose() (value InputSt // PaymentsAssignPlayMarketTransaction invokes method payments.assignPlayMarketTransaction#dffd50d3 returning error if any. // // See https://core.telegram.org/method/payments.assignPlayMarketTransaction for reference. -// Can be used by bots. func (c *Client) PaymentsAssignPlayMarketTransaction(ctx context.Context, request *PaymentsAssignPlayMarketTransactionRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_payments_can_purchase_premium_gen.go b/tg/tl_payments_can_purchase_premium_gen.go index 686bc68f12..a37c6d1506 100644 --- a/tg/tl_payments_can_purchase_premium_gen.go +++ b/tg/tl_payments_can_purchase_premium_gen.go @@ -168,7 +168,6 @@ func (c *PaymentsCanPurchasePremiumRequest) GetPurpose() (value InputStorePaymen // PaymentsCanPurchasePremium invokes method payments.canPurchasePremium#9fc19eb6 returning error if any. // // See https://core.telegram.org/method/payments.canPurchasePremium for reference. -// Can be used by bots. func (c *Client) PaymentsCanPurchasePremium(ctx context.Context, purpose InputStorePaymentPurposeClass) (bool, error) { var result BoolBox diff --git a/tg/tl_payments_export_invoice_gen.go b/tg/tl_payments_export_invoice_gen.go index b204203a38..b19e4329f4 100644 --- a/tg/tl_payments_export_invoice_gen.go +++ b/tg/tl_payments_export_invoice_gen.go @@ -32,10 +32,11 @@ var ( ) // PaymentsExportInvoiceRequest represents TL type `payments.exportInvoice#f91b065`. +// Export invoice // // See https://core.telegram.org/method/payments.exportInvoice for reference. type PaymentsExportInvoiceRequest struct { - // + // Invoice InvoiceMedia InputMediaClass } @@ -166,6 +167,11 @@ func (e *PaymentsExportInvoiceRequest) GetInvoiceMedia() (value InputMediaClass) } // PaymentsExportInvoice invokes method payments.exportInvoice#f91b065 returning error if any. +// Export invoice +// +// Possible errors: +// +// 400 MEDIA_INVALID: Media invalid. // // See https://core.telegram.org/method/payments.exportInvoice for reference. // Can be used by bots. diff --git a/tg/tl_payments_exported_invoice_gen.go b/tg/tl_payments_exported_invoice_gen.go index 1e1c9e2778..d60ff8d6b1 100644 --- a/tg/tl_payments_exported_invoice_gen.go +++ b/tg/tl_payments_exported_invoice_gen.go @@ -32,10 +32,11 @@ var ( ) // PaymentsExportedInvoice represents TL type `payments.exportedInvoice#aed0cbd9`. +// Exported invoice // // See https://core.telegram.org/constructor/payments.exportedInvoice for reference. type PaymentsExportedInvoice struct { - // + // Exported invoice URL URL string } diff --git a/tg/tl_payments_get_payment_form_gen.go b/tg/tl_payments_get_payment_form_gen.go index ff0744844a..3730887696 100644 --- a/tg/tl_payments_get_payment_form_gen.go +++ b/tg/tl_payments_get_payment_form_gen.go @@ -41,7 +41,7 @@ type PaymentsGetPaymentFormRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // + // Invoice Invoice InputInvoiceClass // A JSON object with the following keys, containing color theme information (integers, // RGB24) to pass to the payment provider, to apply in eventual verification pages: diff --git a/tg/tl_payments_payment_form_gen.go b/tg/tl_payments_payment_form_gen.go index babd8093df..8ad0610f84 100644 --- a/tg/tl_payments_payment_form_gen.go +++ b/tg/tl_payments_payment_form_gen.go @@ -54,11 +54,11 @@ type PaymentsPaymentForm struct { FormID int64 // Bot ID BotID int64 - // + // Form title Title string - // + // Description Description string - // + // Product photo // // Use SetPhoto and GetPhoto helpers. Photo WebDocumentClass @@ -81,7 +81,7 @@ type PaymentsPaymentForm struct { // // Use SetNativeParams and GetNativeParams helpers. NativeParams DataJSON - // + // Additional payment methods // // Use SetAdditionalMethods and GetAdditionalMethods helpers. AdditionalMethods []PaymentFormMethod diff --git a/tg/tl_payments_request_recurring_payment_gen.go b/tg/tl_payments_request_recurring_payment_gen.go index 54b6539305..4295fb2254 100644 --- a/tg/tl_payments_request_recurring_payment_gen.go +++ b/tg/tl_payments_request_recurring_payment_gen.go @@ -227,7 +227,6 @@ func (r *PaymentsRequestRecurringPaymentRequest) GetInvoiceMedia() (value InputM // PaymentsRequestRecurringPayment invokes method payments.requestRecurringPayment#146e958d returning error if any. // // See https://core.telegram.org/method/payments.requestRecurringPayment for reference. -// Can be used by bots. func (c *Client) PaymentsRequestRecurringPayment(ctx context.Context, request *PaymentsRequestRecurringPaymentRequest) (UpdatesClass, error) { var result UpdatesBox diff --git a/tg/tl_payments_send_payment_form_gen.go b/tg/tl_payments_send_payment_form_gen.go index 914684dda8..eb2c9cbfd7 100644 --- a/tg/tl_payments_send_payment_form_gen.go +++ b/tg/tl_payments_send_payment_form_gen.go @@ -43,7 +43,7 @@ type PaymentsSendPaymentFormRequest struct { Flags bin.Fields // Form ID FormID int64 - // + // Invoice Invoice InputInvoiceClass // ID of saved and validated order info¹ // diff --git a/tg/tl_payments_validate_requested_info_gen.go b/tg/tl_payments_validate_requested_info_gen.go index 38ea95dfb1..4119e7c9d6 100644 --- a/tg/tl_payments_validate_requested_info_gen.go +++ b/tg/tl_payments_validate_requested_info_gen.go @@ -43,7 +43,7 @@ type PaymentsValidateRequestedInfoRequest struct { Flags bin.Fields // Save order information to re-use it for future orders Save bool - // + // Invoice Invoice InputInvoiceClass // Requested order information Info PaymentRequestedInfo diff --git a/tg/tl_peer_notify_settings_gen.go b/tg/tl_peer_notify_settings_gen.go index 4e31402aa2..187324cd93 100644 --- a/tg/tl_peer_notify_settings_gen.go +++ b/tg/tl_peer_notify_settings_gen.go @@ -53,15 +53,15 @@ type PeerNotifySettings struct { // // Use SetMuteUntil and GetMuteUntil helpers. MuteUntil int - // + // Notification sound for the official iOS application // // Use SetIosSound and GetIosSound helpers. IosSound NotificationSoundClass - // + // Notification sound for the official android application // // Use SetAndroidSound and GetAndroidSound helpers. AndroidSound NotificationSoundClass - // + // Notification sound for other applications // // Use SetOtherSound and GetOtherSound helpers. OtherSound NotificationSoundClass diff --git a/tg/tl_phone_connection_gen.go b/tg/tl_phone_connection_gen.go index abf0fa8e51..4514106242 100644 --- a/tg/tl_phone_connection_gen.go +++ b/tg/tl_phone_connection_gen.go @@ -41,7 +41,7 @@ type PhoneConnection struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // + // Whether TCP should be used TCP bool // Endpoint ID ID int64 diff --git a/tg/tl_phone_save_call_log_gen.go b/tg/tl_phone_save_call_log_gen.go index 2e36cdd4cd..e51ffd3aee 100644 --- a/tg/tl_phone_save_call_log_gen.go +++ b/tg/tl_phone_save_call_log_gen.go @@ -32,12 +32,13 @@ var ( ) // PhoneSaveCallLogRequest represents TL type `phone.saveCallLog#41248786`. +// Save phone call debug information // // See https://core.telegram.org/method/phone.saveCallLog for reference. type PhoneSaveCallLogRequest struct { - // + // Phone call Peer InputPhoneCall - // + // Logs File InputFileClass } @@ -193,9 +194,9 @@ func (s *PhoneSaveCallLogRequest) GetFile() (value InputFileClass) { } // PhoneSaveCallLog invokes method phone.saveCallLog#41248786 returning error if any. +// Save phone call debug information // // See https://core.telegram.org/method/phone.saveCallLog for reference. -// Can be used by bots. func (c *Client) PhoneSaveCallLog(ctx context.Context, request *PhoneSaveCallLogRequest) (bool, error) { var result BoolBox diff --git a/tg/tl_premium_gift_option_gen.go b/tg/tl_premium_gift_option_gen.go index 1d158839f0..841a4b098b 100644 --- a/tg/tl_premium_gift_option_gen.go +++ b/tg/tl_premium_gift_option_gen.go @@ -32,6 +32,7 @@ var ( ) // PremiumGiftOption represents TL type `premiumGiftOption#74c34319`. +// Telegram Premium gift option // // See https://core.telegram.org/constructor/premiumGiftOption for reference. type PremiumGiftOption struct { @@ -40,11 +41,20 @@ type PremiumGiftOption struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // + // Duration of gifted Telegram Premium subscription Months int + // Three-letter ISO 4217 currency¹ code // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string + // 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 // BotURL string diff --git a/tg/tl_privacy_key_gen.go b/tg/tl_privacy_key_gen.go index bc4497b36f..8cc3e9d2c5 100644 --- a/tg/tl_privacy_key_gen.go +++ b/tg/tl_privacy_key_gen.go @@ -32,7 +32,7 @@ var ( ) // PrivacyKeyStatusTimestamp represents TL type `privacyKeyStatusTimestamp#bc2eab30`. -// Whether we can see the last online timestamp +// Whether we can see the last online timestamp of this user // // See https://core.telegram.org/constructor/privacyKeyStatusTimestamp for reference. type PrivacyKeyStatusTimestamp struct { @@ -338,7 +338,7 @@ func (p *PrivacyKeyPhoneCall) DecodeBare(b *bin.Buffer) error { } // PrivacyKeyPhoneP2P represents TL type `privacyKeyPhoneP2P#39491cc8`. -// Whether P2P connections in phone calls are allowed +// Whether P2P connections in phone calls with this user are allowed // // See https://core.telegram.org/constructor/privacyKeyPhoneP2P for reference. type PrivacyKeyPhoneP2P struct { @@ -749,7 +749,7 @@ func (p *PrivacyKeyPhoneNumber) DecodeBare(b *bin.Buffer) error { } // PrivacyKeyAddedByPhone represents TL type `privacyKeyAddedByPhone#42ffd42b`. -// Whether people can add you to their contact list by your phone number +// Whether this user can be added to our contact list by their phone number // // See https://core.telegram.org/constructor/privacyKeyAddedByPhone for reference. type PrivacyKeyAddedByPhone struct { @@ -851,6 +851,7 @@ func (p *PrivacyKeyAddedByPhone) DecodeBare(b *bin.Buffer) error { } // PrivacyKeyVoiceMessages represents TL type `privacyKeyVoiceMessages#697f414`. +// Whether the user accepts voice messages // // See https://core.telegram.org/constructor/privacyKeyVoiceMessages for reference. type PrivacyKeyVoiceMessages struct { diff --git a/tg/tl_sticker_set_covered_gen.go b/tg/tl_sticker_set_covered_gen.go index 9f857fe568..b0e44aaae0 100644 --- a/tg/tl_sticker_set_covered_gen.go +++ b/tg/tl_sticker_set_covered_gen.go @@ -199,7 +199,7 @@ func (s *StickerSetCovered) GetCover() (value DocumentClass) { } // StickerSetMultiCovered represents TL type `stickerSetMultiCovered#3407e51b`. -// Stickerset, with a specific stickers as preview +// Stickerset, with a specific set of stickers as preview // // See https://core.telegram.org/constructor/stickerSetMultiCovered for reference. type StickerSetMultiCovered struct { diff --git a/tg/tl_sticker_set_gen.go b/tg/tl_sticker_set_gen.go index 0eab0aea6c..0d601fd691 100644 --- a/tg/tl_sticker_set_gen.go +++ b/tg/tl_sticker_set_gen.go @@ -52,7 +52,7 @@ type StickerSet struct { Animated bool // Is this a video stickerpack Videos bool - // + // This is a custom emoji stickerset Emojis bool // When was this stickerset installed // @@ -78,7 +78,11 @@ type StickerSet struct { // // Use SetThumbVersion and GetThumbVersion helpers. ThumbVersion int + // Document ID of custom emoji thumbnail, fetch the document using messages + // getCustomEmojiDocuments¹ // + // Links: + // 1) https://core.telegram.org/method/messages.getCustomEmojiDocuments // // Use SetThumbDocumentID and GetThumbDocumentID helpers. ThumbDocumentID int64 diff --git a/tg/tl_update_gen.go b/tg/tl_update_gen.go index 18da5151e9..9c2f706523 100644 --- a/tg/tl_update_gen.go +++ b/tg/tl_update_gen.go @@ -6465,7 +6465,7 @@ type UpdateStickerSetsOrder struct { Flags bin.Fields // Whether the updated stickers are mask stickers Masks bool - // + // Whether the updated stickers are custom emoji stickers Emojis bool // New sticker order by sticker ID Order []int64 @@ -19463,6 +19463,12 @@ func (u *UpdateMessageReactions) GetReactions() (value MessageReactions) { } // UpdateAttachMenuBots represents TL type `updateAttachMenuBots#17b7a20b`. +// The list of added bot web apps »¹ has changed, use messages.getAttachMenuBots² to +// fetch the updated list. +// +// Links: +// 1. https://core.telegram.org/bots/webapps#launching-web-apps-from-the-attachment-menu +// 2. https://core.telegram.org/method/messages.getAttachMenuBots // // See https://core.telegram.org/constructor/updateAttachMenuBots for reference. type UpdateAttachMenuBots struct { @@ -19698,12 +19704,13 @@ func (u *UpdateWebViewResultSent) GetQueryID() (value int64) { } // UpdateBotMenuButton represents TL type `updateBotMenuButton#14b85813`. +// The menu button behavior for the specified bot has changed // // See https://core.telegram.org/constructor/updateBotMenuButton for reference. type UpdateBotMenuButton struct { - // + // Bot ID BotID int64 - // + // New menu button Button BotMenuButtonClass } @@ -19864,6 +19871,11 @@ func (u *UpdateBotMenuButton) GetButton() (value BotMenuButtonClass) { } // UpdateSavedRingtones represents TL type `updateSavedRingtones#74d8be99`. +// The list of saved notification sounds has changed, use account.getSavedRingtones¹ to +// fetch the new list. +// +// Links: +// 1. https://core.telegram.org/method/account.getSavedRingtones // // See https://core.telegram.org/constructor/updateSavedRingtones for reference. type UpdateSavedRingtones struct { @@ -19965,6 +19977,10 @@ func (u *UpdateSavedRingtones) DecodeBare(b *bin.Buffer) error { } // UpdateTranscribedAudio represents TL type `updateTranscribedAudio#84cd5a`. +// A pending transcription initiated with messages.transcribeAudio¹ was updated. +// +// Links: +// 1. https://core.telegram.org/method/messages.transcribeAudio // // See https://core.telegram.org/constructor/updateTranscribedAudio for reference. type UpdateTranscribedAudio struct { @@ -19973,15 +19989,19 @@ type UpdateTranscribedAudio struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields + // Whether this transcription is still pending and further updateTranscribedAudio¹ about + // it will be sent in the future. // + // Links: + // 1) https://core.telegram.org/constructor/updateTranscribedAudio Pending bool - // + // Peer of the transcribed message Peer PeerClass - // + // Transcribed message ID MsgID int - // + // Transcription ID TranscriptionID int64 - // + // Transcribed text Text string } diff --git a/tg/tl_user_full_gen.go b/tg/tl_user_full_gen.go index b1d7403b99..0b7b59f2d4 100644 --- a/tg/tl_user_full_gen.go +++ b/tg/tl_user_full_gen.go @@ -57,7 +57,7 @@ type UserFull struct { HasScheduled bool // Whether the user can receive video calls VideoCallsAvailable bool - // + // Whether this user doesn't allow sending voice messages in a private chat with them VoiceMessagesForbidden bool // User ID ID int64 @@ -106,11 +106,15 @@ type UserFull struct { // // Use SetPrivateForwardName and GetPrivateForwardName helpers. PrivateForwardName string - // + // A suggested default set of administrator rights for the bot, to be shown when adding + // the bot as admin to a supergroup (only a suggestion, the admin right set may be + // modified by the user before adding the bot as admin) // // Use SetBotGroupAdminRights and GetBotGroupAdminRights helpers. BotGroupAdminRights ChatAdminRights - // + // A suggested default set of administrator rights for the bot, to be shown when adding + // the bot as admin to a channel (only a suggestion, the admin right set may be modified + // by the user before adding the bot as admin) // // Use SetBotBroadcastAdminRights and GetBotBroadcastAdminRights helpers. BotBroadcastAdminRights ChatAdminRights diff --git a/tg/tl_user_gen.go b/tg/tl_user_gen.go index 4ffde15a74..ceceb0b1b6 100644 --- a/tg/tl_user_gen.go +++ b/tg/tl_user_gen.go @@ -212,7 +212,7 @@ type User struct { Fake bool // BotAttachMenu bool - // + // Whether this user is a Telegram Premium user Premium bool // AttachMenuEnabled bool