Telethon/methods/contacts/get_top_peers.html

36 lines
5.7 KiB
HTML
Raw Permalink 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>GetTopPeersRequest</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">Contacts</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="get_top_peers.html">GetTopPeersRequest</a></li></ul><h1>GetTopPeersRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?<a href="../../index.html#true">true</a> bots_pm:flags.1?<a href="../../index.html#true">true</a> bots_inline:flags.2?<a href="../../index.html#true">true</a> phone_calls:flags.3?<a href="../../index.html#true">true</a> forward_users:flags.4?<a href="../../index.html#true">true</a> forward_chats:flags.5?<a href="../../index.html#true">true</a> groups:flags.10?<a href="../../index.html#true">true</a> channels:flags.15?<a href="../../index.html#true">true</a> bots_app:flags.16?<a href="../../index.html#true">true</a> offset:<a href="../../index.html#int">int</a> limit:<a href="../../index.html#int">int</a> hash:<a href="../../index.html#long">long</a> = <a href="../../types/contacts/top_peers.html">contacts.TopPeers</a></pre><button onclick="cp('from telethon.tl.functions.contacts import GetTopPeersRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/contacts/top_peers.html">contacts.TopPeers</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/contacts/top_peers.html">TopPeers</a></td><td><a href="../../constructors/contacts/top_peers_disabled.html">TopPeersDisabled</a></td></tr><tr><td><a href="../../constructors/contacts/top_peers_not_modified.html">TopPeersNotModified</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>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>hash</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr><tr><td><b>correspondents</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>bots_pm</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>bots_inline</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>phone_calls</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>forward_users</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>forward_chats</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>groups</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>channels</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>bots_app</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></table><h1>Known RPC errors</h1><p>This request can cause 1 known error:</p><table><tr><td><code>TypesEmptyError</code></td><td>The types field is empty.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</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.contacts.GetTopPeersRequest(
offset=42,
limit=100,
hash=-12398745604826,
correspondents=<strong>True</strong>,
bots_pm=<strong>True</strong>,
bots_inline=<strong>True</strong>,
phone_calls=<strong>True</strong>,
forward_users=<strong>True</strong>,
forward_chats=<strong>True</strong>,
groups=<strong>True</strong>,
channels=<strong>True</strong>,
bots_app=<strong>True</strong>
))
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>