This repository has been archived by the owner on May 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pixeldeee
committed
Aug 3, 2023
1 parent
8967719
commit caccaf6
Showing
5 changed files
with
72 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from typing import TypeAlias | ||
|
||
hash_str: TypeAlias = str | ||
permissions_set: TypeAlias = str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import Any | ||
|
||
from .annotations import hash_str, permissions_set | ||
|
||
class RoleTags: | ||
def __init__(self, data: dict[str, Any]) -> None: | ||
self.bot_id = int(x) if (x := data.get('bot_id')) else None | ||
self.integration_id = int(x) if (x := data.get('integration_id')) else None | ||
self.premium_subscriber = data.get('premium_subscriber') | ||
self.subscription_listing_id = int(x) if (x := data.get('subscription_listing_id')) else None | ||
self.available_for_purchase = data.get('available_for_purchase') | ||
self.guild_connections = data.get('guild_connections') | ||
|
||
|
||
class Role: | ||
def __init__(self, data: dict[str, Any]): | ||
self.id: int = data.get('id') | ||
self.name: str = data.get('name') | ||
self.color: int = data.get('color') | ||
self.hoist: bool = data.get('hoist') | ||
self.icon: hash_str | None = data.get('icon') | ||
self.unicode_emoji: str | None = data.get('unicode_emoji') | ||
self.position: int = data.get('position') | ||
self.permissions: permissions_set = data.get('permissions') | ||
self.managed: bool = data.get('managed') | ||
self.mentionable: bool = data.get('mentionable') | ||
self.tags: RoleTags = RoleTags(x) if (x := data.get('tags')) else None | ||
self.flags: int = data.get('flags') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters