Implement fixed node for token
All checks were successful
release-image / release-image (push) Successful in 2m4s
All checks were successful
release-image / release-image (push) Successful in 2m4s
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user