Compare commits

...

136 Commits

Author SHA1 Message Date
Michel Roux fa629143e7 Merge pull request 'Update dependency black to v23' (#99) from renovate/black-23.x into master
continuous-integration/drone/push Build is passing Details
4 days ago
Michel Roux b8bc180c6f Update dependency black to v23
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 days ago
Michel Roux 914ed744a0 Small fixes and add py.typed
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
3 weeks ago
Michel Roux 4027fd0063 Merge pull request 'Update dependency sentry-sdk to v1.13.0' (#98) from renovate/sentry-sdk-1.x into master
continuous-integration/drone/push Build is passing Details
3 weeks ago
Michel Roux 9a1aa6fc20 Update dependency sentry-sdk to v1.13.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 weeks ago
Michel Roux b23c972ffc Merge pull request 'Update dependency djlint to v1.19.11' (#97) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
1 month ago
Michel Roux 385d40b726 Update dependency djlint to v1.19.11
continuous-integration/drone/push Build is passing Details
1 month ago
Michel Roux 0e961faaa0 Merge pull request 'Update dependency djlint to v1.19.10' (#96) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
1 month ago
Michel Roux e176a51f7a Update dependency djlint to v1.19.10
continuous-integration/drone/push Build is passing Details
1 month ago
Michel Roux cef34a852f Update lock
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux f6a01c96a4 Merge pull request 'Update dependency flake8-black to v0.3.6' (#95) from renovate/flake8-black-0.x into master
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux da02181758 Update dependency flake8-black to v0.3.6
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 795c32fb46 Merge pull request 'Update dependency sentry-sdk to v1.12.1' (#94) from renovate/sentry-sdk-1.x into master
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 2ebc39857b Update dependency sentry-sdk to v1.12.1
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 3b05b2ef95 Merge pull request 'Update dependency djlint to v1.19.9' (#93) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 005c4bdb65 Update dependency djlint to v1.19.9
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 85b6440e96 Merge pull request 'Update dependency sentry-sdk to v1.12.0' (#92) from renovate/sentry-sdk-1.x into master
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux bf1aa03e8e Update dependency sentry-sdk to v1.12.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2 months ago
Michel Roux fc83203b70 Merge pull request 'Update dependency djlint to v1.19.8' (#91) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 00461f0e63 Update dependency djlint to v1.19.8
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 9b85d636b0 Merge pull request 'Update dependency black to v22.12.0' (#90) from renovate/black-22.x into master
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 1f310b9e32 Update dependency black to v22.12.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2 months ago
Michel Roux 33ed6d2b9b Merge pull request 'Update python Docker tag to v3.11.1' (#89) from renovate/python-3.x into master
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux c9bcfc8c91 Update python Docker tag to v3.11.1
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux b274e499c4 Update lock
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2 months ago
Michel Roux 7770e4e828 Merge pull request 'Update dependency flake8 to v6' (#86) from renovate/flake8-6.x into master
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux bdab7b5c9a Update dependency flake8 to v6
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 55903c12f6 Merge pull request 'Update dependency types-oauthlib to v3.2.0.1' (#88) from renovate/types-oauthlib-3.x into master
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux ba46852b05 Update dependency types-oauthlib to v3.2.0.1
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 6658109f0f Merge pull request 'Update dependency flake8-alphabetize to v0.0.19' (#87) from renovate/flake8-alphabetize-0.x into master
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 484c865d26 Update dependency flake8-alphabetize to v0.0.19
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux bad8cbd3a5 Fix TokenExpiredError #DIVENT-3
continuous-integration/drone/push Build is passing Details
2 months ago
Michel Roux 5fe486b03d Merge pull request 'Update dependency sentry-sdk to v1.11.1' (#85) from renovate/sentry-sdk-1.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 4a013b7ad2 Update dependency sentry-sdk to v1.11.1
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 2e085abed7 Merge pull request 'Update dependency flake8-black to v0.3.5' (#84) from renovate/flake8-black-0.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 94cc28225b Update dependency flake8-black to v0.3.5
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 052c3468c8 Merge pull request 'Update dependency uvicorn to v0.20.0' (#83) from renovate/uvicorn-0.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux c9c5e3917b Update dependency uvicorn to v0.20.0
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 6f122a1f03 Merge pull request 'Update dependency flake8-black to v0.3.4' (#82) from renovate/flake8-black-0.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux d68e48e002 Update dependency flake8-black to v0.3.4
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux cb2cc1b042 Merge pull request 'Update dependency mypy to v0.991' (#80) from renovate/mypy-0.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 8b2281c153 Update dependency mypy to v0.991
continuous-integration/drone/push Build is failing Details
3 months ago
Michel Roux 187c364fa5 Merge pull request 'Update dependency sentry-sdk to v1.11.0' (#81) from renovate/sentry-sdk-1.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux e21df47492 Update dependency sentry-sdk to v1.11.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
3 months ago
Michel Roux 051a2a4920 Merge pull request 'Update dependency djlint to v1.19.7' (#78) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux e3a60c1ad6 Update dependency djlint to v1.19.7
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 8a21afc11f Merge pull request 'Update dependency mypy to v0.990' (#79) from renovate/mypy-0.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 91732ec3d7 Update dependency mypy to v0.990
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 261c1b2b7f Fix Google and Outlook link
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 8f32dd9bb6 Merge pull request 'Update dependency djlint to v1.19.4' (#77) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 8780341bcb Update dependency djlint to v1.19.4
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux e63062cadf Merge pull request 'Update dependency disnake to v2.7.0' (#76) from renovate/disnake-2.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 1408a00ac9 Update dependency disnake to v2.7.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
3 months ago
Michel Roux bd29a2bd96 Merge pull request 'Update dependency flake8-alphabetize to v0.0.18' (#75) from renovate/flake8-alphabetize-0.x into master
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 29a168ffdc Update dependency flake8-alphabetize to v0.0.18
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 8fd4e8f243 Do not use slim image anymore
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux 459dbd5243 Update lock
continuous-integration/drone/push Build is failing Details
3 months ago
Michel Roux c81546b834 Merge pull request 'Update dependency djlint to v1.19.3' (#74) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is failing Details
3 months ago
Michel Roux ae00ebf0ae Update dependency djlint to v1.19.3
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux a5795bbda2 Merge pull request 'Update python Docker tag to v3.11.0' (#73) from renovate/python-3-x into master
continuous-integration/drone/push Build is failing Details
3 months ago
Michel Roux 64a8042dd5 Update python Docker tag to v3.11.0
continuous-integration/drone/push Build is passing Details
3 months ago
Michel Roux fc505d82ab Merge pull request 'Update dependency sentry-sdk to v1.10.1' (#72) from renovate/sentry-sdk-1.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 988dc05b3d Update dependency sentry-sdk to v1.10.1
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux e2beda32e5 Merge pull request 'Update dependency djlint to v1.19.2' (#71) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 211580afbf Update dependency djlint to v1.19.2
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux f1073205a1 FIx sentry error
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 3f2bf09bf6 Merge pull request 'Update dependency disnake to v2.6.1' (#70) from renovate/disnake-2.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 2629afceda Update dependency disnake to v2.6.1
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux a35aeb629a Readd Sentry
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 4533920245 Revert "Remove Sentry"
4 months ago
Michel Roux 58f5e772b7 Merge pull request 'Update dependency uvicorn to v0.19.0' (#69) from renovate/uvicorn-0.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 94ecdce208 Update dependency uvicorn to v0.19.0
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux eccd531d45 Update version
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux b087e33f99 Remove Sentry
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
4 months ago
Michel Roux cbd678515f Merge pull request 'Update dependency djlint to v1.19.1' (#67) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 3e10bbb3e3 Merge pull request 'Update python Docker tag to v3.10.8' (#68) from renovate/python-3.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 5b0255276b Update python Docker tag to v3.10.8
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux ea4e2348b8 Update dependency djlint to v1.19.1
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux 004f7357c3 Merge pull request 'Update dependency djlint to v1.19.0' (#66) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 09fd509305 Update dependency djlint to v1.19.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux 9103502eb1 Merge pull request 'Update dependency quart to v0.18.3' (#65) from renovate/quart-0.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux e01a3a73c1 Update dependency quart to v0.18.3
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux 77a4d5e3ab Merge pull request 'Update dependency black to v22.10.0' (#64) from renovate/black-22.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux ce4444109f Update dependency black to v22.10.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux fd6c1fe10b Merge pull request 'Update dependency quart to v0.18.2' (#63) from renovate/quart-0.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 545668d7e1 Update dependency quart to v0.18.2
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux 3ad3ee5132 Merge pull request 'Update dependency mypy to v0.982' (#62) from renovate/mypy-0.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux de3f6ad550 Update dependency mypy to v0.982
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux ba1c50bce7 Merge pull request 'Update dependency sentry-sdk to v1.9.10' (#61) from renovate/sentry-sdk-1.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux cd385217ec Update dependency sentry-sdk to v1.9.10
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux d3474f28b4 Merge pull request 'Update dependency quart to v0.18.1' (#60) from renovate/quart-0.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux b6a78381bf Update dependency quart to v0.18.1
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux ef7ea3a23c Update lock
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 96b3f8be03 Merge pull request 'Update dependency disnake to v2.6.0' (#59) from renovate/disnake-2.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 3df8812b2d Update dependency disnake to v2.6.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux bef880f60b Merge pull request 'Update dependency mypy to v0.981' (#58) from renovate/mypy-0.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux 134ae73bc3 Update dependency mypy to v0.981
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux 97af947ed3 Merge pull request 'Update dependency sentry-sdk to v1.9.9' (#56) from renovate/sentry-sdk-1.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux f76f3615c0 Update dependency sentry-sdk to v1.9.9
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux 38a7a3177a Merge pull request 'Update dependency djlint to v1.18.0' (#57) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
4 months ago
Michel Roux ce8c814e02 Update dependency djlint to v1.18.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
4 months ago
Michel Roux 0a47607d05 Merge pull request 'Update dependency djlint to v1.17.2' (#55) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 2f0f323427 Update dependency djlint to v1.17.2
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 4e7c58bfb1 Merge pull request 'Update dependency djlint to v1.17.0' (#54) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 9d7d7a7a28 Update dependency djlint to v1.17.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 9ce7d0566e Merge pull request 'Update dependency djlint to v1.16.0' (#53) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 2ce0702067 Update dependency djlint to v1.16.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 40232464b7 Update version
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 1498587437 Add redirection if not logged
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
5 months ago
Michel Roux bb842f7fd0 Fix crash if not loged
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 0d555f8f9c Fix djlint
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 80c0160825 Merge pull request 'Update dependency djlint to v1.15.0' (#52) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is failing Details
5 months ago
Michel Roux e154ec9903 Update dependency djlint to v1.15.0
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
5 months ago
Michel Roux 17795b0d85 Merge pull request 'Update dependency djlint to v1.14.2' (#51) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 2c132cb15d Update dependency djlint to v1.14.2
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 2671c2e92b Merge pull request 'Update dependency djlint to v1.14.1' (#50) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 8ef7520efb Update dependency djlint to v1.14.1
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux b2fe4fa95a Merge pull request 'Update dependency djlint to v1.14.0' (#49) from renovate/djlint-1.x into master
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 84b53700be Update dependency djlint to v1.14.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 051111b58d Fix README and update version
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 8f507b0fcd Merge pull request 'Oauth Anthentication' (#48) from v2 into master
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
5 months ago
Michel Roux 47781b35dd Fix typing
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 4117a189e6 Remove useless param on make_session
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 6775e09c7a More typing
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
5 months ago
Michel Roux 6ddd615942 Fix README
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 7ef4400e84 FInal touches on README
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 037b9704b2 Try to have a pretty readme
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 1bb1827647 Update README
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 1b8cff752a Fix mypy and djlint
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
5 months ago
Michel Roux 966510c467 Fix test user guild on subscribe
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
5 months ago
Michel Roux 2e08de2e57 Update version
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
5 months ago
Michel Roux 407a105971 Merge branch 'master' into v2
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
5 months ago
Michel Roux 2318b2d22b Update version
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
5 months ago
Michel Roux cdd83f27eb Fix bot lint
5 months ago
Michel Roux 3bdcf2c4cd Add oauth
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
5 months ago
Michel Roux c371e9dae7 First part of the oauth authentication
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
5 months ago

@ -4,7 +4,7 @@ type: docker
steps:
- name: lint
image: python:3.8-slim
image: python:3.8
commands:
- pip install poetry
- poetry install
@ -23,7 +23,7 @@ steps:
from_secret: docker_password
- name: publish
image: python:3.8-slim
image: python:3.8
commands:
- pip install poetry
- poetry publish --build

@ -1 +1,3 @@
DISCORD_TOKEN=
OAUTH2_CLIENT_ID=
OAUTH2_CLIENT_SECRET=

@ -1,2 +1,2 @@
[flake8]
max-line-length = 100
max-line-length = 88

@ -1,10 +1,10 @@
FROM python:3.10.7-slim as build
FROM python:3.11.1 as build
WORKDIR /app
COPY . .
RUN pip install poetry && poetry build
FROM python:3.10.7-slim
FROM python:3.11.1
COPY --from=build /app/dist /tmp/dist
RUN pip install /tmp/dist/*.whl && rm -rf /tmp/dist

@ -13,21 +13,37 @@ Simple website that guides you to invite a bot to read and format scheduled even
- Go to the [Discord Developer Portal](https://discord.com/developers/applications) and create a new application.
- Enable the `Build-A-Bot` option in the `Bot` panel.
- Click on `Reset Token` and keep it in a safe place, you will need it.
- Click on `Reset Secret` in the `OAuth2` panel, copy both `Client ID` and `Client Secret` and keep it in a safe place, you will need it.
- Configure the rest of your app and bot as you like (name, icon, username, etc.)
### 2) With Docker
- Install [Docker](https://docs.docker.com/get-docker/)
- Run `docker run -p 5000 -e DISCORD_TOKEN=your_bot_token xefir/divent`
- The app is accessible at http://localhost:5000
- Run
```bash
docker run -p 5000 \
-e DISCORD_TOKEN=your_bot_token \
-e OAUTH2_CLIENT_ID=your_client_id \
-e OAUTH2_CLIENT_SECRET=your_client_secret \
xefir/divent
```
### 2) Without Docker
- Install [Python 3](https://www.python.org/downloads/)
- Install [Pip](https://pip.pypa.io/en/stable/installing/)
- Install [Pip](https://pip.pypa.io/en/stable/installation/)
- Run `pip install divent`
- Run `DISCORD_TOKEN=your_bot_token divent`
- The app is accessible at http://localhost:5000
- Run
```bash
DISCORD_TOKEN=your_bot_token \
OAUTH2_CLIENT_ID=your_client_id \
OAUTH2_CLIENT_SECRET=your_client_secret \
divent
```
### 3) Open your browser
The app is accessible at http://localhost:5000
## Links

@ -1,32 +1,46 @@
import json
import logging
from datetime import datetime, timedelta
from os import environ, path
from typing import Optional
from functools import wraps
from os import getenv, path
from typing import Dict, Optional
from disnake import Client, Guild
from dotenv import load_dotenv
from ics import Calendar, ContentLine, Event
from ics.alarm import DisplayAlarm
from quart import Quart, redirect, render_template, request, url_for
from oauthlib.oauth2 import TokenExpiredError
from quart import Quart, redirect, render_template, request, session, url_for
from requests_oauthlib import OAuth2Session # type: ignore
import sentry_sdk
from sentry_sdk.integrations.quart import QuartIntegration
from uvicorn.middleware.proxy_headers import ProxyHeadersMiddleware # type: ignore
load_dotenv()
QUART_DEBUG = environ.get("QUART_DEBUG", False)
DISCORD_TOKEN = environ.get("DISCORD_TOKEN")
DISCORD_TOKEN = getenv("DISCORD_TOKEN")
OAUTH2_CLIENT_ID = getenv("OAUTH2_CLIENT_ID")
OAUTH2_CLIENT_SECRET = getenv("OAUTH2_CLIENT_SECRET")
if not DISCORD_TOKEN:
raise Exception("Missing DISCORD_TOKEN")
if not OAUTH2_CLIENT_ID:
raise Exception("Missing OAUTH2_CLIENT_ID")
if not OAUTH2_CLIENT_SECRET:
raise Exception("Missing OAUTH2_CLIENT_SECRET")
QUART_DEBUG = getenv("QUART_DEBUG", False)
if QUART_DEBUG:
logging.basicConfig(level=logging.DEBUG)
SENTRY_DSN = environ.get("SENTRY_DSN")
SENTRY_DSN = getenv("SENTRY_DSN")
if SENTRY_DSN:
sentry_sdk.init(SENTRY_DSN, integrations=[QuartIntegration()])
API_BASE_URL = getenv("API_BASE_URL", "https://discordapp.com/api")
AUTHORIZATION_BASE_URL = f"{API_BASE_URL}/oauth2/authorize"
TOKEN_URL = f"{API_BASE_URL}/oauth2/token"
class Discord(Client):
async def on_ready(self):
@ -35,6 +49,7 @@ class Discord(Client):
client = Discord()
app = Quart(__name__)
app.config["SECRET_KEY"] = OAUTH2_CLIENT_SECRET
app.asgi_app = ProxyHeadersMiddleware(app.asgi_app, "*") # type: ignore
@ -60,6 +75,28 @@ async def not_found(error: Exception):
return await render_template("error.html.j2", error=str(error)), 404
def token_updater(token: str):
session["oauth2_token"] = token
def make_session(
token: Optional[Dict[str, str]] = None, state: Optional[str] = None
) -> OAuth2Session:
return OAuth2Session(
client_id=OAUTH2_CLIENT_ID,
token=token,
state=state,
scope=["identify", "guilds"],
redirect_uri=f"{request.host_url}callback",
auto_refresh_kwargs={
"client_id": OAUTH2_CLIENT_ID,
"client_secret": OAUTH2_CLIENT_SECRET,
},
auto_refresh_url=TOKEN_URL,
token_updater=token_updater,
)
def i18n(str: str) -> str:
lang = request.accept_languages.best_match(["en", "fr"])
@ -84,27 +121,105 @@ def days_before_failure() -> int:
return nextDelta.days
def cdn_avatar_url(user_id: int, hash: str) -> str:
ext = "gif" if hash.startswith("a_") else "png"
return f"https://cdn.discordapp.com/avatars/{user_id}/{hash}.{ext}"
@app.context_processor
def context_processor():
return dict(_=i18n, client=client, days_before_failure=days_before_failure())
return dict(
_=i18n,
client=client,
cdn_avatar_url=cdn_avatar_url,
days_before_failure=days_before_failure(),
)
def login_required(fn):
@wraps(fn)
async def wrapper(*args, **kwargs):
if session.get("oauth2_token"):
return await fn(*args, **kwargs)
session["redirect_url"] = request.path
return redirect(url_for(".login"))
return wrapper
@app.route("/")
async def index():
guild_id = request.args.get("guild")
guild = get_guild_by_id(guild_id)
return await render_template("index.html.j2")
@app.route("/login")
async def login():
discord = make_session()
authorization_url, state = discord.authorization_url(AUTHORIZATION_BASE_URL)
session["oauth2_state"] = state
return redirect(authorization_url)
@app.route("/callback")
async def callback():
request_values = await request.values
if request_values.get("error"):
return errorhandler(request_values.get("error"))
discord = make_session(state=session.get("oauth2_state"))
token = discord.fetch_token(
TOKEN_URL,
client_secret=OAUTH2_CLIENT_SECRET,
authorization_response=request.url,
)
token_updater(token)
return redirect(session.pop("redirect_url", url_for(".guilds")))
@app.route("/guilds")
@login_required
async def guilds():
guild = get_guild_by_id(request.args.get("guild"))
if guild:
return redirect(url_for(".subscribe", guild_id=guild_id))
return redirect(
url_for(".subscribe", guild_id=guild.vanity_url_code or guild.id)
)
return await render_template("index.html.j2")
try:
discord = make_session(token=session.get("oauth2_token"))
user = discord.get(f"{API_BASE_URL}/users/@me").json()
user_guilds = discord.get(f"{API_BASE_URL}/users/@me/guilds").json()
except TokenExpiredError:
return redirect(url_for(".login"))
common_guilds = []
for bot_guild in client.guilds:
for user_guild in user_guilds:
if str(bot_guild.id) == user_guild["id"]:
common_guilds.append(bot_guild)
return await render_template(
"guilds.html.j2", user=user, common_guilds=common_guilds
)
@app.route("/subscribe/<guild_id>")
@login_required
async def subscribe(guild_id: str):
guild = get_guild_by_id(guild_id)
if guild is None:
return redirect(url_for(".index"))
return redirect(url_for(".login"))
try:
discord = make_session(token=session.get("oauth2_token"))
user_guilds = discord.get(f"{API_BASE_URL}/users/@me/guilds").json()
except TokenExpiredError:
return redirect(url_for(".login"))
if not any(str(guild.id) == user_guild["id"] for user_guild in user_guilds):
return redirect(url_for(".login"))
return await render_template("subscribe.html.j2", guild=guild)
@ -113,7 +228,7 @@ async def subscribe(guild_id: str):
async def ical(guild_id: str):
guild = get_guild_by_id(guild_id)
if guild is None:
return redirect(url_for(".index"))
return redirect(url_for(".login"))
calendar = Calendar()
@ -151,6 +266,7 @@ async def ical(guild_id: str):
return calendar.serialize()
quart_task = client.loop.create_task(app.run_task("0.0.0.0"))
quart_task.add_done_callback(lambda f: client.loop.stop())
client.run(DISCORD_TOKEN)
def __main__():
quart_task = client.loop.create_task(app.run_task("0.0.0.0"))
quart_task.add_done_callback(lambda f: client.loop.stop())
client.run(DISCORD_TOKEN)

@ -18,7 +18,7 @@
{% endblock content %}
</div>
<footer>
{% include 'footer.html.j2' %}
{% include "footer.html.j2" %}
</footer>
</body>
</html>

@ -0,0 +1,55 @@
{% extends "base.html.j2" %}
{% block content %}
<form action="{{ url_for(".guilds") }}" method="get">
<div id="box">
<div id="avatars">
<img src="{{ client.user.display_avatar }}"
alt="{{ _('Bot Logo') }}"
width="80"
height="80"/>
<span id="dots">…</span>
<img src="{{ cdn_avatar_url(user.id, user.avatar) }}"
alt="{{ _('User Avatar') }}"
width="80"
height="80"/>
</div>
<h1>
<a href="{{ url_for(".index") }}">{{ client.user.display_name }}</a>
</h1>
<h3>{{ _('Choose a server:') }}</h3>
<select name="guild" class="black_input">
<option>
&nbsp;
</option>
{% for guild in common_guilds %}
<option value="{{ guild.vanity_url_code|default(guild.id, True) }}">
{{ guild.name }}
</option>
{% endfor %}
</select>
<div class="hr-sect">{{ _("OR") }}</div>
<a class="button"
target="_blank"
href="https://discord.com/api/oauth2/authorize?client_id={{ client.user.id }}&permissions=8589934592&scope=bot">
{{ _("Add the bot on your server") }}
</a>
<ul>
<li>
{{ _("You must have") }}
<strong>{{ _("Manage Server") }}</strong>
{{ _("permission on this server to perform this action") }}
</li>
<li>
{{ _("After adding the bot,") }}
<a href="{{ url_for(".guilds") }}">
<i class="fa fa-refresh"></i>
<strong>{{ _("reload the page") }}</strong>
</a>
</li>
</ul>
</div>
<div id="buttons">
<input type="submit" class="button" value="{{ _("Let's go!") }}"/>
</div>
</form>
{% endblock content %}

@ -24,41 +24,9 @@
{{ _('Throwing you to a new isekai world') }}
</li>
</ul>
<hr />
<h3>{{ _('Choose a server:') }}</h3>
<select name="guild" class="black_input">
<option>
&nbsp;
</option>
{% for guild in client.guilds %}
<option value="{{ guild.vanity_url_code|default(guild.id, True) }}">
{{ guild.name }}
</option>
{% endfor %}
</select>
<div class="hr-sect">{{ _("OR") }}</div>
<a class="button"
target="_blank"
href="https://discord.com/api/oauth2/authorize?client_id={{ client.user.id }}&permissions=536870912&scope=bot">
{{ _("Add the bot on your server") }}
</a>
<ul>
<li>
{{ _("You must have") }}
<strong>{{ _("Manage Server") }}</strong>
{{ _("permission on this server to perform this action") }}
</li>
<li>
{{ _("After adding the bot,") }}
<a href="{{ url_for(".index") }}">
<i class="fa fa-refresh"></i>
<strong>{{ _("reload the page") }}</strong>
</a>
</li>
</ul>
</div>
<div id="buttons">
<input type="submit" class="button" value="{{ _("Let's go!") }}"/>
<a class="button" href="{{ url_for(".login") }}">{{ _("Let's go!") }}</a>
</div>
</form>
{% endblock content %}

@ -21,7 +21,7 @@
<li>
<a class="button"
target="_blank"
href="https://calendar.google.com/calendar/u/0/r?cid={{ request.host_url }}{{ guild.vanity_url_code|default(guild.id, True) }}.ics">
href="https://calendar.google.com/calendar/u/0/r?cid=webcal://{{ request.host }}/{{ guild.vanity_url_code|default(guild.id, True) }}.ics">
<i class="fa fa-google"></i>
{{ _("Subscribe to") }} Google
</a>
@ -29,7 +29,7 @@
<li>
<a class="button"
target="_blank"
href="https://outlook.live.com/owa?path=/calendar/action/compose&rru=addsubscription&url={{ request.host_url }}{{ guild.vanity_url_code|default(guild.id, True) }}.ics">
href="https://outlook.live.com/owa?path=/calendar/action/compose&rru=addsubscription&url=webcal://{{ request.host }}/{{ guild.vanity_url_code|default(guild.id, True) }}.ics">
<i class="fa fa-windows"></i>
{{ _("Subscribe to") }} Outlook
</a>

1856
poetry.lock generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
[tool.poetry]
name = "divent"
version = "1.0.4"
version = "3.1.0"
description = "The discord scheduled event calendar generator"
authors = ["Xéfir Destiny"]
license = "WTFPL"
@ -12,21 +12,23 @@ repository = "https://git.crystalyx.net/Xefir/Divent"
divent = 'divent.bot:__main__'
[tool.poetry.dependencies]
python = "^3.8"
disnake = "2.5.2"
python = "^3.8.1"
disnake = "^2.7.0"
ics = "0.8.0.dev0"
python-dotenv = "0.21.0"
quart = "0.18.0"
sentry-sdk = "1.9.8"
uvicorn = "0.18.3"
python-dotenv = "^0.21.0"
quart = "^0.18.3"
requests-oauthlib = "^1.3.1"
sentry-sdk = "^1.13.0"
uvicorn = "^0.20.0"
[tool.poetry.dev-dependencies]
flake8 = "5.0.4"
black = "22.8.0"
mypy = "0.971"
flake8-alphabetize = "0.0.17"
flake8-black = "0.3.3"
djlint = "1.12.3"
black = "^23.0.0"
djlint = "^1.19.11"
flake8 = "^6.0.0"
flake8-alphabetize = "^0.0.19"
flake8-black = "^0.3.6"
mypy = "^0.991"
types-oauthlib = "^3.2.0.1"
[build-system]
requires = ["poetry-core>=1.0.0"]

Loading…
Cancel
Save