Telegram Dictation to Wiki

This funky little application was vibecoded by Graham Stewart as it the most common tool he used at that time.

This is the prompt I put into Sonnet 4.5:

So, I want to create a bot in the Godbot app in Telegram that I then add to the telegram chats between Me and Liam I want it to recognise audio files that are preceeded by a text saying Audio (Subject): then the audio I want that audio file to be saved in a folder on my iMac, which Macwhipser points to and automatically downloads the file and transcribes it. Then, I would like to somehow have that file placed in another folder once completed and this file is then somehow turned into markdown by you. Then I can simply go to that folder find the markdown and upload it. Eventually, we want a button on the federated wiki to say, "Upload content" and we can then select the markdown from that folder

---

# Audio-to-Wiki Pipeline ## Overview Telegram → iCloud Drive → MacWhisper → Markdown folder → Wiki The idea is that everything funnels through iCloud Drive as the central hub. This means it doesn't matter where you are or what device you're on when the audio gets shared — the bot saves it to iCloud, and your iMac picks it up from there automatically. --- ## Folder Structure (in iCloud Drive) ``` iCloud Drive/ ├── Audio_Inbox/ ← Bot drops raw audio files here ├── Transcripts_Raw/ ← MacWhisper outputs transcripts here └── Markdown_Ready/ ← Final markdown files, ready for wiki upload ``` Set these up once in Finder on your iMac. They'll sync to all your devices automatically. --- ## Step 1 — Telegram Bot A Python script running on your iMac that sits in the background and watches your Telegram chat with Liam. **What it does:** - Monitors the chat for a message matching the pattern `Audio (Subject):` followed by an audio file. - When it detects this pattern, it downloads the audio file from Telegram. - It saves the file into `iCloud Drive/Audio_Inbox/`, using the subject from your message as the filename (e.g. `Culture_Banks_Discussion.mp3`). **What you need:** - A Telegram bot token (created via @BotFather in Telegram — free, takes 2 minutes). - Python installed on your iMac. - The script running in the background (can be set to launch at login). **Note:** The bot needs to be added to the chat between you and Liam, and both of you need to have interacted with it at least once so it can read messages in that chat. --- ## Step 2 — MacWhisper (Watch Folder) MacWhisper Pro watches `iCloud Drive/Audio_Inbox/` and automatically transcribes anything that lands in it. **Setup:** - Open MacWhisper → Settings → Watch Folders. - Click "Add Watch Folder" and point it at `iCloud Drive/Audio_Inbox/`. - Toggle "Auto-Transcribe Watch Folder" on. - Set the export format to **plain text (.txt)**. - Set the export destination to `iCloud Drive/Transcripts_Raw/`. **What happens:** - A new audio file appears in `Audio_Inbox` (put there by the bot). - MacWhisper detects it, transcribes it automatically, and drops the `.txt` file into `Transcripts_Raw/`. - The filename carries through, so `Culture_Banks_Discussion.mp3` becomes `Culture_Banks_Discussion.txt`. **Note:** MacWhisper's Watch Folder feature is currently in beta and requires a Pro license. --- ## Step 3 — Raw Transcript to Markdown This is where the pipeline needs a human in the loop — for now. There are two ways to do it: **Option A — Manual (simplest, no extra setup):** - Go to `iCloud Drive/Transcripts_Raw/`. - Open the `.txt` file. - Paste the contents into a chat with Claude here. - Claude structures it, titles it, sections it, and outputs a `.md` file. - Save that file into `iCloud Drive/Markdown_Ready/`. **Option B — Automated (more setup, fully hands-off):** - A second Python script watches `Transcripts_Raw/` for new `.txt` files. - When one appears, it sends the contents to the Anthropic API (Claude). - Claude returns the structured markdown. - The script writes the `.md` file into `Markdown_Ready/`, using the same base filename. - This runs silently in the background — no action needed from you. Option B can be built once Option A is working and you're happy with the flow. --- ## Step 4 — Wiki Upload - Go to `iCloud Drive/Markdown_Ready/`. - Find your `.md` file. - Upload it to the federated wiki page. Eventually, the goal is to add an "Upload content" button directly on the wiki that lets you select a file from this folder. That's a separate piece of work, but having a consistent folder with consistently named markdown files is exactly the right setup for it. --- ## Summary of What Needs Building | Step | What | Effort | |------|------|--------| | Folder structure | Create 3 folders in iCloud Drive | 1 minute | | Telegram bot | Python script — I can write this for you | A few minutes to set up | | MacWhisper | Point Watch Folder at iCloud path, set export | 5 minutes in the app | | Markdown conversion | Manual for now, automated later | — | | Wiki upload button | Future work | — | --- ## What to Do Next 1. Create the three iCloud Drive folders. 2. Say the word and I'll write the Telegram bot script for you. 3. Point MacWhisper at `Audio_Inbox` using the setup steps above. 4. Test it — you and Liam send an audio file, and we see if it lands in the right place.