Site updated at 2017-10-17 18:07:18 UTC
This commit is contained in:
parent
eca1ce3a65
commit
cd694ba30d
28 changed files with 93 additions and 67 deletions
|
@ -84,8 +84,30 @@
|
|||
<p>To retrieve your <code class="highlighter-rouge">chat_id</code>, contact any of the Telegram bots created for this purpose (@myidbot, @get_id_bot)</p>
|
||||
<p>The quickest way to retrieve your <code class="highlighter-rouge">chat_id</code> is visiting <a href="https://api.telegram.org/botYOUR_API_TOKEN/getUpdates">https://api.telegram.org/botYOUR_API_TOKEN/getUpdates</a> or to use <code class="highlighter-rouge">$ curl -X GET https://api.telegram.org/botYOUR_API_TOKEN/getUpdates</code>. Replace <code class="highlighter-rouge">YOUR_API_TOKEN</code> with your actual token.</p>
|
||||
<p>The result set will include your chat ID as <code class="highlighter-rouge">id</code> in the <code class="highlighter-rouge">from</code> section:</p>
|
||||
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="nt">"ok"</span><span class="p">:</span><span class="kc">true</span><span class="p">,</span><span class="nt">"result"</span><span class="p">:[{</span><span class="nt">"update_id"</span><span class="p">:</span><span class="mi">254199982</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"message"</span><span class="p">:{</span><span class="nt">"message_id"</span><span class="p">:</span><span class="mi">27</span><span class="p">,</span><span class="nt">"from"</span><span class="p">:{</span><span class="nt">"id"</span><span class="p">:</span><span class="mi">123456789</span><span class="p">,</span><span class="nt">"first_name"</span><span class="p">:</span><span class="s2">"YOUR_FIRST_NAME YOUR_NICK_NAME"</span><span class="p">,</span><span class="nt">"last_name"</span><span class="p">:</span><span class="s2">"YOUR_LAST_NAME"</span><span class="p">,</span><span class="nt">"username"</span><span class="p">:</span><span class="s2">"YOUR_NICK_NAME"</span><span class="p">},</span><span class="nt">"chat"</span><span class="p">:{</span><span class="nt">"id"</span><span class="p">:</span><span class="mi">123456789</span><span class="p">,</span><span class="nt">"first_name"</span><span class="p">:</span><span class="s2">"YOUR_FIRST_NAME YOUR_NICK_NAME"</span><span class="p">,</span><span class="nt">"last_name"</span><span class="p">:</span><span class="s2">"YOUR_LAST_NAME"</span><span class="p">,</span><span class="nt">"username"</span><span class="p">:</span><span class="s2">"YOUR_NICK_NAME"</span><span class="p">,</span><span class="nt">"type"</span><span class="p">:</span><span class="s2">"private"</span><span class="p">},</span><span class="nt">"date"</span><span class="p">:</span><span class="mi">1678292650</span><span class="p">,</span><span class="nt">"text"</span><span class="p">:</span><span class="s2">"test"</span><span class="p">}}]}</span><span class="w">
|
||||
<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nt">"ok"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"result"</span><span class="p">:</span><span class="w"> </span><span class="p">[{</span><span class="w">
|
||||
</span><span class="nt">"update_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">254199982</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nt">"message_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">27</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"from"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">123456789</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"first_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"YOUR_FIRST_NAME YOUR_NICK_NAME"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"last_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"YOUR_LAST_NAME"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"username"</span><span class="p">:</span><span class="w"> </span><span class="s2">"YOUR_NICK_NAME"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nt">"chat"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">123456789</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"first_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"YOUR_FIRST_NAME YOUR_NICK_NAME"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"last_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"YOUR_LAST_NAME"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"username"</span><span class="p">:</span><span class="w"> </span><span class="s2">"YOUR_NICK_NAME"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"private"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nt">"date"</span><span class="p">:</span><span class="w"> </span><span class="mi">1678292650</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nt">"text"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">}]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre>
|
||||
</div>
|
||||
<p>Another way to get your chat ID directly is described below. Start your Python interpreter from the command-line:</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue