Skip to content

Commit

Permalink
deploy: 3964c22
Browse files Browse the repository at this point in the history
  • Loading branch information
visciang committed Oct 5, 2024
1 parent be69f76 commit 23a35b9
Show file tree
Hide file tree
Showing 15 changed files with 155 additions and 155 deletions.
6 changes: 3 additions & 3 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.34.2">
<meta name="project" content="telegram v1.2.2">
<meta name="project" content="telegram v1.2.3">


<meta name="robots" content="noindex">

<title>404 — telegram v1.2.2</title>
<title>404 — telegram v1.2.3</title>
<link rel="stylesheet" href="dist/html-elixir-F2VRIOKR.css" />


Expand Down Expand Up @@ -52,7 +52,7 @@
telegram
</a>
<div class="sidebar-projectVersion" translate="no">
v1.2.2
v1.2.3
</div>
</div>
</div>
Expand Down
18 changes: 9 additions & 9 deletions Telegram.Api.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.34.2">
<meta name="project" content="telegram v1.2.2">
<meta name="project" content="telegram v1.2.3">


<title>Telegram.Api — telegram v1.2.2</title>
<title>Telegram.Api — telegram v1.2.3</title>
<link rel="stylesheet" href="dist/html-elixir-F2VRIOKR.css" />


Expand Down Expand Up @@ -50,7 +50,7 @@
telegram
</a>
<div class="sidebar-projectVersion" translate="no">
v1.2.2
v1.2.3
</div>
</div>
</div>
Expand Down Expand Up @@ -118,7 +118,7 @@ <h1>
</a>

<span translate="no">Telegram.Api</span>
<small class="app-vsn" translate="no">(telegram v1.2.2)</small>
<small class="app-vsn" translate="no">(telegram v1.2.3)</small>

</h1>

Expand Down Expand Up @@ -369,15 +369,15 @@ <h1 class="signature" translate="no">file(token, file_path)</h1>
</div>

<p>Download a file.</p><p>Reference: <a href="https://core.telegram.org/bots/api#file">BOT Api</a></p><p>Example:</p><pre><code class="makeup elixir" translate="no"><span class="c1"># send a photo</span><span class="w">
</span><span class="p" data-group-id="8401229344-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">res</span><span class="p" data-group-id="8401229344-1">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Telegram.Api</span><span class="o">.</span><span class="n">request</span><span class="p" data-group-id="8401229344-2">(</span><span class="n">token</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;sendPhoto&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">chat_id</span><span class="p">:</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">photo</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="8401229344-3">{</span><span class="ss">:file</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;example/photo.jpg&quot;</span><span class="p" data-group-id="8401229344-3">}</span><span class="p" data-group-id="8401229344-2">)</span><span class="w">
</span><span class="p" data-group-id="2532779287-1">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">res</span><span class="p" data-group-id="2532779287-1">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Telegram.Api</span><span class="o">.</span><span class="n">request</span><span class="p" data-group-id="2532779287-2">(</span><span class="n">token</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;sendPhoto&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">chat_id</span><span class="p">:</span><span class="w"> </span><span class="mi">12345</span><span class="p">,</span><span class="w"> </span><span class="ss">photo</span><span class="p">:</span><span class="w"> </span><span class="p" data-group-id="2532779287-3">{</span><span class="ss">:file</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;example/photo.jpg&quot;</span><span class="p" data-group-id="2532779287-3">}</span><span class="p" data-group-id="2532779287-2">)</span><span class="w">
</span><span class="c1"># pick the &#39;file_obj&#39; with the desired resolution</span><span class="w">
</span><span class="p" data-group-id="8401229344-4">[</span><span class="n">file_obj</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="bp">_</span><span class="p" data-group-id="8401229344-4">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">res</span><span class="p" data-group-id="8401229344-5">[</span><span class="s">&quot;photo&quot;</span><span class="p" data-group-id="8401229344-5">]</span><span class="w">
</span><span class="p" data-group-id="2532779287-4">[</span><span class="n">file_obj</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="bp">_</span><span class="p" data-group-id="2532779287-4">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">res</span><span class="p" data-group-id="2532779287-5">[</span><span class="s">&quot;photo&quot;</span><span class="p" data-group-id="2532779287-5">]</span><span class="w">
</span><span class="c1"># get the &#39;file_id&#39;</span><span class="w">
</span><span class="n">file_id</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">file_obj</span><span class="p" data-group-id="8401229344-6">[</span><span class="s">&quot;file_id&quot;</span><span class="p" data-group-id="8401229344-6">]</span><span class="w">
</span><span class="n">file_id</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">file_obj</span><span class="p" data-group-id="2532779287-6">[</span><span class="s">&quot;file_id&quot;</span><span class="p" data-group-id="2532779287-6">]</span><span class="w">

</span><span class="c1"># obtain the &#39;file_path&#39; to download the file identified by &#39;file_id&#39;</span><span class="w">
</span><span class="p" data-group-id="8401229344-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8401229344-8">%{</span><span class="s">&quot;file_path&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="n">file_path</span><span class="p" data-group-id="8401229344-8">}</span><span class="p" data-group-id="8401229344-7">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Telegram.Api</span><span class="o">.</span><span class="n">request</span><span class="p" data-group-id="8401229344-9">(</span><span class="n">token</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;getFile&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">file_id</span><span class="p">:</span><span class="w"> </span><span class="n">file_id</span><span class="p" data-group-id="8401229344-9">)</span><span class="w">
</span><span class="p" data-group-id="8401229344-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">file</span><span class="p" data-group-id="8401229344-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Telegram.Api</span><span class="o">.</span><span class="n">file</span><span class="p" data-group-id="8401229344-11">(</span><span class="n">token</span><span class="p">,</span><span class="w"> </span><span class="n">file_path</span><span class="p" data-group-id="8401229344-11">)</span></code></pre>
</span><span class="p" data-group-id="2532779287-7">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="2532779287-8">%{</span><span class="s">&quot;file_path&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="n">file_path</span><span class="p" data-group-id="2532779287-8">}</span><span class="p" data-group-id="2532779287-7">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Telegram.Api</span><span class="o">.</span><span class="n">request</span><span class="p" data-group-id="2532779287-9">(</span><span class="n">token</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;getFile&quot;</span><span class="p">,</span><span class="w"> </span><span class="ss">file_id</span><span class="p">:</span><span class="w"> </span><span class="n">file_id</span><span class="p" data-group-id="2532779287-9">)</span><span class="w">
</span><span class="p" data-group-id="2532779287-10">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="n">file</span><span class="p" data-group-id="2532779287-10">}</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Telegram.Api</span><span class="o">.</span><span class="n">file</span><span class="p" data-group-id="2532779287-11">(</span><span class="n">token</span><span class="p">,</span><span class="w"> </span><span class="n">file_path</span><span class="p" data-group-id="2532779287-11">)</span></code></pre>
</section>
</section>
<section class="detail" id="request/3">
Expand Down
8 changes: 4 additions & 4 deletions Telegram.Bot.Dispatch.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.34.2">
<meta name="project" content="telegram v1.2.2">
<meta name="project" content="telegram v1.2.3">


<title>Telegram.Bot.Dispatch — telegram v1.2.2</title>
<title>Telegram.Bot.Dispatch — telegram v1.2.3</title>
<link rel="stylesheet" href="dist/html-elixir-F2VRIOKR.css" />


Expand Down Expand Up @@ -50,7 +50,7 @@
telegram
</a>
<div class="sidebar-projectVersion" translate="no">
v1.2.2
v1.2.3
</div>
</div>
</div>
Expand Down Expand Up @@ -118,7 +118,7 @@ <h1>
</a>

<span translate="no">Telegram.Bot.Dispatch</span> <small>behaviour</small>
<small class="app-vsn" translate="no">(telegram v1.2.2)</small>
<small class="app-vsn" translate="no">(telegram v1.2.3)</small>

</h1>

Expand Down
8 changes: 4 additions & 4 deletions Telegram.Bot.Utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.34.2">
<meta name="project" content="telegram v1.2.2">
<meta name="project" content="telegram v1.2.3">


<title>Telegram.Bot.Utils — telegram v1.2.2</title>
<title>Telegram.Bot.Utils — telegram v1.2.3</title>
<link rel="stylesheet" href="dist/html-elixir-F2VRIOKR.css" />


Expand Down Expand Up @@ -50,7 +50,7 @@
telegram
</a>
<div class="sidebar-projectVersion" translate="no">
v1.2.2
v1.2.3
</div>
</div>
</div>
Expand Down Expand Up @@ -118,7 +118,7 @@ <h1>
</a>

<span translate="no">Telegram.Bot.Utils</span>
<small class="app-vsn" translate="no">(telegram v1.2.2)</small>
<small class="app-vsn" translate="no">(telegram v1.2.3)</small>

</h1>

Expand Down
30 changes: 15 additions & 15 deletions Telegram.Bot.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.34.2">
<meta name="project" content="telegram v1.2.2">
<meta name="project" content="telegram v1.2.3">


<title>Telegram.Bot — telegram v1.2.2</title>
<title>Telegram.Bot — telegram v1.2.3</title>
<link rel="stylesheet" href="dist/html-elixir-F2VRIOKR.css" />


Expand Down Expand Up @@ -50,7 +50,7 @@
telegram
</a>
<div class="sidebar-projectVersion" translate="no">
v1.2.2
v1.2.3
</div>
</div>
</div>
Expand Down Expand Up @@ -118,7 +118,7 @@ <h1>
</a>

<span translate="no">Telegram.Bot</span> <small>behaviour</small>
<small class="app-vsn" translate="no">(telegram v1.2.2)</small>
<small class="app-vsn" translate="no">(telegram v1.2.3)</small>

</h1>

Expand All @@ -130,27 +130,27 @@ <h1>
</a>
<span class="text">Example</span>
</h2>
<pre><code class="makeup elixir" translate="no"><span class="kd">defmodule</span><span class="w"> </span><span class="nc">HelloBot</span><span class="w"> </span><span class="k" data-group-id="4259028588-1">do</span><span class="w">
<pre><code class="makeup elixir" translate="no"><span class="kd">defmodule</span><span class="w"> </span><span class="nc">HelloBot</span><span class="w"> </span><span class="k" data-group-id="7553621780-1">do</span><span class="w">
</span><span class="kn">use</span><span class="w"> </span><span class="nc">Telegram.Bot</span><span class="w">

</span><span class="na">@impl</span><span class="w"> </span><span class="nc">Telegram.Bot</span><span class="w">
</span><span class="kd">def</span><span class="w"> </span><span class="nf">handle_update</span><span class="p" data-group-id="4259028588-2">(</span><span class="w">
</span><span class="p" data-group-id="4259028588-3">%{</span><span class="s">&quot;message&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="p" data-group-id="4259028588-4">%{</span><span class="s">&quot;text&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="s">&quot;/hello&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;chat&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="p" data-group-id="4259028588-5">%{</span><span class="s">&quot;id&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="n">chat_id</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;username&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="n">username</span><span class="p" data-group-id="4259028588-5">}</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;message_id&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="n">message_id</span><span class="p" data-group-id="4259028588-4">}</span><span class="p" data-group-id="4259028588-3">}</span><span class="p">,</span><span class="w">
</span><span class="kd">def</span><span class="w"> </span><span class="nf">handle_update</span><span class="p" data-group-id="7553621780-2">(</span><span class="w">
</span><span class="p" data-group-id="7553621780-3">%{</span><span class="s">&quot;message&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="p" data-group-id="7553621780-4">%{</span><span class="s">&quot;text&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="s">&quot;/hello&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;chat&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="p" data-group-id="7553621780-5">%{</span><span class="s">&quot;id&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="n">chat_id</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;username&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="n">username</span><span class="p" data-group-id="7553621780-5">}</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;message_id&quot;</span><span class="w"> </span><span class="p">=&gt;</span><span class="w"> </span><span class="n">message_id</span><span class="p" data-group-id="7553621780-4">}</span><span class="p" data-group-id="7553621780-3">}</span><span class="p">,</span><span class="w">
</span><span class="n">token</span><span class="w">
</span><span class="p" data-group-id="4259028588-2">)</span><span class="w"> </span><span class="k" data-group-id="4259028588-6">do</span><span class="w">
</span><span class="nc">Telegram.Api</span><span class="o">.</span><span class="n">request</span><span class="p" data-group-id="4259028588-7">(</span><span class="n">token</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;sendMessage&quot;</span><span class="p">,</span><span class="w">
</span><span class="p" data-group-id="7553621780-2">)</span><span class="w"> </span><span class="k" data-group-id="7553621780-6">do</span><span class="w">
</span><span class="nc">Telegram.Api</span><span class="o">.</span><span class="n">request</span><span class="p" data-group-id="7553621780-7">(</span><span class="n">token</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;sendMessage&quot;</span><span class="p">,</span><span class="w">
</span><span class="ss">chat_id</span><span class="p">:</span><span class="w"> </span><span class="n">chat_id</span><span class="p">,</span><span class="w">
</span><span class="ss">reply_to_message_id</span><span class="p">:</span><span class="w"> </span><span class="n">message_id</span><span class="p">,</span><span class="w">
</span><span class="ss">text</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;Hello </span><span class="si" data-group-id="4259028588-8">#{</span><span class="n">username</span><span class="si" data-group-id="4259028588-8">}</span><span class="s">!&quot;</span><span class="w">
</span><span class="p" data-group-id="4259028588-7">)</span><span class="w">
</span><span class="k" data-group-id="4259028588-6">end</span><span class="w">
</span><span class="ss">text</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;Hello </span><span class="si" data-group-id="7553621780-8">#{</span><span class="n">username</span><span class="si" data-group-id="7553621780-8">}</span><span class="s">!&quot;</span><span class="w">
</span><span class="p" data-group-id="7553621780-7">)</span><span class="w">
</span><span class="k" data-group-id="7553621780-6">end</span><span class="w">

</span><span class="kd">def</span><span class="w"> </span><span class="nf">handle_update</span><span class="p" data-group-id="4259028588-9">(</span><span class="c">_update</span><span class="p">,</span><span class="w"> </span><span class="c">_token</span><span class="p" data-group-id="4259028588-9">)</span><span class="w"> </span><span class="k" data-group-id="4259028588-10">do</span><span class="w">
</span><span class="kd">def</span><span class="w"> </span><span class="nf">handle_update</span><span class="p" data-group-id="7553621780-9">(</span><span class="c">_update</span><span class="p">,</span><span class="w"> </span><span class="c">_token</span><span class="p" data-group-id="7553621780-9">)</span><span class="w"> </span><span class="k" data-group-id="7553621780-10">do</span><span class="w">
</span><span class="c1"># ignore unknown updates</span><span class="w">

</span><span class="ss">:ok</span><span class="w">
</span><span class="k" data-group-id="4259028588-10">end</span><span class="w">
</span><span class="k" data-group-id="4259028588-1">end</span></code></pre>
</span><span class="k" data-group-id="7553621780-10">end</span><span class="w">
</span><span class="k" data-group-id="7553621780-1">end</span></code></pre>
</section>

</div>
Expand Down
Loading

0 comments on commit 23a35b9

Please sign in to comment.