Create guild class.

This commit is contained in:
alwayscompiling
2022-07-31 22:45:57 -04:00
parent 6758f4e90d
commit 05d0653a5b
+49
View File
@@ -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