Metadata-Version: 2.5
Name: techo-tool
Version: 1.3.0
Summary: Techo is a tool that executes provided functions and informs the user when it is finished over telegram.
Author: Julian Wuerch
License-Expression: MIT
License-File: LICENSE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: keyring
Requires-Dist: requests
Description-Content-Type: text/markdown

# Techo
Techo is a tool that executes provided functions and informs the user when it is finished over telegram.

## Setup
To use Techo two informations are required:

- Chat id
- API token

Both have to be provided to the tool the first time it is used, after which it will store the data on the device if allowed.

### 1. Create a Telegram Bot

Open Telegram and start a conversation with the official [@BotFather](https://t.me/BotFather).

Send:

```text
/newbot
```

BotFather will ask you for:

1. A **name** for your bot.
2. A **username** for your bot. The username must end in `bot`, e.g. `my_test_bot`.

After creating the bot, BotFather will give you an **API token**.

> **Important:** Keep this token secret. Anyone who has it can control your bot.

For more information, see the official [Telegram Bot Documentation](https://core.telegram.org/bots).

### 2. Start a Chat with Your Bot

Search for your newly created bot in Telegram and press **Start**, or send it any message.

The bot needs to receive a message before you can retrieve the chat ID.

### 3. Get the Chat ID

Once you've sent a message to your bot, open the following URL in your browser:

```text
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
```

Replace `<YOUR_BOT_TOKEN>` with the token you received from BotFather.

For example:

```text
https://api.telegram.org/bot123456789:ABC123.../getUpdates
```

Telegram will return a JSON response containing the message you sent. Look for:

```json
{
  "message": {
    "chat": {
      "id": 123456789,
      "type": "private"
    }
  }
}
```

The value:

```text
123456789
```

is your **Chat ID**.

The official [Telegram Bot API documentation](https://core.telegram.org/bots/api) contains more information about `getUpdates`.

#### If you get `"result": []`

Make sure you have:

1. Started the bot.
2. Sent the bot a message.
3. Used the correct bot token.

Then call `getUpdates` again.

### 4. Store the Credentials

You will typically need:

```text
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=123456789
```

> **Security:** Do not commit your bot token to Git or share it publicly.

### Useful Links

- [Telegram Bots](https://core.telegram.org/bots)
- [Telegram Bot API](https://core.telegram.org/bots/api)
- [BotFather](https://t.me/BotFather)