[[Projects]]
"Grams" is a tiny script that adds messages from [Telegram](https://telegram.org/) to my daily Obsidian notes.
The name "grams" was inspired by [GramJS](https://gram.js.org/), the Node.js library used to access Telegram's API.
## Why Telegram?
After trying out many mobile note-taking techniques and apps, I found that a chat app, such as Telegram, was the overall most effective and efficient.
Chat apps are designed for rapid entry. Not only that, but they support rich-media uploads (photos and videos), everything is timestamped, and they have built-in search.
Unlike other chat apps like iMessage, Telegram has export options, either through their Telegram Desktop app (which I use for back-ups), or through their [API](https://core.telegram.org/).
## How it works
### Record
An [iOS Shortcut](https://support.apple.com/en-ca/guide/shortcuts/welcome/ios) records my speech and automatically transcribes it to text using the built-in dictation engine.
That message is then sent to myself on Telegram, known as "Saved messages".
![[2023-01-22 - Telegram shortcut workflow.jpg | 240]]
### Retrieve
The `grams` script is manually triggered to gather "Saved messages" from Telegram using [GramJS](https://gram.js.org/) to access Telegram's API.
`grams` is automatically run as part of other transcription workflows such as [[Thunder]] or [[Vox]].
### Note
`grams` formats the messages (adds a timestamp and tidies up the text) to prepare them to be merged into the associated daily note.
For example, if a message was recorded on 2023-01-05, `grams` would find the `2023-01-05.md` daily note to add the message to.
If there are existing log entries, (coming from [[Vox]] or anywhere else), `grams` will correctly insert the incoming messages from Telegram in the correct order to **preserve the timeline**.
## Source code
The source code is private and the link below is for personal reference only.
https://github.com/ItsJonQ/grams
## See also
- [[Thunder]]
- [[Vox]]