25 lines
638 B
Python
25 lines
638 B
Python
from urllib.parse import urljoin
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi_discord import DiscordOAuthClient
|
|
from libbot.utils import config_get
|
|
|
|
discord_oauth: DiscordOAuthClient = DiscordOAuthClient(
|
|
config_get("client_id", "api", "oauth"),
|
|
config_get("client_secret", "api", "oauth"),
|
|
urljoin(config_get("public_url", "api"), "/v1/callback"),
|
|
("identify", "guilds"),
|
|
)
|
|
|
|
# TODO Add an integration for the contact information
|
|
app: FastAPI = FastAPI(
|
|
title="Javelina",
|
|
version="0.0.1",
|
|
)
|
|
|
|
|
|
# TODO Replace this with a FastAPI lifespan
|
|
@app.on_event("startup")
|
|
async def on_startup():
|
|
await discord_oauth.init()
|