docs/search/search_index.json

1 line
62 KiB
JSON
Raw Normal View History

{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"index.html","title":"Insanus Mokrassar libraries home","text":"<p>Hello :) It is my libraries docs place and I glad to welcome you here. I hope, this documentation place will help you.</p>"},{"location":"index.html#projects","title":"Projects","text":"<ul> <li>TelegramBotAPI</li> </ul>"},{"location":"tgbotapi/dsls/keyboards.html","title":"Keyboards","text":"<p>In the telegram system there are two types of keyboards:</p> Reply Inline Keyboard for each user in the chat Keyboard linked to the certain message <p>Low-level way to create keyboard looks like in the next snippet:</p> <pre><code>ReplyKeyboardMarkup(\n matrix {\n row {\n add(SimpleKeyboardButton(\"Simple text\"))\n // ...\n }\n // ...\n }\n)\n</code></pre> <p>In case you wish to create inline keyboard, it will look like the same as for reply keyboard. But there is another way. The next snippet will create the same keyboard as on the screenshots above:</p> <pre><code>// reply keyboard\nreplyKeyboard {\n row {\n simpleButton(\"7\")\n simpleButton(\"8\")\n simpleButton(\"9\")\n simpleButton(\"*\")\n }\n row {\n simpleButton(\"4\")\n simpleButton(\"5\")\n simpleButton(\"6\")\n simpleButton(\"/\")\n }\n row {\n simpleButton(\"1\")\n simpleButton(\"2\")\n simpleButton(\"3\")\n simpleButton(\"-\")\n }\n row {\n simpleButton(\"0\")\n simpleButton(\".\")\n simpleButton(\"=\")\n simpleButton(\"+\")\n }\n}\n\n// inline keyboard\ninlineKeyboard {\n row {\n dataButton(\"Get random music\", \"random\")\n }\n row {\n urlButton(\"Send music to friends\", \"https://some.link\")\n }\n}\n</code></pre>"},{"location":"tgbotapi/dsls/live-location.html","title":"Live Location","text":"<p>Bot API allows you to send live locations and update them during their lifetime. In this library there are several ways to use this API:</p> <ul> <li>Directly via API calls (sendLiveLocation and editLiveLocation)</li> <li>startLiveLocation</li> <li>handleLiveLocation</li> </ul>"},{"location":"tgbotapi/dsls/live-location.html#sendlivelocation","title":"sendLiveLocation","text":"<p>In the Bot API there is no independent <code>sendLiveLocation</code> method, instead it is suggested to use sendLocation with setting up <code>live_period</code>. In this library in difference with original Bot API live location is special request. It was required because of in fact live locations and static locations are different types of location info and you as bot developer may interact with them differently.</p> <p>Anyway, in common case the logic looks like:</p> <ul> <li>Send sendLiveLocation</li> <li>Use editLiveLocation to change it during its lifetime</li> <li>Use stopLiveLocation to abort it before lifetime end</li> </ul>"},{"location":"tgbotapi/dsls/live-location.html#startlivelocation","title":"startLiveLocation","text":"<p>In difference with sendLiveLocation, startLiveLocation using LiveLocationProvider. With this provider you need not to handle chat and message ids and keep some other data for location changes. Instead, you workflow with provider will be next:</p> <ul> <li>startLiveLocation</li> <li>Use LiveLocationProvider#updateLocation to update location and optionally add inline keyboard</li> <li>Use LiveLocationProvider#close to abort live location before its end</li> </ul> <p>Besides, <code>LiveLocationProvider</code> contains different useful parameters about live location</p>"},{"location":"tgbotapi/dsls/live-location.html#handlelivelocation","title":"handleLiveLocation","text":"<p>This way of live locations handling is based on coroutines Flow and allow you to pass some external <code>Flow</code> with EditLiveLocationInfo. So, workflow:</p> <ul> <li>Create your own flow of locations. For example:</li> </ul> <pre><code>flow {\n var i = 0\n while (isActive) {\n val newInfo = EditLiveLocationInf