Implement fixed node for token
All checks were successful
release-image / release-image (push) Successful in 2m4s

This commit is contained in:
Logan Cusano
2025-06-29 19:08:57 -04:00
parent df4e7f7d67
commit f2dd714571
2 changed files with 14 additions and 5 deletions

View File

@@ -38,7 +38,8 @@ class DiscordId:
name: str,
token: str,
active: bool,
guild_ids: List[str]):
guild_ids: List[str],
fixed_node: Optional[str]=None):
"""
Initializes a DiscordId object.
@@ -49,6 +50,7 @@ class DiscordId:
token: The authentication token.
active: Boolean indicating if the ID is active.
guild_ids: A list of guild IDs the Discord user is part of.
fixed_node: The node ID this DiscordId must use.
"""
self._id: str = str(_id)
self.discord_id: str = discord_id
@@ -56,6 +58,7 @@ class DiscordId:
self.token: str = token
self.active: bool = active
self.guild_ids: List[str] = guild_ids
self.fixed_node: Optional[str] = fixed_node
def __repr__(self) -> str:
"""
@@ -75,6 +78,7 @@ class DiscordId:
"token": self.token,
"active": self.active,
"guild_ids": self.guild_ids,
"fixed_node": self.fixed_node,
}
@classmethod
@@ -89,6 +93,7 @@ class DiscordId:
token=data.get("token", ""),
active=data.get("active", False), # Default to False if not present
guild_ids=data.get("guild_ids", []), # Default to empty list if not present
fixed_node=data.get("fixed_node", None), # Default to empty if not present
)