Layer 227
StoriesSendStory
Uploads a Telegram Story.
method
Users
Bots
Business
stories.sendStory#737fc2ec flags:# pinned:flags.2?true noforwards:flags.4?true fwd_modified:flags.7?true peer:InputPeer media:InputMedia media_areas:flags.5?Vector<MediaArea> caption:flags.0?string entities:flags.1?Vector<MessageEntity> privacy_rules:Vector<InputPrivacyRule> random_id:long period:flags.3?int fwd_from_id:flags.6?InputPeer fwd_from_story:flags.6?int albums:flags.8?Vector<int> = Updates;
Parameters
| Name | Type | Description |
|---|---|---|
| Pinned | flags .2? true | Whether to add the story to the profile automatically upon expiration. If not set, the story will only be added to the archive, see here for more info. |
| Noforwards | flags .4? true | If set, disables forwards, screenshots, and downloads. |
| FwdModified | flags .7? true | Set this flag when reposting stories with fwd_from_id + fwd_from_story, if the media was modified before reposting. |
| Peer | InputPeer | The peer to send the story as. |
| Media | InputMedia | The story media. |
| MediaAreas | flags .5? Vector < MediaArea > | Media areas associated to the story, see here for more info. |
| Caption | flags .0? string | Story caption. |
| Entities | flags .1? Vector < MessageEntity > | Message entities for styled text, if allowed by the stories_entities client configuration parameter. |
| PrivacyRules | Vector < InputPrivacyRule > | Privacy rules for the story, indicating who can or can't view the story. |
| RandomId | long | Unique client message ID required to prevent message resending. |
| Period | flags .3? int | Period after which the story is moved to archive (and to the profile if pinned is set), in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise. |
| FwdFromId | flags .6? InputPeer | If set, indicates that this story is a repost of story with ID fwd_from_story posted by the peer in fwd_from_id. |
| FwdFromStory | flags .6? int | If set, indicates that this story is a repost of story with ID fwd_from_story posted by the peer in fwd_from_id. |
| Albums | flags .8? Vector < int > | If set, adds the story to the specified albums. |
| Music | flags .9? InputDocument | If set, the audio track to play as background music for the story. |
Returns
UpdatesGogram Example
// StoriesSendStory - using Params struct result, err := client.StoriesSendStory(&tg.StoriesSendStoryParams{ Pinned: nil, Noforwards: nil, FwdModified: nil, Peer: &tg.InputPeerUser{UserID: int64(777000)}, Media: &tg.InputMediaPhoto{ID: &tg.InputPhoto{ID: int64(5678901234567890), AccessHash: int64(1234567890123456), FileReference: []byte{0x01}}}, MediaAreas: nil, Caption: "Hello, World!", Entities: nil, // ... }) if err != nil { // handle error } // result is *tg.Updates
Possible Errors
| Code | Type | Description |
|---|---|---|
| 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_CAPTION_TOO_LONG | The caption is too long. |
| 400 | MEDIA_EMPTY | The provided media object is invalid. |
| 400 | MEDIA_FILE_INVALID | The specified media file is invalid. |
| 400 | MEDIA_TYPE_INVALID | The specified media type cannot be used in stories. |
| 400 | MEDIA_VIDEO_STORY_MISSING | A non-story video cannot be repubblished as a story (emitted when trying to resend a non-story video as a story using input Document). |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | PHOTO_INVALID_DIMENSIONS | The photo dimensions are invalid. |
| 400 | PREMIUM_ACCOUNT_REQUIRED | A premium account is required to execute this action. |
| 400 | REACTION_INVALID | The specified reaction is invalid. |
| 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_PERIOD_INVALID | The specified story period is invalid for this account. |
| 400 | VENUE_ID_INVALID | The specified venue ID is invalid. |
| 400 | VIDEO_DURATION_INVALID | The duration of the specified video is invalid. |