Update templates to be used from dakiny messages repo.
This commit is contained in:
@@ -21,6 +21,7 @@ from database_setup.sql_data_classes import (
|
|||||||
engine,
|
engine,
|
||||||
)
|
)
|
||||||
from utils import (
|
from utils import (
|
||||||
|
TEMPLATES_DIR,
|
||||||
build_highcouncil_votes_str,
|
build_highcouncil_votes_str,
|
||||||
build_votes_str,
|
build_votes_str,
|
||||||
edit_clan_council_info,
|
edit_clan_council_info,
|
||||||
@@ -77,7 +78,7 @@ class ElectionCycle:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
with open(
|
with open(
|
||||||
"bot_messages/election_announcement.txt", mode="r", encoding="utf8"
|
f"{TEMPLATES_DIR}/election_announcement.txt", mode="r", encoding="utf8"
|
||||||
) as file:
|
) as file:
|
||||||
message = file.read()
|
message = file.read()
|
||||||
|
|
||||||
@@ -110,7 +111,7 @@ class ElectionCycle:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
with open(
|
with open(
|
||||||
"bot_messages/highcouncil_election.txt", mode="r", encoding="utf8"
|
f"{TEMPLATES_DIR}/highcouncil_election.txt", mode="r", encoding="utf8"
|
||||||
) as file:
|
) as file:
|
||||||
message = file.read()
|
message = file.read()
|
||||||
|
|
||||||
@@ -137,7 +138,7 @@ class ElectionCycle:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
with open(
|
with open(
|
||||||
"bot_messages/highcouncil_vote.txt", mode="r", encoding="utf8"
|
f"{TEMPLATES_DIR}/highcouncil_vote.txt", mode="r", encoding="utf8"
|
||||||
) as file:
|
) as file:
|
||||||
message = file.read()
|
message = file.read()
|
||||||
|
|
||||||
@@ -154,7 +155,7 @@ class ElectionCycle:
|
|||||||
str: Message to send
|
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()
|
message = file.read()
|
||||||
vote_end: datetime = get_datetime(
|
vote_end: datetime = get_datetime(
|
||||||
self.config.election_cycles[self.cycle].voting_end
|
self.config.election_cycles[self.cycle].voting_end
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ from database_setup.sql_data_classes import (
|
|||||||
NOMINEE_SPLITTER = "========================================\n\n"
|
NOMINEE_SPLITTER = "========================================\n\n"
|
||||||
REPO_DIR = "./dakiny-messages"
|
REPO_DIR = "./dakiny-messages"
|
||||||
MESSAGES_DIR = f"{REPO_DIR}/messages"
|
MESSAGES_DIR = f"{REPO_DIR}/messages"
|
||||||
|
TEMPLATES_DIR = f"{REPO_DIR}/message_templates"
|
||||||
|
|
||||||
|
|
||||||
def get_datetime(day: str) -> datetime:
|
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)
|
quarter = get_cycle_name(config)
|
||||||
|
|
||||||
with open(
|
with open(
|
||||||
"bot_messages/council_members.txt", mode="r", encoding="utf8"
|
f"{TEMPLATES_DIR}/council_members.txt", mode="r", encoding="utf8"
|
||||||
) as file:
|
) as file:
|
||||||
message = file.read()
|
message = file.read()
|
||||||
message = message.format(
|
message = message.format(
|
||||||
|
|||||||
Reference in New Issue
Block a user