Skip to content

Telegram bot for adding a Fyysikkospeksi related frame to user's profile picture.

License

Notifications You must be signed in to change notification settings

fyysikkokilta/fyysikkospeksi-taulubot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fyysikkospeksi Taulubot

Fyysikkospeksi logo

example workflow License: MIT Pictures: CC0-1.0

Telegram bot for adding a Fyysikkospeksi related frame to user's profile picture.

Forked from EinariTuukkanen/telegram-bots.

Code licensed under MIT license and pictures under CC0 1.0.

Deploying

Docker (recommended)

  1. Make a .env-file containing TAULUBOT_TOKEN and the corresponding token.
  2. Run Docker with
    docker run -d --restart unless-stopped --env-file .env ghcr.io/fyysikkokilta/fyysikkospeksi-taulubot:main
    Optionally, to override the frame images, you can mount a folder with your images to /taulu/taulubot/images. Mounting the current folder as read-only works as follows:
    docker run -d --volume ${pwd}:/taulu/taulubot/images:ro --env-file .env ghcr.io/fyysikkokilta/fyysikkospeksi-taulubot:main

Python

  1. Install dependencies w/
    pip install -e .
  2. Set the TAULUBOT_TOKEN environment variable
    export TAULUBOT_TOKEN=1234:abcedf
  3. Start the bot with python taulubot/main.py

Instead of 3. one can alternatively open a Python shell and run

from taulubot.main import main
main()

Development

  1. Clone the repo
  2. Install dependencies
    pip install -e .
    (optional) or the testing dependencies as well
    pip install -e .[test]
  3. Start coding!

Testing

Testing requires valid TAULUBOT_TOKEN_TEST, TELEGRAM_APP_ID, TELEGRAM_APP_HASH, and TELETHON_SESSION environment variables. Refer to this guide on how to generate them. After these are set up, tests can be run with:

pytest tests

Frames

Normal

Frame

Above (colorised)

Frame

About

Telegram bot for adding a Fyysikkospeksi related frame to user's profile picture.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Python 95.4%
  • Dockerfile 4.6%