You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-29 22:27:42 +02:00
99 lines
2.6 KiB
Plaintext
Vendored
99 lines
2.6 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 8
|
|
description: Send location and other functions to work with Telegram in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
|
|
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Telegram]
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Send location
|
|
Sends location by geographic latitude and longitude to a chat or channel
|
|
|
|
|
|
|
|
`Function SendLocation(Val Token, Val ChatID, Val Latitude, Val Longitude, Val Keyboard = "") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Token | --token | String | ✔ | Bot token |
|
|
| ChatID | --chat | String, Number | ✔ | Target chat ID or ChatID*TopicID |
|
|
| Latitude | --lat | String, Number | ✔ | Geographic latitude |
|
|
| Longitude | --long | String, Number | ✔ | Geographic longitude |
|
|
| Keyboard | --keyboard | String, Structure Of KeyAndValue | ✖ | Keyboard. See FormKeyboardFromButtonArray |
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Telegram
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
Method at API documentation: [sendLocation](https://core.telegram.org/bots/api#sendlocation)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Token = "6129457865:AAFyzNYOAFbu...";
|
|
ChatID = "461699897";
|
|
ChannelID = "@testsichee";
|
|
Width = "48.87373649724122";
|
|
Longitude = "48.87373649724122";
|
|
|
|
Result = OPI_Telegram.SendLocation(Token, ChatID, Width, Longitude);
|
|
|
|
Result = OPI_Telegram.SendLocation(Token, ChannelID, Width, Longitude);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint telegram SendLocation \
|
|
--token "***" \
|
|
--chat "@testsichee" \
|
|
--lat "48.87373649724122" \
|
|
--long "48.87373649724122"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint telegram SendLocation ^
|
|
--token "***" ^
|
|
--chat "@testsichee" ^
|
|
--lat "48.87373649724122" ^
|
|
--long "48.87373649724122"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"ok": true,
|
|
"result": {
|
|
"message_id": 17197,
|
|
"from": {
|
|
"id": 6129457865,
|
|
"is_bot": true,
|
|
"first_name": "Бот Виталий",
|
|
"username": "sicheebot"
|
|
},
|
|
"chat": {
|
|
"id": 461699897,
|
|
"first_name": "Anton",
|
|
"last_name": "Titovets",
|
|
"username": "bayselonarrend",
|
|
"type": "private"
|
|
},
|
|
"date": 1760516504,
|
|
"location": {
|
|
"latitude": 48.873739,
|
|
"longitude": 48.873733
|
|
}
|
|
}
|
|
}
|
|
```
|