Replace rest of bot.config references. Clear record.py of old config usage.

This commit is contained in:
2024-09-03 19:43:37 -04:00
parent 3a47f58382
commit 44586183fe
5 changed files with 24 additions and 33 deletions
+4 -6
View File
@@ -9,13 +9,12 @@ from git import Repo
from nextcord.ext import commands
from classes.gitea_webhook import GiteaWebhook
from DakinySettings import settings
from utils import REPO_DIR, edit_clan_council_info, update_clan_messages
if TYPE_CHECKING:
import nextcord
from DakinySettings import DakinySettings
app = FastAPI()
REPO_URL = "https://gitea.cheezers.org/imcompiling/dakiny-messages.git"
@@ -30,7 +29,6 @@ class ClanMessages(commands.Cog, name="Clan Messages"):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.config: DakinySettings = self.bot.config
self.repo_setup()
@commands.Cog.listener()
@@ -58,13 +56,13 @@ class ClanMessages(commands.Cog, name="Clan Messages"):
channel_updates = {file.split("/")[1] for file in modified_files if file.split("/")[1] not in template_updates}
self.origin.pull()
guild: nextcord.Guild = self.bot.get_guild(self.config.params.guild_id)
guild: nextcord.Guild = self.bot.get_guild(settings.params.guild_id)
await update_clan_messages(guild, channel_updates)
# if the council members template has changed, update the message
if "council_members.txt" in template_updates:
await edit_clan_council_info(self.bot.get_guild(self.config.params.guild_id))
await edit_clan_council_info(self.bot.get_guild(settings.params.guild_id))
return {"message": "Successfully updated all discord messages."}
@@ -78,7 +76,7 @@ class ClanMessages(commands.Cog, name="Clan Messages"):
self.origin = self.repo.remote("origin")
if self.config.params.git_branch == "test":
if settings.params.git_branch == "test":
self.repo.create_head("test", self.origin.refs.test).set_tracking_branch(self.origin.refs.test).checkout()
else:
self.repo.create_head("main", self.origin.refs.main).set_tracking_branch(self.origin.refs.main).checkout()