Add hydra configs.
build

This commit is contained in:
2023-06-17 16:25:45 -04:00
parent d32c27c291
commit 0f05751ce8
4 changed files with 43 additions and 5 deletions
+11 -3
View File
@@ -1,12 +1,19 @@
import os
import sys
import hydra
import nextcord
from hydra.core.config_store import ConfigStore
from nextcord.ext import commands
import config
from config import DakinyConfig
cs = ConfigStore.instance()
cs.store(name="dakiny_config", node=DakinyConfig)
def main():
@hydra.main(config_path="conf", config_name="config")
def main(cfg: DakinyConfig):
# Allows privledged intents for monitoring members joining, roles editing, and role assignments
# These need to be enabled in the developer portal as well
intents = nextcord.Intents.default()
@@ -33,8 +40,9 @@ def main():
print(f"{bot.user.name} has connected to Discord!")
# Run Discord bot
bot.run(config.DISCORD_TOKEN)
bot.run(cfg.params.discord_token)
if __name__ == "__main__":
sys.argv.append("hydra.job.chdir=False")
main()