Thanks to visit codestin.com
Credit goes to github.com

Skip to content

lucmsilva651/AnimalPicBot

AnimalPicBot

NodeJS Telegram Docker

Live Preview: @justanotherdogchannel on Telegram.

🤓☝️ Self-host requirements

Important

You will only need all of them if you are not running it dockerized. Read "Deploying with Docker" for more information.

  • Node.js or Bun (latest is suggested)
  • A Telegram bot (create one at @BotFather)
  • Docker and Docker Compose (only required for Docker setup)

🚀 Running locally (non-Docker setup)

First, clone the repo with Git:

git clone https://github.com/ABOCN/AnimalPicBot

Next, inside the repository directory, create an .env file with some content, which you can see the example .env file to fill info with. To see the meaning of each one, see the Functions section.

After editing the file, save all changes and run the bot with bun start.

Tip

To deal with dependencies, just run bun install or bun i at any moment to install all of them.

🐋 Deploying with Docker

Important

Please complete the above steps to prepare your local copy for building.


Note

Using the -d flag when running causes the bot to run in the background. If you're just playing around or testing, you may not want to use this flag.

You can also run AnimalPicBot using Docker, which simplifies the setup process. Make sure you have Docker and Docker Compose installed.

📃 Using Docker Compose

  1. Make sure to setup your .env file first!

  2. Run the container

    docker compose up -d

🚀 Using Docker Run

If you prefer to use Docker directly, you can use these instructions instead.

  1. Make sure to setup your .env file first!

  2. Build the image

    docker build -t animalpicbot .
  3. Run the container

    docker run -d --name animalpicbot --restart unless-stopped -v $(pwd)/.env:/usr/src/app/.env:ro animalpicbot

⚙️ .env Functions

Important

Take care of your .env file, as it is so much important and needs to be secret (like your passwords), as anyone can do whatever they want to the bot with this token!

  • botToken: Put your bot token that you created at @BotFather.
  • cronSchedule: Schedule for sending images (default: every day at midnight)
  • channelId: Channel ID to send images to
  • ownerId: Your Telegram user ID
  • animalType: Set animal to send
  • maxRetries: Maximum number of retries after a crash

Contributors

Profile pictures of AnimalPicBot contributors Made with contrib.rocks.

License

BSD-3-Clause - 2024 ABOCN Contributors.

About

Parody/automation of @justanothercatchannel on Telegram

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors 2

  •  
  •