Imports got sorted, address some pylance warnings.
This commit is contained in:
@@ -5,9 +5,6 @@ from datetime import UTC, datetime, timedelta
|
||||
from pathlib import Path
|
||||
|
||||
import nextcord
|
||||
from sqlalchemy import select, true, update
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from dakiny_bot.classes.nominate_highcouncil_views import NominateHighCouncilView
|
||||
from dakiny_bot.classes.nominate_views import NominateView
|
||||
from dakiny_bot.classes.voting_highcouncil_views import VoteHighcouncilView
|
||||
@@ -28,6 +25,8 @@ from dakiny_bot.utils import (
|
||||
get_datetime,
|
||||
get_election_name,
|
||||
)
|
||||
from sqlalchemy import select, true, update
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
REQUIRED_VOTES_TO_BE_ELECTED = 3
|
||||
|
||||
@@ -70,7 +69,7 @@ class Election:
|
||||
list[str]: A list of message contents in the correct order. Must be a string because the message is too
|
||||
long.
|
||||
"""
|
||||
with Path(f"{TEMPLATES_DIR}/election_announcement.txt", encoding="utf8").open() as file:
|
||||
with Path(f"{TEMPLATES_DIR}/election_announcement.txt").open() as file:
|
||||
message = file.read()
|
||||
|
||||
next_election = get_datetime(
|
||||
@@ -98,7 +97,7 @@ class Election:
|
||||
Returns:
|
||||
str: Message to send.
|
||||
"""
|
||||
with Path(f"{TEMPLATES_DIR}/highcouncil_election.txt", encoding="utf8").open() as file:
|
||||
with Path(f"{TEMPLATES_DIR}/highcouncil_election.txt").open() as file:
|
||||
message = file.read()
|
||||
|
||||
return message.format(
|
||||
@@ -116,7 +115,7 @@ class Election:
|
||||
Returns:
|
||||
str: Message to send.
|
||||
"""
|
||||
with Path(f"{TEMPLATES_DIR}/highcouncil_vote.txt", encoding="utf8").open() as file:
|
||||
with Path(f"{TEMPLATES_DIR}/highcouncil_vote.txt").open() as file:
|
||||
message = file.read()
|
||||
|
||||
return message.format(
|
||||
@@ -131,7 +130,7 @@ class Election:
|
||||
Returns:
|
||||
str: Message to send
|
||||
"""
|
||||
with Path(f"{TEMPLATES_DIR}/vote_start.txt", encoding="utf8").open() as file:
|
||||
with Path(f"{TEMPLATES_DIR}/vote_start.txt").open() as file:
|
||||
message = file.read()
|
||||
vote_end: datetime = get_datetime(settings.election_cycles[self.cycle].voting_end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user