diff --git a/classes/election_cycle.py b/classes/election_cycle.py index a60cdd4..9080e7d 100644 --- a/classes/election_cycle.py +++ b/classes/election_cycle.py @@ -21,6 +21,7 @@ from database_setup.sql_data_classes import ( engine, ) from utils import ( + TEMPLATES_DIR, build_highcouncil_votes_str, build_votes_str, edit_clan_council_info, @@ -77,7 +78,7 @@ class ElectionCycle: """ with open( - "bot_messages/election_announcement.txt", mode="r", encoding="utf8" + f"{TEMPLATES_DIR}/election_announcement.txt", mode="r", encoding="utf8" ) as file: message = file.read() @@ -110,7 +111,7 @@ class ElectionCycle: """ with open( - "bot_messages/highcouncil_election.txt", mode="r", encoding="utf8" + f"{TEMPLATES_DIR}/highcouncil_election.txt", mode="r", encoding="utf8" ) as file: message = file.read() @@ -137,7 +138,7 @@ class ElectionCycle: """ with open( - "bot_messages/highcouncil_vote.txt", mode="r", encoding="utf8" + f"{TEMPLATES_DIR}/highcouncil_vote.txt", mode="r", encoding="utf8" ) as file: message = file.read() @@ -154,7 +155,7 @@ class ElectionCycle: str: Message to send """ - with open("bot_messages/vote_start.txt", mode="r", encoding="utf8") as file: + with open(f"{TEMPLATES_DIR}/vote_start.txt", mode="r", encoding="utf8") as file: message = file.read() vote_end: datetime = get_datetime( self.config.election_cycles[self.cycle].voting_end diff --git a/utils.py b/utils.py index 0dbbfdb..9f04a10 100644 --- a/utils.py +++ b/utils.py @@ -21,6 +21,7 @@ from database_setup.sql_data_classes import ( NOMINEE_SPLITTER = "========================================\n\n" REPO_DIR = "./dakiny-messages" MESSAGES_DIR = f"{REPO_DIR}/messages" +TEMPLATES_DIR = f"{REPO_DIR}/message_templates" def get_datetime(day: str) -> datetime: @@ -570,7 +571,7 @@ async def edit_clan_council_info(guild: nextcord.Guild, config: DakinyConfig): quarter = get_cycle_name(config) with open( - "bot_messages/council_members.txt", mode="r", encoding="utf8" + f"{TEMPLATES_DIR}/council_members.txt", mode="r", encoding="utf8" ) as file: message = file.read() message = message.format(