Metadata-Version: 2.4
Name: chatwire-telegram
Version: 0.1.0
Summary: Telegram integration plugin for chatwire
Author: Allen Bina
License: MIT License
        
        Copyright (c) 2026 Allen Bina
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/allenbina/chatwire-telegram
Project-URL: Issues, https://github.com/allenbina/chatwire-telegram/issues
Keywords: chatwire,telegram,imessage,bridge,plugin
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Chat
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: chatwire>=0.7.0
Requires-Dist: python-telegram-bot<22,>=21.0
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Dynamic: license-file

# chatwire-telegram

Telegram integration plugin for [chatwire](https://github.com/allenbina/chatwire) — the macOS iMessage relay bridge.

Renders inbound iMessage events into a single Telegram chat with `From <name>:` prefixes, and turns Telegram messages back into outbound iMessage sends (replies, `/send`, `/<contact-slug>`, photo uploads, inline whitelist search).

## Requirements

- chatwire >= 0.7.0 (installed and configured on macOS)
- Python >= 3.10
- A Telegram bot token from [@BotFather](https://t.me/BotFather)

## Install

```bash
# If chatwire is managed via pipx:
pipx inject chatwire chatwire-telegram

# Otherwise:
pip install chatwire-telegram
```

## Configure

Add to your `config.json` under `integrations.telegram`:

```json
{
  "integrations": {
    "telegram": {
      "enabled": true,
      "bot_token": "123456:abc...",
      "allowed_user_ids": [12345678]
    }
  }
}
```

The first `allowed_user_id` is the delivery target — all relayed iMessage events are sent to that Telegram chat.

Enable inline mode on your bot via BotFather (`/setinline`) for the whitelist search typeahead to work.

## Bot commands

| Command | Description |
|---|---|
| `/start` | Help / status |
| `/whoami` | Show your Telegram user_id and chat_id |
| `/handles` | Show relay scope (SELF handles + whitelist) |
| `/refresh_contacts` | Reload Contacts.app lookup |
| `/mute <duration>` | Silence relay (e.g. `30m`, `2h`, `1d`) |
| `/unmute` | Resume relay |
| `/send <handle> <body>` | Send an iMessage |
| `/whitelist` | List whitelisted handles and groups |
| `/whitelist_add <handle or name>` | Add to whitelist |
| `/whitelist_remove <handle or name>` | Remove from whitelist |
| `/check [handle or name]` | Show iMessage/SMS capability |
| `/<slug>` | Select a contact or group as sticky target |

## License

MIT
