Metadata-Version: 2.1
Name: les-louisdelatech
Version: 0.2.2
Summary: LouisDeLaTech is a discord bot manager for Lyon e-Sport
Home-page: https://github.com/lyon-esport/LouisDeLaTech
License: CeCILL
Keywords: google,discord
Author: Ludovic Ortega
Author-email: ludovic.ortega@lyon-esport.fr
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Utilities
Requires-Dist: Jinja2 (>=3.1.2,<4.0.0)
Requires-Dist: aiosqlite (>=0.17.0,<0.18.0)
Requires-Dist: cryptography (>=37.0.4,<39.0.0)
Requires-Dist: discord.py (>=1.7.3,<2.0.0)
Requires-Dist: google-api-python-client (>=2.52.0,<3.0.0)
Requires-Dist: google-auth-httplib2 (>=0.1.0,<0.2.0)
Requires-Dist: httpx (>=0.23.0,<0.24.0)
Requires-Dist: pyotp (>=2.6.0,<3.0.0)
Requires-Dist: sentry-sdk (>=1.6.0,<2.0.0)
Requires-Dist: tomli (>=2.0.1,<3.0.0)
Requires-Dist: tortoise-orm (>=0.19.1,<0.20.0)
Project-URL: Repository, https://github.com/lyon-esport/LouisDeLaTech
Description-Content-Type: text/markdown

# LouisDeLaTech is a discord bot manager for Lyon e-Sport

[![PyPI](https://img.shields.io/pypi/v/les-louisdelatech.svg)](https://pypi.python.org/pypi/les-louisdelatech)
[![PyPI versions](https://img.shields.io/pypi/pyversions/les-louisdelatech.svg)](https://pypi.python.org/pypi/les-louisdelatech)
[![Python test](https://github.com/lyon-esport/LouisDeLaTech/actions/workflows/test.yml/badge.svg)](https://github.com/lyon-esport/LouisDeLaTech/actions/workflows/test.yml)
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

## Requirements

- Python (check version in setup.py)

## Setup

### Discord

Create a [discord bot](https://discord.com/developers/applications) and get the token

### Google

- Create a [google project](https://console.cloud.google.com/iam-admin)
- Create a [google service account](https://console.cloud.google.com/iam-admin/serviceaccounts)
- Enable Google workspace delegation
- Generate keys and download the file (used by the bot `-g`)
- [Add required scopes](https://admin.google.com/ac/owl/domainwidedelegation) for the service account (see config.example for the list of scopes)

You must create [user custom attribute](https://admin.google.com/ac/customschema?hl=fr)

```json
custom: {
 pseudo: ""
 discordId: ""
}
```

# Install

```bash
pip install les_louisdelatech
```

# Configure

Generate a secret_key to encrypt database secrets

```python
>>> from cryptography.fernet import Fernet
>>> Fernet.generate_key()
```

Fill `config.toml` with `config.example`

# Run

```bash
python3 -m les_louisdelatech.main -c config.toml -g google.json
```

# Dev

Install [Poetry](https://python-poetry.org/docs/master/#installing-with-the-official-installer) with version >= 1.2.0a1

```bash
poetry install
poetry shell
pre-commit install
```

### Run pre-commit
```
pre-commit run --all-files
```

## Licence

The code is under CeCILL license.

You can find all details here: <https://cecill.info/licences/Licence_CeCILL_V2.1-en.html>

## Credits

Copyright © Lyon e-Sport, 2021

Contributor(s):

- Ortega Ludovic - ludovic.ortega@lyon-esport.fr
- Etienne "PoPs" G. - etienne.guilluy@lyon-esport.fr
- Pierre "DrumSlayer" Sarret - pierre.sarret@lyon-esport.fr

