In reality it forwards all incoming text messages to your contact's chat in Telegram, effectively creating a sequential log of all incoming messages. The authenticity of the messages relies on fwd_from header, which is saved and shown whenever the message is forwarded.
TODO: Add some sort of hash-based way to sort the messages, add a way to configure exclusions. Add checking freshly edited messages for tags. Process multiple tags in one messages (currently doesn't work).
The script also parses all messages that are outgoing and have just been delivered. If the message contains text inside ~ ~ tags, the script replaces it with its ̶̶̶s̶̶t̶̶r̶̶i̶̶k̶̶e̶̶s̶̶ ̶̶t̶̶h̶̶r̶̶o̶̶u̶̶g̶̶h̶̶ equivalent by editing the message for you. Currently there is no convenient way to avoid the (edited) mark.
ADDED: Support for UTF8 strikethrough—doesn't properly handle UTF16 as of right now.
TODO: Add more fancy stuff! Add more aliases. Figure out lua_register_function.
Make sure your luarocks is set up to use Lua >= 5.2.
You need the utf8 rock for UTF8 support:
luarocks install utf8
The script uses tdcli-1222 or higher from valtman.name/telegram-cli.
On Telegram, message @JsonDumpBot and find out your chat.id; add it to the script.
chmod +x ./tdcli-1222 ./tdcli-1222 -s script.lua
(You will need to fully authorize yourself the first time this runs.)
TODO: Switch to MadelineProto!
Binary tdcli-1222 included for build compatibility reasons only, please get a binary you trust.