-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshared.py
36 lines (26 loc) · 993 Bytes
/
shared.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from flask import Flask, Blueprint
from flask_cors import CORS
import discord
import os
from modules.utils.db import DBConnect
import asyncio
from modules.utils.config import Config
# from modules.utils.db import DBManager
from modules.utils.db import DBConnect, Base
from modules.utils.TokenManager import TokenManager
from modules.bot.discord_modules.bot import BotFork
# Prompt for credentials before initializing InvitationSender
# Instantiate the InvitationSender class with credentials
config = Config()
intents = discord.Intents.all()
bot = BotFork(command_prefix="!", intents=intents)
bot.set_token(config.BOT_TOKEN)
bot.run()
app = Flask("SoDA internal API", static_folder=None, template_folder=None)
# Initialize database connection
db_connect = DBConnect("sqlite:///./user.db") # Adjust the URL to your database
app = Flask("SoDA internal API", static_folder=None, template_folder=None)
CORS(app,
resources={r"/*": {"origins": "*"}},
)
tokenManger = TokenManager()