You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a simple console tool for dumping message history from a Telegram chat into a __jsonl__, __csv__ or plain text file.
5
+
This is a simple console tool for dumping message history from a Telegram chat into a __jsonl__, __csv__ or plain __text__ file.
6
6
## Installation
7
7
**From sources:**
8
8
Fetch the latest sources with git:
@@ -26,7 +26,7 @@ Binaries for Linux, Windows and MacOS are available in [Releases](https://github
26
26
## Usage
27
27
28
28
Mandatory parameters are <chat_name> e.g. @Python, @CSharp or a title of a dialogue, as seen in the UI, and <phone_num> - a telephone number. A phone number is needed for authentication and will not be stored anywhere. After the first successful authorization it will create telegram_chat_dump.session file containing auth token. The information from this file is being reused in next runs. If this is not a desirable behaviour, use -cl flag to delete session file on exit.
29
-
>Note: You can use telegram dialogue user-friendly, multi-word title like so: `--chat=Moby & Docker CE. Русскоязычное сообщество` without extra quotes.
29
+
>Note: You can use telegram dialogue multi-word title like so: `--chat="Telegram Geeks"` with double quotes. However, when using multi-word title (rather than @channel_name), you need to join the channel first. Only then you will be able to dump it.
In both aforementioned cases, `telegram-messages-dump` will open the existing `C:\temp\xyz.txt` file and append the newer messages that were posted in the telegram chat since the message with the message with id 100500 was created.
65
-
>Note: There must be `=` sign between the `--continue` command name and integer message id.
66
-
>Note: In incremental mode without metafile, `--exp` and `--chat` must be specified explicitely as parameters. `--limit` setting has to be omitted.
65
+
>Note1: There must be `=` sign between the `--continue` command name and integer message id.
66
+
67
+
>Note2: In incremental mode without metafile, `--out`, `--exp` and `--chat` must be specified explicitely as parameters. `--limit` setting has to be omitted.
67
68
68
69
## Notes
69
70
70
71
* This tool relies on [Telethon](https://github.com/LonamiWebs/Telethon) - a Telegram client implementation in Python.
71
72
72
73
## Plugins
73
74
74
-
Output format is managed by *exporter* plugins. Currently there are two exporters available: **text**,**jsonl** and **csv**.
75
+
Output format is managed by *exporter* plugins. Currently there are two exporters available: **text**,**jsonl** and **csv**.
75
76
Exporters reside in `./exporters` subfolder.
76
77
Basically an exporter is a class that implements three methods:
77
78
-`format(...)` that extracts all necessary data from a message and stringifies it.
78
79
-`begin_final_file(...)` that allows an exporter to write a preamble to a resulting output file.
79
80
80
81
To use a custom exporter. Place you `.py` file with a class implementing those 3 methods into `./exporters` subfolder and specify its name in `--exp <exporter_name>` setting.
81
82
82
-
>Note: the class name **MUST** exactly match the file name of its `.py` file. This very same name is used as an argument for the `--exp` setting.
83
+
>Note1: the class name **MUST** exactly match the file name of its `.py` file. This very same name is used as an argument for the `--exp` setting.
83
84
84
85
>Note2: in `.vscode` subfolder you can find the default settings that I use for debugging this project.
0 commit comments