Renamed to DakinySettings. Converted dataclass to YAMLWizard.
build_develop / build (push) Failing after 17s

This commit is contained in:
2024-09-03 14:37:06 -04:00
parent b15e99ca68
commit 62f53bde55
14 changed files with 76 additions and 58 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ from utils import REPO_DIR, edit_clan_council_info, update_clan_messages
if TYPE_CHECKING:
import nextcord
from DakinyConfig import DakinyConfig
from DakinySettings import DakinySettings
app = FastAPI()
REPO_URL = "https://gitea.cheezers.org/imcompiling/dakiny-messages.git"
@@ -30,7 +30,7 @@ class ClanMessages(commands.Cog, name="Clan Messages"):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.config: DakinyConfig = self.bot.config
self.config: DakinySettings = self.bot.config
self.repo_setup()
@commands.Cog.listener()
+3 -3
View File
@@ -4,7 +4,7 @@ import nextcord
from discord import TextInputStyle
from nextcord.ext import commands
from DakinyConfig import DakinyConfig
from DakinySettings import DakinySettings
from utils import GUILDS, MAX_DISCORD_MESSAGE_LENGTH, record_event_points
@@ -155,11 +155,11 @@ class EventView(nextcord.ui.View):
Also contains a UserSelect object to pick discord members.
"""
def __init__(self, name: str, config: DakinyConfig, host_id: int):
def __init__(self, name: str, config: DakinySettings, host_id: int):
super().__init__()
self.name: str = name
self.config: DakinyConfig = config
self.config: DakinySettings = config
self.host_id: int = host_id
self.event_participants = ParticipantSelect()
+3 -3
View File
@@ -9,7 +9,7 @@ from sqlalchemy.orm import Session
from database_setup.sql_data_classes import Presences, engine
if TYPE_CHECKING:
from DakinyConfig import DakinyConfig
from DakinySettings import DakinySettings
class RequestCog(commands.Cog, name="Request Commands"):
@@ -41,7 +41,7 @@ class RequestCog(commands.Cog, name="Request Commands"):
interaction (nextcord.Interaction): Interaction that invoked the command.
presence (str): The presence to add.
"""
config: DakinyConfig = self.bot.config
config: DakinySettings = self.bot.config
content = f'<@{interaction.user.id}> would like to add presence "{presence}."'
view = PresenceChange(presence)
await self.bot.get_channel(config.params.admin_channel_id).send(content=content, view=view)
@@ -65,7 +65,7 @@ class RequestCog(commands.Cog, name="Request Commands"):
interaction (nextcord.Interaction): Interaction that invoked the command.
new_nickname(str): The username to change to.
"""
config: DakinyConfig = self.bot.config
config: DakinySettings = self.bot.config
content = f'<@{interaction.user.id}> would like to change their username to "{new_nickname}."'
view = UsernameRequest(interaction.user.id, new_nickname)
await self.bot.get_channel(config.params.admin_channel_id).send(content=content, view=view)
+8 -8
View File
@@ -9,7 +9,7 @@ from classes.election import Election
from utils import GUILDS, get_current_election_cycle
if TYPE_CHECKING:
from DakinyConfig import DakinyConfig
from DakinySettings import DakinySettings
ME = 206602713511886849
@@ -44,7 +44,7 @@ class TestCog(commands.Cog, name="Test commands."):
Args:
interaction (nextcord.Interaction): Interaction with the message.
"""
config: DakinyConfig = self.bot.config
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
@@ -62,7 +62,7 @@ class TestCog(commands.Cog, name="Test commands."):
Args:
interaction (nextcord.Interaction): Interaction with the message.
"""
config: DakinyConfig = self.bot.config
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
@@ -80,7 +80,7 @@ class TestCog(commands.Cog, name="Test commands."):
Args:
interaction (nextcord.Interaction): Interaction with the message.
"""
config: DakinyConfig = self.bot.config
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
@@ -98,7 +98,7 @@ class TestCog(commands.Cog, name="Test commands."):
Args:
interaction (nextcord.Interaction): Interaction with the message.
"""
config: DakinyConfig = self.bot.config
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
@@ -116,7 +116,7 @@ class TestCog(commands.Cog, name="Test commands."):
Args:
interaction (nextcord.Interaction): Interaction with the message.
"""
config: DakinyConfig = self.bot.config
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
@@ -134,7 +134,7 @@ class TestCog(commands.Cog, name="Test commands."):
Args:
interaction (nextcord.Interaction): Interaction with the message.
"""
config: DakinyConfig = self.bot.config
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
@@ -152,7 +152,7 @@ class TestCog(commands.Cog, name="Test commands."):
Args:
interaction (nextcord.Interaction): Interaction with the message.
"""
config: DakinyConfig = self.bot.config
config: DakinySettings = self.bot.config
cycle = Election(
get_current_election_cycle(config),
config,
+2 -2
View File
@@ -17,7 +17,7 @@ from utils import get_current_election_cycle
if TYPE_CHECKING:
import nextcord
from DakinyConfig import DakinyConfig
from DakinySettings import DakinySettings
KANDY = 239547993106284544
@@ -76,7 +76,7 @@ class DailyLoop(commands.Cog, name="Daily Loop"):
Returns:
Election: Current election cycle, None if there is no election happening.
"""
config: DakinyConfig = self.bot.config
config: DakinySettings = self.bot.config
cycle = get_current_election_cycle(config)
# prevent exception from using cycle as an Int in an array