From 05d0653a5b4e7b2601f87d27f5b3013e87491248 Mon Sep 17 00:00:00 2001 From: alwayscompiling Date: Sun, 31 Jul 2022 22:45:57 -0400 Subject: [PATCH] Create guild class. --- data/guild.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 data/guild.py diff --git a/data/guild.py b/data/guild.py new file mode 100644 index 0000000..902858f --- /dev/null +++ b/data/guild.py @@ -0,0 +1,49 @@ +"""File for Guild class.""" + +import json + +from data.table import Table # pylint: disable=import-error + + +class Guild: + """Stores a guild's information.""" + + def __init__(self, guild_id: int) -> None: + self._guild_id: int = guild_id + self._highscore_channel_id: int = 0 + self._submission_channel_id: int = 0 + self._table_map: dict = {} + self._username_length: int = 12 + self._verification_channel_id: int = 0 + + # TODO create setters then classmethod from dict. Also need todict and string. Then test creation from json and then editting objects. + + @property + def guild_id(self) -> int: + """Getter for Guild id.""" + return self._guild_id + + @property + def highscore_channel(self) -> int: + """Getter for highscore channel id.""" + return self._highscore_channel_id + + @property + def submission_channel(self) -> int: + """Getter for submission channel id.""" + return self._submission_channel_id + + @property + def tables(self) -> "list[dict]": + """Getter for list of tables in Guild.""" + return self._table_map.values() + + @property + def username_length(self) -> int: + """Getter for username length.""" + return self._username_length + + @property + def verification_channel(self) -> int: + """Getter for verification channel id.""" + return self._verification_channel_id