Skip to main content

stories.sendStory

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.

func (c *Client) StoriesSendStory(ctx context.Context, request *StoriesSendStoryRequest) (UpdatesClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.StoriesSendStory(ctx, &tg.StoriesSendStoryRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})

Parameters

NameTypeRequiredDescription
PinnedboolWhether 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.
NoforwardsboolIf set, disables forwards, screenshots, and downloads.
FwdModifiedboolSet this flag when reposting stories with fwd_from_id+fwd_from_id, if the media was modified before reposting.
PeerInputPeerClassyesThe peer to send the story as.
MediaInputMediaClassyesThe story media.
MediaAreas[]MediaAreaClassMedia areas associated to the story, see here » for more info.
CaptionstringStory caption.
Entities[]MessageEntityClassMessage entities for styled text, if allowed by the stories_entities client configuration parameter ».
PrivacyRules[]InputPrivacyRuleClassyesPrivacy rules for the story, indicating who can or can't view the story.
RandomIDint64yesUnique client message ID required to prevent message resending.
PeriodintPeriod 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.
FwdFromIDInputPeerClassIf set, indicates that this story is a repost of story with ID fwd_from_story posted by the peer in fwd_from_id.
FwdFromStoryintIf set, indicates that this story is a repost of story with ID fwd_from_story posted by the peer in fwd_from_id.
Albums[]intIf set, adds the story to the specified albums.
MusicInputDocumentClassMusic field of StoriesSendStoryRequest.

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400BOOSTS_REQUIREDThe specified channel must first be boosted by its users in order to perform this action.
403BOT_ACCESS_FORBIDDENThe 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.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400IMAGE_PROCESS_FAILEDFailure while processing image.
400MEDIA_EMPTYThe provided media object is invalid.
400MEDIA_FILE_INVALIDThe specified media file is invalid.
400MEDIA_TYPE_INVALIDThe specified media type cannot be used in stories.
400MEDIA_VIDEO_STORY_MISSINGA non-story video cannot be repubblished as a story (emitted when trying to resend a non-story video as a story using inputDocument).
400PEER_ID_INVALIDThe provided peer id is invalid.
400PHOTO_INVALID_DIMENSIONSThe photo dimensions are invalid.
400PREMIUM_ACCOUNT_REQUIREDA premium account is required to execute this action.
400REACTION_INVALIDThe specified reaction is invalid.
400STORIES_TOO_MUCHYou 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.
400STORY_PERIOD_INVALIDThe specified story period is invalid for this account.
400VENUE_ID_INVALIDThe specified venue ID is invalid.

References