SendStoryRequest
Both users and bots may be able to use this request. See code examples.
---functions--- stories.sendStory#e4e6694b 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 = Updates
Returns
Updates |
This type can be an instance of either:
UpdateShort | UpdateShortChatMessage |
UpdateShortMessage | UpdateShortSentMessage |
Updates | UpdatesCombined |
UpdatesTooLong |
Parameters
peer | InputPeer | Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer , User or Channel objects, etc.). |
media | InputMedia | |
privacy_rules | InputPrivacyRule | A list must be supplied. |
pinned | flag | This argument defaults to None and can be omitted. |
noforwards | flag | This argument defaults to None and can be omitted. |
fwd_modified | flag | This argument defaults to None and can be omitted. |
media_areas | MediaArea | This argument defaults to None and can be omitted. Otherwise, a list must be supplied. |
caption | string | This argument defaults to None and can be omitted. |
entities | MessageEntity | This argument defaults to None and can be omitted. Otherwise, a list must be supplied. |
random_id | long | If left unspecified, it will be inferred automatically. |
period | int | This argument defaults to None and can be omitted. |
fwd_from_id | InputPeer | This argument defaults to None and can be omitted. Anything entity-like will work if the library can find its Input version (e.g., usernames, Peer , User or Channel objects, etc.). |
fwd_from_story | int | This argument defaults to None and can be omitted. |
Known RPC errors
This request can't cause any RPC error as far as we know.
Example
from telethon.sync import TelegramClient from telethon import functions, types with TelegramClient(name, api_id, api_hash) as client: result = client(functions.stories.SendStoryRequest( peer='username', media=types.InputMediaUploadedPhoto( file=client.upload_file('/path/to/file.jpg'), spoiler=True, stickers=[types.InputDocument( id=-12398745604826, access_hash=-12398745604826, file_reference=b'arbitrary\x7f data \xfa here' )], ttl_seconds=42 ), privacy_rules=[types.InputPrivacyValueAllowContacts()], pinned=True, noforwards=True, fwd_modified=True, media_areas=[types.MediaAreaVenue( coordinates=types.MediaAreaCoordinates( x=7.13, y=7.13, w=7.13, h=7.13, rotation=7.13, radius=7.13 ), geo=types.GeoPoint( long=7.13, lat=7.13, access_hash=-12398745604826, accuracy_radius=42 ), title='My awesome title', address='some string here', provider='some string here', venue_id='some string here', venue_type='some string here' )], caption='some string here', period=42, fwd_from_id='username', fwd_from_story=42 )) print(result.stringify())