Giter VIP home page Giter VIP logo

stoscbot's Introduction

STOSCBot Build codecov

STOSC Bot

A Telegram bot (based on Pyrogram) to manage affairs of the St. Thomas Orthodox Syrian Cathedral (STOSC), Singapore.

image 02 markup_41332 (1)

Setup

Setup virtual environment
python -m venv .venv

Activate (on Windows):

.venv\Scripts\activate.bat

On Linux:

Change config.ini for server.

source .venv/bin/activate
nohup python3 run_stoscbot.py &
Dependencies

Install dependencies.

pip install -r requirements.txt

Upgrade dependencies

Upgrade dependencies, test locally and then freeze to requirements_pro.txt

pip install --upgrade pip
pip install --upgrade -r requirements.txt
pip freeze > requirements_pro.txt
Tests

Run Tests

Ensure pytest and pytest-asyncio is installed so that VSCode and find tests. Run the below command to run the tests.

pytest --cov=./ --cov-report=xml
coverage report

Deployment

We use GitHub Actions to deploy, but the basic deploy steps are lsited below

Deploy on a VM
  1. Update server timezone to local timezone
  2. Do not re-use a session file when deploying to a new instance. On a new isntance, delete any existing .session file and generate a new session file.
  3. Keep the .env and .session files in a ..\credentials\ directory. The deployment scripts will copy these files to the correct location.
  4. Copy the Google API keys to ~/.config/gspread/service_account.json. On Windows, it's at C:\Users\xxx\AppData\Roaming\gspread\
  5. Subsequently run headless as nohup python3 run_stoscbot.py &

Activity

Alt

TODO

Reference

stoscbot's People

Contributors

viper25 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.