Add commands to edit username length and category pad.
This commit is contained in:
+24
-1
@@ -16,6 +16,7 @@ class Guild:
|
||||
Args:
|
||||
guild_id (int): Discord Guild id of new Guild
|
||||
"""
|
||||
self._category_pad_length: int = 25
|
||||
self._guild_id: int = guild_id
|
||||
self._highscore_channel_id: int = 0
|
||||
self._submission_channel_id: int = 0
|
||||
@@ -45,6 +46,7 @@ class Guild:
|
||||
Guild: Populated Guild object
|
||||
"""
|
||||
guild = cls(guild_id)
|
||||
guild.category_pad_length = data["category_pad_length"]
|
||||
guild.highscore_channel = data["highscore_channel_id"]
|
||||
guild.submission_channel = data["submission_channel_id"]
|
||||
guild.username_length = data["username_length"]
|
||||
@@ -56,10 +58,30 @@ class Guild:
|
||||
|
||||
return guild
|
||||
|
||||
@property
|
||||
def category_pad_length(self) -> int:
|
||||
"""
|
||||
Getter for Category Pad Length.
|
||||
|
||||
Returns:
|
||||
int: Length to pad each category entry.
|
||||
"""
|
||||
return self._category_pad_length
|
||||
|
||||
@category_pad_length.setter
|
||||
def category_pad_length(self, length: int) -> None:
|
||||
"""
|
||||
Setter for Category Pad Length.
|
||||
|
||||
Args:
|
||||
length (int): New length to set.
|
||||
"""
|
||||
self._category_pad_length = length
|
||||
|
||||
@property
|
||||
def guild_id(self) -> int:
|
||||
"""
|
||||
Getter for Guild id
|
||||
Getter for Guild id.
|
||||
|
||||
Returns:
|
||||
int: Guild id
|
||||
@@ -190,6 +212,7 @@ class Guild:
|
||||
"""
|
||||
data: dict = {}
|
||||
|
||||
data["category_pad_length"] = self.category_pad_length
|
||||
data["highscore_channel_id"] = self.highscore_channel
|
||||
data["submission_channel_id"] = self.submission_channel
|
||||
data["tables"] = {}
|
||||
|
||||
Reference in New Issue
Block a user