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
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
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
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
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):
y
and press enter, if you haven't edited configuration.yaml
file manually beforen
and continue with Step 5If you've chosen to edit configuration.yaml
, you will be asked to type a new value for each parameter or press enter to skip.
At least essential
section must be filled. Where:
API_HASH
and API_ID
you can get here. I recommend not to use your main telegram account, but to create a new one (we will call it 'bot account').
ADMIN_CHAT_ID
is chat_id of the chat, for administrating your channel, create a new group and add there your bot account, you can use myidbot to get the chat_it.
CHANNEL_ID
is chat_id of your channel, you can use myidbot, simply forward a post from your channel to the bot. Remember that bot account must be an administrator in the channel to be able send posts.
See about other parameters at CONFIG_GUIDE.md
After editing configuration.yaml
or having edited it previously, you will be asked to log in
After succesful login Ctrl + C to stop the program
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
!send <to_chat_id> <from_chat_id> <message_id>
!channel <username> '<tails divided by comma without space>'