# Telegram Guide

## What the Telegram Plugin Does

The Telegram plugin connects Maxy to a Telegram bot. Once set up, you can:

- Send messages to individuals or groups via Maxy ("Send a message to the team: standup in 10 minutes")
- Receive messages from your Telegram bot and have Maxy respond
- Use Telegram as a channel for Maxy notifications and alerts

## Setup

### Step 1: Create a Telegram bot

1. Open Telegram and search for `@BotFather`
2. Send `/newbot` and follow the prompts to choose a name and username
3. BotFather will give you a token — it looks like `123456789:ABCdefGhijklMNOpqrstUVWxyz`
4. Keep this token — you'll need it in the next step

### Step 2: Connect the plugin

Tell Maxy: "Set up Telegram" or "Configure the Telegram bot."

Maxy will ask for your bot token, then save it and activate the plugin. The bot is now connected.

### Step 3: Start the bot

In Telegram, open your bot and send `/start`. The bot is now active and listening.

## Sending Messages via Maxy

Once connected, tell Maxy to send messages on your behalf:

- "Send a Telegram message to John: I'll be 10 minutes late"
- "Message the team channel: server maintenance at 11pm"
- "Tell Sarah via Telegram that the proposal is ready"

Maxy needs a chat ID or username to target a specific person or group. For groups, you'll need to add the bot to the group first.

## Getting a Chat ID

To message a specific person or group, Maxy needs their chat ID. The easiest way:

1. Have the person (or yourself) send any message to your bot
2. Ask Maxy: "What chat IDs have messaged the bot recently?"
3. Maxy will look up the message history and show you the IDs

## Message History

Ask Maxy: "What messages has the bot received?" or "Show recent Telegram activity."

## Troubleshooting

**Bot not responding:** Check that the bot token is correct — ask Maxy "What's my Telegram bot token configured as?" and verify it matches BotFather.

**Can't send to a group:** The bot must be a member of the group. Add it via the group settings in Telegram, then try again.

**Messages not arriving:** Make sure the bot hasn't been blocked. Try sending `/start` to the bot directly.
