Remove hydra from main. Install PyYAML.
This commit is contained in:
@@ -2,23 +2,17 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
|
|
||||||
import hydra
|
|
||||||
import nextcord
|
import nextcord
|
||||||
from hydra.core.config_store import ConfigStore
|
|
||||||
from nextcord.ext import commands
|
from nextcord.ext import commands
|
||||||
|
|
||||||
from classes.nominate_highcouncil_views import NominateHighCouncilView
|
from classes.nominate_highcouncil_views import NominateHighCouncilView
|
||||||
from classes.nominate_views import NominateView
|
from classes.nominate_views import NominateView
|
||||||
from classes.voting_highcouncil_views import VoteHighcouncilView
|
from classes.voting_highcouncil_views import VoteHighcouncilView
|
||||||
from classes.voting_views import VoteView
|
from classes.voting_views import VoteView
|
||||||
from config import DakinyConfig
|
from DakinyConfig import DakinyConfig
|
||||||
from database_setup import create_database
|
from database_setup import create_database
|
||||||
|
|
||||||
cs = ConfigStore.instance()
|
|
||||||
cs.store(name="dakiny_config", node=DakinyConfig)
|
|
||||||
|
|
||||||
birthday_list: list[int] = []
|
birthday_list: list[int] = []
|
||||||
|
|
||||||
logger = logging.getLogger("nextcord")
|
logger = logging.getLogger("nextcord")
|
||||||
@@ -28,26 +22,24 @@ handler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(me
|
|||||||
logger.addHandler(handler)
|
logger.addHandler(handler)
|
||||||
|
|
||||||
|
|
||||||
@hydra.main(config_path="conf", config_name="config")
|
def main() -> None:
|
||||||
def main(cfg: DakinyConfig) -> None:
|
|
||||||
"""
|
"""
|
||||||
Builds and runs bot.
|
Builds and runs bot.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
cfg (DakinyConfig): Passed in hydra configuration.
|
cfg (DakinyConfig): Passed in hydra configuration.
|
||||||
"""
|
"""
|
||||||
# Allows privledged intents for monitoring members joining, roles editing, and role assignments
|
# Allows privileged intents for monitoring members joining, roles editing, and role assignments
|
||||||
# These need to be enabled in the developer portal as well
|
# These need to be enabled in the developer portal as well
|
||||||
intents = nextcord.Intents.default()
|
intents = nextcord.Intents.default()
|
||||||
|
|
||||||
# Required in order to read messages (eg. prefix commands)
|
# Required in order to read messages (eg. prefix commands)
|
||||||
intents.message_content = True
|
intents.message_content = True
|
||||||
|
|
||||||
# To enable the members priveleged intent:
|
# To enable the members privileged intent:
|
||||||
intents.members = True
|
intents.members = True
|
||||||
|
|
||||||
bot = commands.Bot(intents=intents)
|
bot = commands.Bot(intents=intents)
|
||||||
bot.config = cfg
|
|
||||||
|
|
||||||
# Get the modules of all cogs whose directory structure is ./cogs/<module_name>
|
# Get the modules of all cogs whose directory structure is ./cogs/<module_name>
|
||||||
for folder in os.listdir("cogs"):
|
for folder in os.listdir("cogs"):
|
||||||
@@ -69,7 +61,4 @@ def main(cfg: DakinyConfig) -> None:
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.argv.append("hydra.job.chdir=False")
|
main()
|
||||||
sys.argv.append("hydra/job_logging=none")
|
|
||||||
sys.argv.append("hydra/hydra_logging=none")
|
|
||||||
main() # pylint: disable=no-value-for-parameter
|
|
||||||
|
|||||||
+1
-2
@@ -10,14 +10,13 @@ package-mode = false
|
|||||||
python = "^3.12"
|
python = "^3.12"
|
||||||
gitpython = "^3.1.43"
|
gitpython = "^3.1.43"
|
||||||
fastapi = "^0.111.0"
|
fastapi = "^0.111.0"
|
||||||
hydra-core = "^1.3.2"
|
|
||||||
nextcord = "^2.6.0"
|
nextcord = "^2.6.0"
|
||||||
pandas = "^2.2.2"
|
pandas = "^2.2.2"
|
||||||
python-dotenv = "^1.0.1"
|
|
||||||
pytz = "^2024.1"
|
pytz = "^2024.1"
|
||||||
sqlalchemy = "^2.0.30"
|
sqlalchemy = "^2.0.30"
|
||||||
aiofiles = "^23.2.1"
|
aiofiles = "^23.2.1"
|
||||||
setuptools = "^70.0.0"
|
setuptools = "^70.0.0"
|
||||||
|
pyyaml = "^6.0.2"
|
||||||
|
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
|
|||||||
Reference in New Issue
Block a user