Telethon/methods/messages/search.html

41 lines
8.4 KiB
HTML
Raw Normal View History

2016-08-26 13:58:53 +03:00
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SearchRequest</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">Messages</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="search.html">SearchRequest</a></li></ul><h1>SearchRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
messages.search#29ee847a flags:# peer:<a href="../../types/input_peer.html">InputPeer</a> q:<a href="../../index.html#string">string</a> from_id:flags.0?<a href="../../types/input_peer.html">InputPeer</a> saved_peer_id:flags.2?<a href="../../types/input_peer.html">InputPeer</a> saved_reaction:flags.3?<a href="../../index.html#vector">Vector</a>&lt;<a href="../../types/reaction.html">Reaction</a>&gt; top_msg_id:flags.1?<a href="../../index.html#int">int</a> filter:<a href="../../types/messages_filter.html">MessagesFilter</a> min_date:<a href="../../index.html#date">date</a> max_date:<a href="../../index.html#date">date</a> offset_id:<a href="../../index.html#int">int</a> add_offset:<a href="../../index.html#int">int</a> limit:<a href="../../index.html#int">int</a> max_id:<a href="../../index.html#int">int</a> min_id:<a href="../../index.html#int">int</a> hash:<a href="../../index.html#long">long</a> = <a href="../../types/messages/messages.html">messages.Messages</a></pre><button onclick="cp('from telethon.tl.functions.messages import SearchRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/messages/messages.html">messages.Messages</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/messages/channel_messages.html">ChannelMessages</a></td><td><a href="../../constructors/messages/messages.html">Messages</a></td></tr><tr><td><a href="../../constructors/messages/messages_not_modified.html">MessagesNotModified</a></td><td><a href="../../constructors/messages/messages_slice.html">MessagesSlice</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>q</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>filter</b></td><td style="text-align:center"><a href="../../types/messages_filter.html">MessagesFilter</a></td><td></td></tr><tr><td><b>min_date</b></td><td style="text-align:center"><a href="../../index.html#date">date</a></td><td></td></tr><tr><td><b>max_date</b></td><td style="text-align:center"><a href="../../index.html#date">date</a></td><td></td></tr><tr><td><b>offset_id</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>add_offset</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>limit</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>max_id</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>min_id</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>hash</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr><tr><td><b>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>saved_peer_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>saved_reaction</b></td><td style="text-align:center"><a href="../../types/reaction.html">Reaction</a></td><td>This argument defaults to <code>None</code> and can be omitted. Otherwise, a <span clas
<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.messages.SearchRequest(
peer=<em>'username'</em>,
q=<em>'some string here'</em>,
filter=types.InputMessagesFilterPhotos(),
min_date=datetime.datetime(2018, 6, 25),
max_date=datetime.datetime(2018, 6, 25),
offset_id=42,
add_offset=0,
limit=100,
max_id=0,
min_id=0,
hash=-12398745604826,
from_id=<em>'username'</em>,
saved_peer_id=<em>'username'</em>,
saved_reaction=[types.ReactionEmoji(
emoticon=<em>'some string here'</em>
)],
top_msg_id=42
))
print(result.stringify())</pre></details><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>