This Telegram bot provides functionalities to analyze chat statistics in Telegram. It allows you to upload a chat history in JSON format and obtain various statistical insights, including:
- Top 20 users by message count.
- Top 10 most frequently used words.
- Chat activity graph by day.
- Graph of the top 5 dates with the highest message count.
- Graph of the top 5 dates with the lowest message count.
-
Install the required dependencies by running the command
pip install -r requirements.txt
. -
Create a
config.json
file in the same directory as the bot's source code and add the following information:{ "bot_token": "YOUR_BOT_TOKEN" }
-
Start the bot by running the command
python main.py
in the command line. -
Find the created bot in Telegram and start it.
-
Upload the chat history file in JSON format using the
/upload
command. The file should be exported from Telegram and contain chat message information. -
The bot will process the uploaded chat history file and send you the analysis results in the form of graphs and text messages.
-
You can cancel the current operation at any time using the
/cancel
command.
/start
- Start the interaction with the bot./upload
- Upload a chat history file in JSON format./cancel
- Cancel the current operation.
The following dependencies are required to run this Telegram bot:
- python-telegram-bot
- matplotlib
- numpy
- statsmodels
Install them by running the command pip install -r requirements.txt
.
- Please ensure that your bot has access to chat messages and the permission to send messages.