Kkordik / GOnews

Auto channel GPT telegram bot. Parses from multiple channels, edits, refrases or translates with gpt and posts to your channel
0 stars 1 forks source link

GOnews

GOnews is a Telegram bot, that parses multiple telegram channels and on new post deletes from it tails (e.g. "Subscribe on @orig_channel") then rephrases it with GPT and adds new tail (e.g. "Subscribe on @my_channel") and sends it to the group of admins, where they can edit the message and forward it to their channel in one click.

Here is an example of an auto channel moderated by the bot: https://t.me/gaming_oasis_news_en

Installation and Setup

Step 1: Check for Git

Open a terminal or command prompt and run the following command:

git --version

If you don't see git version, install it:

sudo apt update
sudo apt-get install git

Step 2: Clone the Repository

First, you'll need to clone the repository from GitHub. Open a terminal or command prompt and run the following command:

git clone https://github.com/KKordik/GOnews.git

Step 3: Setup python environment

Navigate to the directory of the cloned repository:

cd GOnews

Create a new python environment:

python -m venv venvbot

Activate it:

source venvbot/bin/activate

Install required libraries:

pip install -r requirements.txt

Step 4: Run main.py and fill credentials

Firstly, make sure you've activated venvbot:

source venvbot/bin/activate

Then run main.py:

python main.py

Now, you will be asked:

Do you want to edit configuration.yaml interactively? (y/n):

If you've chosen to edit configuration.yaml, you will be asked to type a new value for each parameter or press enter to skip. Interactive config editing At least essential section must be filled. Where:

See about other parameters at CONFIG_GUIDE.md

Step 5: Log in to the bot account via the terminal

After editing configuration.yaml or having edited it previously, you will be asked to log in

Logging in

After succesful login Ctrl + C to stop the program

Step 6: Run in background

Leave from venvbot:

deactivate

Install screen

sudo apt install screen

Run new screen

screen

Run venvbot:

source venvbot/bin/activate

Run main.py:

python main.py

You will be asked, type n:

Do you want to edit configuration.yaml interactively? (y/n): n

Thats it! Now Ctrl + a + d to detatch the screen.

Now the bot will be running in the background

Available bot commands:

!send <to_chat_id> <from_chat_id> <message_id>
!channel <username> '<tails divided by comma without space>'