Table of Contents
This installation procedure assumes you are on a system with docker installed, with a supported CPU architecture.
Requirements
- Docker Engine
- An Internet connection
- A Telegram bot token (obtainable at @Botfather)
- A payment provider token (obtainable by connecting a provider with your bot)
Steps
-
Run a container using the project's Docker image:
# docker run --volume "$(pwd)/config:/etc/greed" --volume "$(pwd)/strings:/usr/src/greed/strings" --volume "$(pwd)/data:/var/lib/greed" ghcr.io/steffo99/greed -
Edit the configuration file
config.tomlthat was created in thestringsdirectory, adding your bot and payment tokens to it:# nano config/config.toml(Press Ctrl+X and then two times Enter to save and quit
nano.) -
Optional: customize the files in the
stringsfolder for custom messages. -
Start the bot:
python -OO core.py -
Open Telegram, and send a
/startcommand to your bot to be automatically promoted to 💼 Manager. -
Stop the bot by pressing Ctrl+C.
Running the bot
After the installation, to run the bot, you'll need to:
- Run its Docker container from the same directory you installed it from:
# docker run --volume "$(pwd)/config:/etc/greed" --volume "$(pwd)/strings:/usr/src/greed/strings" --volume "$(pwd)/data:/var/lib/greed" ghcr.io/steffo99/greed
Keep the bot running
If you want to keep the bot open even after you closed your terminal window, you'll need to pass the appropriate arguments to the docker command:
- Set the Docker container to always restart and to detach on successful start:
# docker run --detach --restart always --volume "$(pwd)/config:/etc/greed" --volume "$(pwd)/strings:/usr/src/greed/strings" --volume "$(pwd)/data:/var/lib/greed" ghcr.io/steffo99/greed
Updating
To update the bot, run the following commands:
-
Find the ID of the Docker container of the bot:
# docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES abcdefabcdef ghcr.io/steffo99/greed "python -OO core.py" 6 seconds ago Up Less than a second relaxed_hypatia -
Stop the Docker container of the bot:
# docker container stop abcdefabcdef -
Remove the Docker container of the bot:
# docker container rm abcdefabcdef -
Pull the latest Docker image of the bot:
# docker pull ghcr.io/steffo99/greed:latest -
Restart the bot with the newly downloaded image:
# docker run --detach --restart always --volume "$(pwd)/config:/etc/greed" --volume "$(pwd)/strings:/usr/src/greed/strings" --volume "$(pwd)/data:/var/lib/greed" ghcr.io/steffo99/greed
Please respect my free time and do not contact me on Telegram for anything related to Greed.
I will not answer, and you might be blocked.
Use the appropriate communication channels instead.