gustavoaca1997 / dogpicsbot

A simple Telegram bot that sends random dog pictures.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dog Pics Bot

A simple Telegram bot that sends random dog pictures (and more!).

You can test the bot on Telegram, just click here: @DogPicsBot.

Currently on v1.6.1. For more information about versions and changes, refer to the changelog.

Requirements

The bot runs on Python 3 (officially supporting Python 3.7, 3.8 and 3.9), and depends on packages listed on the requirements.txt file.

For ease of use, you should create a Python 3 virtual environment and then use pip in order to install the requirements, with the following command:

pip install -r requirements.txt

If you're more onto using conda, the following command will create an environment, activate it and install the requirements:

conda create -n dogpicsbot python=3.7
conda activate dogpicsbot
pip install -r requirements.txt

Installation

Simply clone this repository, fetch the requirements on a virtual environment as stated above and then set a new environment variable named DPB_TG_TOKEN with your Telegram bot API token. If you don't have a valid token, check this out.

Note that one feature (sending dog pictures freely through group chats on certain trigger words) requires the bot's Privacy Mode to be disabled (this can be done through @BotFather).

Usage

Run the following command on a command line. It will keep the polling thread running (therefore keeping your bot alive) until you kill the process.

python bot.py

Test

Unit tests for the bot are found in the tests.py file. You can run them after setting up your local environment with the following command:

pytest -v tests.py

What's next

The next features to be developed are:

  • Let the dog detect and reply to images that contain dogs in them (reference)
  • Replying "intelligently" to messages relating to dogs (e.g. emotions)
  • Explore the use of other dog pics APIs
  • Drop support for Python 3.7 and add support for Python 3.10
  • And more!

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A simple Telegram bot that sends random dog pictures.

License:MIT License


Languages

Language:Python 100.0%