TooGooToGo-Bot is a tool designed to help you stay informed about the availability of your favorite stores on the Too Good To Go platform. It sends notifications, allowing you to quickly find and purchase food products before they disappear.
- Node.js (>=20.x.x)
git clone https://github.com/Achaak/toogoodtogo-bot.git
cd toogoodtogo-bot/
- Make a copy of the sample environment file and enter your parameters:
cp .env .env.local
- Open
.env.local
in a text editor and fill in the required information.
pnpm install
pnpm run build
pnpm start
To update the application, follow these steps:
-
Get the latest files:
git pull
-
Install any new dependencies:
pnpm install
-
Rebuild the project:
pnpm run build
Discord
To set up Discord notifications, access the .env.local
file in a text editor and provide the necessary value for the NOTIFICATIONS_DISCORD_ENABLED
parameter.
-
Create a new Discord server or use an existing one.
-
Create a new channel
-
Create a new webhook in the channel settings and copy the URL provided. See the Discord documentation for more information.
-
Open the
.env.local
file in a text editor and fill in theNOTIFICATIONS_DISCORD_WEBHOOK_URL
parameter.
Telegram
To set up Telegram notifications, access the .env.local
file in a text editor and provide the necessary value for the NOTIFICATIONS_TELEGRAM_ENABLED
parameter.
To configure the bot, open the .env.local
file in a text editor and specify the value for the NOTIFICATIONS_TELEGRAM_BOT_TOKEN
parameter.
-
Open a Telegram chat with BotFather and enter the /start command.
-
Select the /newbot command and follow the instructions to create a new bot. Take note of the token access provided.
-
Once your bot is created, multiple users can use it to receive notifications about their favorite stocks.
-
To start receiving notifications, send the /start command in your bot's conversation.
- /start: Starts Telegram notifications
- /stop: Stops Telegram notifications
- /help: Provides a list of usable commands
Desktop
To set up desktop notifications, access the .env.local
file in a text editor and provide the necessary value for the NOTIFICATIONS_DESKTOP_ENABLED
parameter.
Console
To set up console notifications, access the .env.local
file in a text editor and provide the necessary value for the NOTIFICATIONS_CONSOLE_ENABLED
parameter.
For clearing the console before each notification, open the .env.local
file in a text editor and specify the value for the NOTIFICATIONS_CONSOLE_CLEAR
parameter.
You can also run the application using Docker. Follow these steps:
-
Build the Docker image:
docker build . -t <your desired username>/togoodtogobot
-
Run the Docker image:
docker run -p 3000:3000 -d <your desired username>/togoodtogobot
PM2 allows you to install the bot on a server and receive notifications 24/7. Follow these steps:
-
Install PM2:
pnpm install pm2 -g
-
Start the server:
pm2 start start.sh
-
After logging in:
pm2 ls # to see the process_id pm2 attach your_process_id # Press Enter to submit your registration
See the CHANGELOG.md file for the change log.
This project is licensed under the MIT License.