Autoreply
Autoreply is a cross-platform desktop application built on PyQt5 that allows users to connect their Telegram and VK accounts and automatically respond to incoming messages. The app offers a rich set of features, a verbose user-friendly GUI, and flexible configuration options.
https://github.com/user-attachments/assets/a30f7b83-7a8e-4daf-b064-9adbed9553b8
Table of Contents
- Features
- Prerequisites
- Installation
- Usage
-
Configuration
- Technical Details
Features
-
Verbose GUI: The app provides detailed explanations of all actions and settings within the GUI.
-
Multi-Account Support: Connect multiple Telegram and VK accounts, each running on separate threads.
-
Tray Functionality: Minimize the app to the system tray and close it entirely from the tray icon.
-
Enable/Disable Accounts: Enable or disable specific accounts at any time.
-
First Message Response: Option to respond only to the first message in a chat.
-
Automatic Chat Deletion: Automatically delete the chat after sending a response.
-
Attachment Support: Add attachments, such as images, to reply messages.
-
Proxy Configuration: Support for HTTP, SOCKS4, SOCKS5, and MTPROTO (Telegram only) proxies.
-
Logging: Logs all actions and errors to separate log files.
-
Google Sheets Logging: Send logs to Google Sheets for each automatic reply.
-
Telegram Bot Reporting: Use a Telegram bot to send reports about autoresponses to specified chats or channels at configurable intervals.
-
Multithreading: Efficiently handles tasks in parallel while maintaining a responsive GUI.
-
Cross-Platform Compatibility: Runs on any platform.
Prerequisites
Installation
-
Clone the repository:
git clone https://github.com/Qbject/autoreply.git
cd autoreply
-
Create a virtual environment:
python -m venv .venv
-
Activate the virtual environment:
-
Install dependencies:
pip install -r requirements.txt
-
Build the application using PyInstaller:
# On Windows
build.bat
# On macOS/Linux
./build.sh
-
The built app will be located in the dist/Autoreply
directory. This directory is portable and contains all necessary data.
Usage
-
Run the App:
python src/autoreply.py
-
Tray Functionality:
- Minimize the main window to the system tray.
- Close the app entirely using the tray icon.
-
Data Directory:
- All app data, including Telegram sessions, Google API credentials, logs, and settings, are stored in the
data
directory.
Configuration
Telegram Setup
-
Register your application on Telegram:
- Go to my.telegram.org.
- Log in with any Telegram account (preferably one you won't lose access to).
- Navigate to "API Development Tools" and create a new application.
- Choose "Desktop" as the platform and fill in the required fields.
- Copy the
api_id
and api_hash
provided.
-
In the Autoreply app, input the api_id
and api_hash
in the corresponding fields and save the settings.
VK Setup
- VK does not require additional setup beyond providing the VK App ID. The default is set to Kate Mobile's App ID, but you can change it if needed.
Google Sheets Logging
- Create a new project in the Google Developers Console.
- Enable the Google Sheets API and Drive API for the project.
- Create a new Service Account, generate a JSON key file, and download it.
- Rename the file to
google.json
and place it in the data
directory.
- Share two Google Sheets named "Autoreply TG" and "Autoreply VK" with write access to the service account.
Telegram Bot for Logging
- Create a new bot using BotFather.
- Copy the bot token and input it into the Autoreply app.
- Specify the IDs of users or channels to receive reports, which can be obtained using @myidbot and @raw_data_bot.
Technical Details
-
Telethon Library: Used for interfacing with the Telegram API.
-
PyQt5: Provides the graphical user interface.
-
Multithreading: Ensures efficient handling of multiple accounts and tasks.
-
Cross-Platform: Can be run on Windows, macOS, and Linux.
-
Qt Designer and UI Compilation:
- The app includes 2 UI files that can be edited using Qt Designer.
- These UI files can be compiled into Python files using the provided
compile-ui.bat
(for Windows) or compile-ui.sh
(for macOS/Linux) scripts.
License
This project is licensed under the MIT License.