mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
64 lines
8.0 KiB
HTML
64 lines
8.0 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title>SendStoryRequest</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
|
|
<script>
|
|
document.getElementById("style").href = "../../css/docs."
|
|
+ (localStorage.getItem("theme") || "light")
|
|
+ ".css";
|
|
</script>
|
|
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
|
|
rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Stories</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="send_story.html">SendStoryRequest</a></li></ul><h1>SendStoryRequest</h1><p>Both users and bots <strong>may</strong> be able to use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
|
|
stories.sendStory#e4e6694b flags:# pinned:flags.2?<a href="../../index.html#true">true</a> noforwards:flags.4?<a href="../../index.html#true">true</a> fwd_modified:flags.7?<a href="../../index.html#true">true</a> peer:<a href="../../types/input_peer.html">InputPeer</a> media:<a href="../../types/input_media.html">InputMedia</a> media_areas:flags.5?<a href="../../index.html#vector">Vector</a><<a href="../../types/media_area.html">MediaArea</a>> caption:flags.0?<a href="../../index.html#string">string</a> entities:flags.1?<a href="../../index.html#vector">Vector</a><<a href="../../types/message_entity.html">MessageEntity</a>> privacy_rules:<a href="../../index.html#vector">Vector</a><<a href="../../types/input_privacy_rule.html">InputPrivacyRule</a>> random_id:<a href="../../index.html#long">long</a> period:flags.3?<a href="../../index.html#int">int</a> fwd_from_id:flags.6?<a href="../../types/input_peer.html">InputPeer</a> fwd_from_story:flags.6?<a href="../../index.html#int">int</a> = <a href="../../types/updates.html">Updates</a></pre><button onclick="cp('from telethon.tl.functions.stories import SendStoryRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/updates.html">Updates</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/update_short.html">UpdateShort</a></td><td><a href="../../constructors/update_short_chat_message.html">UpdateShortChatMessage</a></td></tr><tr><td><a href="../../constructors/update_short_message.html">UpdateShortMessage</a></td><td><a href="../../constructors/update_short_sent_message.html">UpdateShortSentMessage</a></td></tr><tr><td><a href="../../constructors/updates.html">Updates</a></td><td><a href="../../constructors/updates_combined.html">UpdatesCombined</a></td></tr><tr><td><a href="../../constructors/updates_too_long.html">UpdatesTooLong</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>peer</b></td><td style="text-align:center"><a href="../../types/input_peer.html">InputPeer</a></td><td>Anything entity-like will work if the library can find its <code>Input</code> version (e.g., usernames, <code>Peer</code>, <code>User</code> or <code>Channel</code> objects, etc.).</td></tr><tr><td><b>media</b></td><td style="text-align:center"><a href="../../types/input_media.html">InputMedia</a></td><td></td></tr><tr><td><b>privacy_rules</b></td><td style="text-align:center"><a href="../../types/input_privacy_rule.html">InputPrivacyRule</a></td><td>A <span class="tooltip" title="Any iterable that supports len() will work too">list</span> must be supplied.</td></tr><tr><td><b>pinned</b></td><td style="text-align:center"><a href="../../index.html#true">flag</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr><tr><td><b>noforwards</b></td><td style="text-align:center"><a href="../../index.html#true">flag</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr><tr><td><b>fwd_modified</b></td><td style="text-align:center"><a href="../../index.html#true">flag</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr><tr><td><b>media_areas</b></td><td style="text-align:center"><a href="../../types/media_area.html">MediaArea</a></td><td>This argument defaults to <code>None</code> and can be omitted. Otherwise, a <span class="tooltip" title="Any iterable that supports len() will work too">list</span> must be supplied.</td></tr><tr><td><b>caption</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr><tr><td><b>entities</b></td><td style="text-align:center"><a href="../../types/message_entity.html">MessageEntity</a></td><td>This argument defaults to <code>None</code> and can be omitted. Otherwise, a <span class="tooltip" title="Any iterable that supports len() will work too">list</span> must be supplied.</td></tr><tr><td><b>random_id</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td>If left unspecified, it will be inferred automatically.</td></tr><tr><td><b>period</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr><tr><td><b>fwd_from_id</b></td><td style="text-align:center"><a href="../../types/input_peer.html">InputPeer</a></td><td>This argument defaults to <code>None</code> and can be omitted. Anything entity-like will work if the library can find its <code>Input</code> version (e.g., usernames, <code>Peer</code>, <code>User</code> or <code>Channel</code> objects, etc.).</td></tr><tr><td><b>fwd_from_story</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr></table><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
|
|
<strong>from</strong> telethon <strong>import</strong> functions, types
|
|
|
|
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
|
|
result = client(functions.stories.SendStoryRequest(
|
|
peer=<em>'username'</em>,
|
|
media=types.InputMediaUploadedPhoto(
|
|
file=client.upload_file(<em>'/path/to/file.jpg'</em>),
|
|
spoiler=<strong>True</strong>,
|
|
stickers=[types.InputDocument(
|
|
id=-12398745604826,
|
|
access_hash=-12398745604826,
|
|
file_reference=<em>b'arbitrary\x7f data \xfa here'</em>
|
|
)],
|
|
ttl_seconds=42
|
|
),
|
|
privacy_rules=[types.InputPrivacyValueAllowContacts()],
|
|
pinned=<strong>True</strong>,
|
|
noforwards=<strong>True</strong>,
|
|
fwd_modified=<strong>True</strong>,
|
|
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=<em>'My awesome title'</em>,
|
|
address=<em>'some string here'</em>,
|
|
provider=<em>'some string here'</em>,
|
|
venue_id=<em>'some string here'</em>,
|
|
venue_type=<em>'some string here'</em>
|
|
)],
|
|
caption=<em>'some string here'</em>,
|
|
period=42,
|
|
fwd_from_id=<em>'username'</em>,
|
|
fwd_from_story=42
|
|
))
|
|
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html> |