This commit is contained in:
InsanusMokrassar 2024-05-29 10:32:24 +00:00
parent dc46ca1d49
commit 89c68ad618
4 changed files with 160 additions and 47 deletions

File diff suppressed because one or more lines are too long

View File

@ -2,232 +2,232 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://docs.inmo.dev/index.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/krontab/index.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/krontab/describing/krontabscheduler.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/krontab/describing/string-format.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/krontab/introduction/faq.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/krontab/introduction/how-to-use.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/krontab/introduction/including-in-project.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/kslog/index.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/kslog/logging.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/kslog/setup.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/micro_utils/index.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/micro_utils/colors.ktstemplate.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/micro_utils/colors.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/micro_utils/resources.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/micro_utils/startup.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/micro_utils/repos/index.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/micro_utils/repos/inmemory.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/navigation/index.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/navigation/getting-started.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/plagubot/index.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/plagubot/opportunities_out_of_the_box.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/services/index.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/index.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/faq.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/logs.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/dsls/keyboards.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/dsls/live-location.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/dsls/text.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/guides/keyboards.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/introduction/before-any-bot-project.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/introduction/first-bot.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/introduction/including-in-your-project.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/introduction/proxy-setup.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/logic/api-extensions.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/logic/behaviour-builder-with-fsm.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/logic/behaviour-builder.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/logic/exceptions-handling.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/logic/files-handling.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/logic/low-level-work-with-bots.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/logic/media-groups.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/logic/types-conversations.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/logic/updates-with-flows.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/updates/heroku.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/updates/long-polling.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/updates/updates-filters.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.inmo.dev/tgbotapi/updates/webhooks.html</loc>
<lastmod>2024-05-15</lastmod>
<lastmod>2024-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

View File

@ -1389,6 +1389,39 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#long-polling" class="md-nav__link">
<span class="md-ellipsis">
Long polling
</span>
</a>
<nav class="md-nav" aria-label="Long polling">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#long-polling-from-buildbehaviour" class="md-nav__link">
<span class="md-ellipsis">
Long polling from buildBehaviour
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#long-polling-from-the-result-of-behaviour-building" class="md-nav__link">
<span class="md-ellipsis">
Long polling from the result of behaviour building
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
@ -2404,6 +2437,39 @@
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#long-polling" class="md-nav__link">
<span class="md-ellipsis">
Long polling
</span>
</a>
<nav class="md-nav" aria-label="Long polling">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#long-polling-from-buildbehaviour" class="md-nav__link">
<span class="md-ellipsis">
Long polling from buildBehaviour
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#long-polling-from-the-result-of-behaviour-building" class="md-nav__link">
<span class="md-ellipsis">
Long polling from the result of behaviour building
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
@ -2492,6 +2558,53 @@
</span><span id="__span-2-9"><a id="__codelineno-2-9" name="__codelineno-2-9" href="#__codelineno-2-9"></a><span class="w"> </span><span class="p">}</span>
</span><span id="__span-2-10"><a id="__codelineno-2-10" name="__codelineno-2-10" href="#__codelineno-2-10"></a><span class="p">}</span>
</span></code></pre></div>
<h2 id="long-polling">Long polling<a class="headerlink" href="#long-polling" title="Permanent link">&para;</a></h2>
<p>In case you wish to start long polling, you have two options:</p>
<ul>
<li>Start long polling with <code>buildBehaviour</code> additional functions</li>
<li>Start long polling from using the result of <code>buildBehaviour</code></li>
</ul>
<div class="admonition note">
<p class="admonition-title">More info</p>
<p>More info about updates retrieving you may read at the <a href="../updates/long-polling.html">Long Polling</a> and <a href="../updates/webhooks.html">Webhooks</a>
articles</p>
</div>
<h3 id="long-polling-from-buildbehaviour">Long polling from <code>buildBehaviour</code><a class="headerlink" href="#long-polling-from-buildbehaviour" title="Permanent link">&para;</a></h3>
<p>With prepared bot:</p>
<div class="language-kotlin highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="kd">val</span><span class="w"> </span><span class="nv">bot</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">telegramBot</span><span class="p">(</span><span class="s">&quot;TOKEN&quot;</span><span class="p">)</span>
</span><span id="__span-3-2"><a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a>
</span><span id="__span-3-3"><a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="n">bot</span><span class="p">.</span><span class="na">buildBehaviourWithLongPolling</span><span class="w"> </span><span class="p">{</span>
</span><span id="__span-3-4"><a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="w"> </span><span class="n">onCommand</span><span class="p">(</span>
</span><span id="__span-3-5"><a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a><span class="w"> </span><span class="s">&quot;start&quot;</span><span class="p">,</span>
</span><span id="__span-3-6"><a id="__codelineno-3-6" name="__codelineno-3-6" href="#__codelineno-3-6"></a><span class="w"> </span><span class="n">requireOnlyCommandInMessage</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">true</span><span class="w"> </span><span class="c1">// it is default, but you can overwrite it with `requireOnlyCommandInMessage = false`</span>
</span><span id="__span-3-7"><a id="__codelineno-3-7" name="__codelineno-3-7" href="#__codelineno-3-7"></a><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
</span><span id="__span-3-8"><a id="__codelineno-3-8" name="__codelineno-3-8" href="#__codelineno-3-8"></a><span class="w"> </span><span class="c1">// ...</span>
</span><span id="__span-3-9"><a id="__codelineno-3-9" name="__codelineno-3-9" href="#__codelineno-3-9"></a><span class="w"> </span><span class="p">}</span>
</span><span id="__span-3-10"><a id="__codelineno-3-10" name="__codelineno-3-10" href="#__codelineno-3-10"></a><span class="p">}</span>
</span></code></pre></div>
<p>Without prepared bot:</p>
<div class="language-kotlin highlight"><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="n">telegramBotWithBehaviourAndLongPolling</span><span class="p">(</span><span class="s">&quot;TOKEN&quot;</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
</span><span id="__span-4-2"><a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a><span class="w"> </span><span class="n">onCommand</span><span class="p">(</span>
</span><span id="__span-4-3"><a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="w"> </span><span class="s">&quot;start&quot;</span><span class="p">,</span>
</span><span id="__span-4-4"><a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a><span class="w"> </span><span class="n">requireOnlyCommandInMessage</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">true</span><span class="w"> </span><span class="c1">// it is default, but you can overwrite it with `requireOnlyCommandInMessage = false`</span>
</span><span id="__span-4-5"><a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
</span><span id="__span-4-6"><a id="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a><span class="w"> </span><span class="c1">// ...</span>
</span><span id="__span-4-7"><a id="__codelineno-4-7" name="__codelineno-4-7" href="#__codelineno-4-7"></a><span class="w"> </span><span class="p">}</span>
</span><span id="__span-4-8"><a id="__codelineno-4-8" name="__codelineno-4-8" href="#__codelineno-4-8"></a><span class="p">}</span>
</span></code></pre></div>
<h3 id="long-polling-from-the-result-of-behaviour-building">Long polling from the result of behaviour building<a class="headerlink" href="#long-polling-from-the-result-of-behaviour-building" title="Permanent link">&para;</a></h3>
<div class="language-kotlin highlight"><pre><span></span><code><span id="__span-5-1"><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a><span class="kd">val</span><span class="w"> </span><span class="nv">bot</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">telegramBot</span><span class="p">(</span><span class="s">&quot;TOKEN&quot;</span><span class="p">)</span>
</span><span id="__span-5-2"><a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a><span class="kd">val</span><span class="w"> </span><span class="nv">rootContext</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">bot</span><span class="p">.</span><span class="na">buildBehaviour</span><span class="w"> </span><span class="p">{</span>
</span><span id="__span-5-3"><a id="__codelineno-5-3" name="__codelineno-5-3" href="#__codelineno-5-3"></a><span class="w"> </span><span class="n">onCommand</span><span class="p">(</span>
</span><span id="__span-5-4"><a id="__codelineno-5-4" name="__codelineno-5-4" href="#__codelineno-5-4"></a><span class="w"> </span><span class="s">&quot;start&quot;</span><span class="p">,</span>
</span><span id="__span-5-5"><a id="__codelineno-5-5" name="__codelineno-5-5" href="#__codelineno-5-5"></a><span class="w"> </span><span class="n">requireOnlyCommandInMessage</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">true</span><span class="w"> </span><span class="c1">// it is default, but you can overwrite it with `requireOnlyCommandInMessage = false`</span>
</span><span id="__span-5-6"><a id="__codelineno-5-6" name="__codelineno-5-6" href="#__codelineno-5-6"></a><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
</span><span id="__span-5-7"><a id="__codelineno-5-7" name="__codelineno-5-7" href="#__codelineno-5-7"></a><span class="w"> </span><span class="c1">// ...</span>
</span><span id="__span-5-8"><a id="__codelineno-5-8" name="__codelineno-5-8" href="#__codelineno-5-8"></a><span class="w"> </span><span class="p">}</span>
</span><span id="__span-5-9"><a id="__codelineno-5-9" name="__codelineno-5-9" href="#__codelineno-5-9"></a><span class="p">}</span>
</span><span id="__span-5-10"><a id="__codelineno-5-10" name="__codelineno-5-10" href="#__codelineno-5-10"></a>
</span><span id="__span-5-11"><a id="__codelineno-5-11" name="__codelineno-5-11" href="#__codelineno-5-11"></a><span class="n">bot</span><span class="p">.</span><span class="na">longPolling</span><span class="p">(</span><span class="n">rootContext</span><span class="p">)</span><span class="w"> </span><span class="c1">// start listening updates</span>
</span></code></pre></div>