Site updated at 2016-08-08 12:49:03 UTC

This commit is contained in:
Travis CI 2016-08-08 12:49:03 +00:00
parent 95bcb92fa2
commit 2ae03982e9
22 changed files with 48 additions and 47 deletions

View file

@ -98,18 +98,7 @@
<li>The <code>chat_id</code> of an user.</li>
</ul>
<p>An easy way to get your chat ID is described below:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="keyword">import</span> <span class="include">telegram</span>
bot = telegram.Bot(token=<span class="string"><span class="delimiter">'</span><span class="content">YOUR_API_TOKEN</span><span class="delimiter">'</span></span>)
chat_id = bot.getUpdates()[-<span class="integer">1</span>].message.chat_id
print(chat_id)
</pre></div>
</div>
</div>
<p>Another way to retrieve your <code>chat_id</code> is visiting <a href="https://api.telegram.org/botYOUR_API_TOKEN/getUpdates">https://api.telegram.org/botYOUR_API_TOKEN/getUpdates</a>.</p>
<p>The quickest way to retrieve your <code>chat_id</code> is visiting <a href="https://api.telegram.org/botYOUR_API_TOKEN/getUpdates">https://api.telegram.org/botYOUR_API_TOKEN/getUpdates</a>.</p>
<p>The result set will include your chat ID as <code>id</code> in the <code>from</code> section:</p>
@ -129,6 +118,18 @@ print(chat_id)
</div>
</div>
<p>Another way to get your chat ID directly is described below:</p>
<div class="highlighter-coderay"><div class="CodeRay">
<div class="code"><pre><span class="keyword">import</span> <span class="include">telegram</span>
bot = telegram.Bot(token=<span class="string"><span class="delimiter">'</span><span class="content">YOUR_API_TOKEN</span><span class="delimiter">'</span></span>)
chat_id = bot.getUpdates()[-<span class="integer">1</span>].message.chat_id
print(chat_id)
<span class="integer">123456789</span>
</pre></div>
</div>
</div>
<p>To enable Telegram notifications in your installation, add the following to your <code>configuration.yaml</code> file:</p>
<div class="highlighter-coderay"><div class="CodeRay">